Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gcc-jit coverage to the valgrind test suite #12818

Merged
merged 1 commit into from Jun 30, 2021
Merged

Conversation

grisu48
Copy link
Contributor

@grisu48 grisu48 commented Jun 30, 2021

On request adding coverage to the gcc-jit compiler within the valgrind test suite.
This test will run on openSUSE Tumbleweed only, as the feature is quiet new and not applicable yet to SLES.

@marxin
Copy link
Contributor

marxin commented Jun 30, 2021

Thank you for working on that. Few comments I have:

  • I would not call it a valgrind JIT test as we want to test only JIT functionality; actually running the test-case in valgrind results in quite some valgrind warnings:
==26730== 
==26730== Conditional jump or move depends on uninitialised value(s)
==26730==    at 0x559D2E0: UnknownInlinedFun (sparseset.h:146)
==26730==    by 0x559D2E0: mark_pseudo_regno_live(int) (ira-lives.c:326)
==26730==    by 0x5592CBE: process_bb_node_lives(ira_loop_tree_node*) [clone .lto_priv.0] (ira-lives.c:1434)
==26730==    by 0x557FE3E: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1801)
==26730==    by 0x557BB9B: UnknownInlinedFun (ira-lives.c:1734)
==26730==    by 0x557BB9B: ira_build() (ira-build.c:3428)
==26730==    by 0x555D997: (anonymous namespace)::pass_ira::execute(function*) [clone .lto_priv.0] (ira.c:5655)
==26730==    by 0x5305227: execute_one_pass(opt_pass*) (passes.c:2567)
==26730==    by 0x5341264: UnknownInlinedFun (passes.c:2656)
==26730==    by 0x5341264: UnknownInlinedFun (passes.c:2657)
==26730==    by 0x5341264: execute_pass_list(function*, opt_pass*) (passes.c:2667)
==26730==    by 0x57673EA: cgraph_node::expand() (cgraphunit.c:1830)
==26730==    by 0x5304701: UnknownInlinedFun (cgraphunit.c:2069)
==26730==    by 0x5304701: UnknownInlinedFun (cgraphunit.c:2137)
==26730==    by 0x5304701: symbol_table::compile() (cgraphunit.c:2355)
==26730==    by 0x575154E: UnknownInlinedFun (cgraphunit.c:2539)
==26730==    by 0x575154E: compile_file() [clone .lto_priv.0] (toplev.c:482)
==26730==    by 0x58DEB21: gcc::jit::playback::context::compile() (toplev.c:2201)
==26730==    by 0x58BFCB9: UnknownInlinedFun (jit-recording.c:1397)
==26730==    by 0x58BFCB9: gcc_jit_context_compile (libgccjit.c:2827)

Btw. these are known false positives.

  • Please preserve the original copyright of the test-case:
/* Usage example for libgccjit.so
   Copyright (C) 2014-2021 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  */

@grisu48 grisu48 added the WIP Work in progress label Jun 30, 2021
@grisu48 grisu48 force-pushed the gcc branch 3 times, most recently from ae6cb97 to c31cdfb Compare June 30, 2021 09:08
@grisu48
Copy link
Contributor Author

grisu48 commented Jun 30, 2021

Indeed, it makes perhaps more sense to move this to an additional test gcc.pm. I've moved it there and updated the schedule for Tumbleweed accordingly.

tests/console/gcc.pm Outdated Show resolved Hide resolved
tests/console/gcc.pm Outdated Show resolved Hide resolved
Copy link
Member

@ge0r ge0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I would also add a cleanup function (in the perl side) but all looks good otherwise, nice library!

@grisu48
Copy link
Contributor Author

grisu48 commented Jun 30, 2021

LGTM! I would also add a cleanup function (in the perl side) but all looks good otherwise, nice library!

What kind of cleanup are you thinking of? I don't see much potential for cleanup or do you mean to just put the skeleton code there?

@ge0r
Copy link
Member

ge0r commented Jun 30, 2021

LGTM! I would also add a cleanup function (in the perl side) but all looks good otherwise, nice library!

What kind of cleanup are you thinking of? I don't see much potential for cleanup or do you mean to just put the skeleton code there?

Nothing special, just deleting the source file and binary. But again, no strong opinion on it

On request of Martin Liska, adding coverage to the gcc-jit compiler
within the valgrind test suite. This test will run on openSUSE
Tumbleweed only, as the feature is quiet new and not applicable yet to
SLES.
@ge0r ge0r merged commit 37287dc into os-autoinst:master Jun 30, 2021
@grisu48 grisu48 deleted the gcc branch July 7, 2021 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants