[Bug debug/94277] [9 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 7 19:03:56 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94277

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:4ac9ab60f06020a24e851ebe3eeacc1b3bffa849

commit r9-8468-g4ac9ab60f06020a24e851ebe3eeacc1b3bffa849
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Mar 24 09:33:17 2020 +0100

    cgraphunit: Avoid code generation differences based on -w/TREE_NO_WARNING
[PR94277]

    The following testcase FAILs with -fcompare-debug, but not because -g vs.
    -g0 would make a difference, but because the second compilation is done
with
    -w in order not to emit warnings twice and -w seems to affect the *.gkd
dump
    content.
    This is because TREE_NO_WARNING flag, or warn_unused_function does affect
    not just whether a warning/pedwarn is printed, but also whether we set
    TREE_PUBLIC on such decls.
    The following patch makes sure we set it regardless of anything warning
    related (TREE_NO_WARNING or warn_unused_function).

    2020-03-24  Jakub Jelinek  <jakub@redhat.com>

            PR debug/94277
            * cgraphunit.c (check_global_declaration): For DECL_EXTERNAL and
            non-TREE_PUBLIC non-DECL_ARTIFICIAL FUNCTION_DECLs, set TREE_PUBLIC
            regardless of whether TREE_NO_WARNING is set on it or whether
            warn_unused_function is true or not.

            * gcc.dg/pr94277.c: New test.


More information about the Gcc-bugs mailing list