public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
@ 2020-03-23 13:36 marxin at gcc dot gnu.org
  2020-03-23 13:37 ` [Bug debug/94277] " marxin at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-23 13:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94277
           Summary: [9/10 Regression] error: undef.c: ‘-fcompare-debug’
                    failure (length) since r9-6413-g1db01ff96aa5ce5c
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

I see the following error:

$ cat undef.c
static void f();
void h() {
  f();
}

$ gcc -c undef.c -fcompare-debug
undef.c:1:13: warning: ‘f’ used but never defined
    1 | static void f();
      |             ^
gcc: error: undef.c: ‘-fcompare-debug’ failure (length)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/94277] [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
  2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
@ 2020-03-23 13:37 ` marxin at gcc dot gnu.org
  2020-03-23 13:58 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-23 13:37 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |8.4.0
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |10.0, 9.3.0
   Last reconfirmed|                            |2020-03-23
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/94277] [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
  2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
  2020-03-23 13:37 ` [Bug debug/94277] " marxin at gcc dot gnu.org
@ 2020-03-23 13:58 ` rguenth at gcc dot gnu.org
  2020-03-23 14:45 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-03-23 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.4
           Priority|P3                          |P2

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/94277] [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
  2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
  2020-03-23 13:37 ` [Bug debug/94277] " marxin at gcc dot gnu.org
  2020-03-23 13:58 ` rguenth at gcc dot gnu.org
@ 2020-03-23 14:45 ` jakub at gcc dot gnu.org
  2020-03-23 14:45 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-23 14:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the real problem is r6-3345-g4ec39494ac756ee9525371d2225f55f18200d8e0 .

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/94277] [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
  2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-03-23 14:45 ` jakub at gcc dot gnu.org
@ 2020-03-23 14:45 ` jakub at gcc dot gnu.org
  2020-03-23 14:58 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-23 14:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Actually even older.  Anyway, this is another case where -w affects
-fcompare-debug.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/94277] [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
  2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-03-23 14:45 ` jakub at gcc dot gnu.org
@ 2020-03-23 14:58 ` jakub at gcc dot gnu.org
  2020-03-24  8:34 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-23 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48092
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48092&action=edit
gcc10-pr94277.patch

Untested fix.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/94277] [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
  2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-03-23 14:58 ` jakub at gcc dot gnu.org
@ 2020-03-24  8:34 ` cvs-commit at gcc dot gnu.org
  2020-03-24  8:38 ` [Bug debug/94277] [9 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-03-24  8:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:047811579f09048ed538674fd5251b35e5a92025

commit r10-7349-g047811579f09048ed538674fd5251b35e5a92025
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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/94277] [9 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
  2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-03-24  8:34 ` cvs-commit at gcc dot gnu.org
@ 2020-03-24  8:38 ` jakub at gcc dot gnu.org
  2020-04-07 19:03 ` cvs-commit at gcc dot gnu.org
  2020-04-07 20:01 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-24  8:38 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10 Regression] error:    |[9 Regression] error:
                   |undef.c: ‘-fcompare-debug’  |undef.c: ‘-fcompare-debug’
                   |failure (length) since      |failure (length) since
                   |r9-6413-g1db01ff96aa5ce5c   |r9-6413-g1db01ff96aa5ce5c

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/94277] [9 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
  2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2020-03-24  8:38 ` [Bug debug/94277] [9 " jakub at gcc dot gnu.org
@ 2020-04-07 19:03 ` cvs-commit at gcc dot gnu.org
  2020-04-07 20:01 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-07 19:03 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/94277] [9 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c
  2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2020-04-07 19:03 ` cvs-commit at gcc dot gnu.org
@ 2020-04-07 20:01 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-07 20:01 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-04-07 20:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 13:36 [Bug debug/94277] New: [9/10 Regression] error: undef.c: ‘-fcompare-debug’ failure (length) since r9-6413-g1db01ff96aa5ce5c marxin at gcc dot gnu.org
2020-03-23 13:37 ` [Bug debug/94277] " marxin at gcc dot gnu.org
2020-03-23 13:58 ` rguenth at gcc dot gnu.org
2020-03-23 14:45 ` jakub at gcc dot gnu.org
2020-03-23 14:45 ` jakub at gcc dot gnu.org
2020-03-23 14:58 ` jakub at gcc dot gnu.org
2020-03-24  8:34 ` cvs-commit at gcc dot gnu.org
2020-03-24  8:38 ` [Bug debug/94277] [9 " jakub at gcc dot gnu.org
2020-04-07 19:03 ` cvs-commit at gcc dot gnu.org
2020-04-07 20:01 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).