[Bug debug/94323] [10 Regression] g++: error: x.cpp: ‘-fcompare-debug’ failure since r10-7359-g6e771c087b10d5b730240ea35478eab8694c9c5d
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 26 09:36:58 GMT 2020
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.
More information about the Gcc-bugs
mailing list