public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/94323] New: [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d
@ 2020-03-25 12:50 marxin at gcc dot gnu.org
  2020-03-25 12:50 ` [Bug debug/94323] " marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-25 12:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94323
           Summary: [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’
                    failure since
                    r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d
           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, jason at gcc dot gnu.org
  Target Milestone: ---

Since the revision I see:

$ cat x.cpp
volatile int a;
void fn1() {
  ({ a; });
}

$ g++ x.cpp -O2 -fcompare-debug -c
g++: error: x.cpp: ‘-fcompare-debug’ failure

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

* [Bug debug/94323] [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d
  2020-03-25 12:50 [Bug debug/94323] New: [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d marxin at gcc dot gnu.org
@ 2020-03-25 12:50 ` marxin at gcc dot gnu.org
  2020-03-25 16:03 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-25 12:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |10.0
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
      Known to work|                            |9.3.0
   Target Milestone|---                         |10.0
   Last reconfirmed|                            |2020-03-25

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

* [Bug debug/94323] [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d
  2020-03-25 12:50 [Bug debug/94323] New: [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d marxin at gcc dot gnu.org
  2020-03-25 12:50 ` [Bug debug/94323] " marxin at gcc dot gnu.org
@ 2020-03-25 16:03 ` jakub at gcc dot gnu.org
  2020-03-25 16:25 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-25 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The cause is again DEBUG_BEGIN_STMTs.  cp_parser_statement_expr's
4941      return cp_expr (expr, combined_loc);
now calls protected_set_expr_location on expr, which for -g0 is a
CLEANUP_POINT_EXPR, but with -g is STATEMENT_LIST which contains a
DEBUG_BEGIN_STMT and that CLEANUP_POINT_EXPR.
protected_set_expr_location will do:
5147      if (CAN_HAVE_LOCATION_P (t))
5148        SET_EXPR_LOCATION (t, loc);
so overrides EXPR_LOCATION on the CLEANUP_POINT_EXPR, but in the -g case
doesn't.
Do we want protected_set_expr_location to handle STATEMENT_LISTs that only
contain a single non-DEBUG_* stmt by recursing into that?

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

* [Bug debug/94323] [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d
  2020-03-25 12:50 [Bug debug/94323] New: [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d marxin at gcc dot gnu.org
  2020-03-25 12:50 ` [Bug debug/94323] " marxin at gcc dot gnu.org
  2020-03-25 16:03 ` jakub at gcc dot gnu.org
@ 2020-03-25 16:25 ` jakub at gcc dot gnu.org
  2020-03-26  9:36 ` cvs-commit at gcc dot gnu.org
  2020-03-26  9:44 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-25 16:25 UTC (permalink / raw)
  To: gcc-bugs

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

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 #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48121
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48121&action=edit
gcc10-pr94323.patch

Untested fix.  Though, it is very ugly.

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

* [Bug debug/94323] [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d
  2020-03-25 12:50 [Bug debug/94323] New: [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-03-25 16:25 ` jakub at gcc dot gnu.org
@ 2020-03-26  9:36 ` cvs-commit at gcc dot gnu.org
  2020-03-26  9:44 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-03-26  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:da920d0c46c38fe25ee0b597a8698d3a4d098f3c

commit r10-7397-gda920d0c46c38fe25ee0b597a8698d3a4d098f3c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Mar 26 10:35:52 2020 +0100

    tree: Fix -fcompare-debug issues due to protected_set_expr_location
[PR94323]

    The following testcase FAILs since recently when the C++ FE started calling
    protected_set_expr_location more often.
    With -g, it is called on a STATEMENT_LIST that contains a DEBUG_BEGIN_STMT
    and CLEANUP_POINT_EXPR, and as STATEMENT_LISTs have !CAN_HAVE_LOCATION_P,
    nothing is set.  Without -g, it is called instead on the CLEANUP_POINT_EXPR
    directly and changes its location.

    The following patch recurses on the single non-DEBUG_BEGIN_STMT statement
    of a STATEMENT_LIST if any to make the two behave the same.

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

            PR debug/94323
            * tree.c (protected_set_expr_location): Recurse on STATEMENT_LIST
            that contains exactly one non-DEBUG_BEGIN_STMT statement.

            * g++.dg/debug/pr94323.C: New test.

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

* [Bug debug/94323] [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d
  2020-03-25 12:50 [Bug debug/94323] New: [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-03-26  9:36 ` cvs-commit at gcc dot gnu.org
@ 2020-03-26  9:44 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-26  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2020-03-26  9:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 12:50 [Bug debug/94323] New: [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d marxin at gcc dot gnu.org
2020-03-25 12:50 ` [Bug debug/94323] " marxin at gcc dot gnu.org
2020-03-25 16:03 ` jakub at gcc dot gnu.org
2020-03-25 16:25 ` jakub at gcc dot gnu.org
2020-03-26  9:36 ` cvs-commit at gcc dot gnu.org
2020-03-26  9:44 ` 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).