* [Bug debug/104337] [9/10/11/12 Regression] ICE when compiling with optimize attribute at -m32 -g3 -O0
2022-02-01 22:52 [Bug debug/104337] New: ICE when compiling with optimize attribute at -m32 -g3 -O0 tlwang at uwaterloo dot ca
@ 2022-02-02 5:11 ` pinskia at gcc dot gnu.org
2022-02-02 5:16 ` [Bug debug/104337] [9/10/11/12 Regression] ICE when compiling with optimize attribute and always_inline " pinskia at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-02 5:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104337
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Target Milestone|--- |9.0
Known to fail| |11.2.0, 9.1.0
Known to work| |6.1.0, 7.1.0, 8.1.0, 8.5.0
Summary|ICE when compiling with |[9/10/11/12 Regression] ICE
|optimize attribute at -m32 |when compiling with
|-g3 -O0 |optimize attribute at -m32
| |-g3 -O0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/104337] [9/10/11/12 Regression] ICE when compiling with optimize attribute and always_inline at -m32 -g3 -O0
2022-02-01 22:52 [Bug debug/104337] New: ICE when compiling with optimize attribute at -m32 -g3 -O0 tlwang at uwaterloo dot ca
2022-02-02 5:11 ` [Bug debug/104337] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
@ 2022-02-02 5:16 ` pinskia at gcc dot gnu.org
2022-02-02 10:20 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-02 5:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104337
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2022-02-02
Status|UNCONFIRMED |NEW
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. We inline c but something goes wrong otherwise.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/104337] [9/10/11/12 Regression] ICE when compiling with optimize attribute and always_inline at -m32 -g3 -O0
2022-02-01 22:52 [Bug debug/104337] New: ICE when compiling with optimize attribute at -m32 -g3 -O0 tlwang at uwaterloo dot ca
2022-02-02 5:11 ` [Bug debug/104337] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
2022-02-02 5:16 ` [Bug debug/104337] [9/10/11/12 Regression] ICE when compiling with optimize attribute and always_inline " pinskia at gcc dot gnu.org
@ 2022-02-02 10:20 ` rguenth at gcc dot gnu.org
2022-02-02 10:20 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-02 10:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104337
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Target| |x86_64-*-*
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look. Note this is the inline copy of the result decl of 'c'
which is the RESULT_DECL 'd' having an abstract origin of the VAR_DECL 'd'.
This abstract origin is set by NRV:
/* At this point we know that all the return statements return the
same local which has suitable attributes for NRV. Copy debugging
information from FOUND to RESULT if it will be useful. But don't set
DECL_ABSTRACT_ORIGIN to point at another function. */
if (!DECL_IGNORED_P (found)
&& !(DECL_ABSTRACT_ORIGIN (found)
&& DECL_CONTEXT (DECL_ABSTRACT_ORIGIN (found)) !=
current_function_decl))
{
DECL_NAME (result) = DECL_NAME (found);
DECL_SOURCE_LOCATION (result) = DECL_SOURCE_LOCATION (found);
DECL_ABSTRACT_ORIGIN (result) = DECL_ABSTRACT_ORIGIN (found);
}
but NRV runs _after_ the function was inlined and thus affects the inlined
variables copy indirectly. We may adjust the abstract origin of
a variable only at the point we create it, not further along the path since
otherwise the (new) invariant that the abstract origin is always the ultimate
origin cannot be maintained.
The intent of what NRV does is OK I guess and it improves the debug
experience. But I also notice we do
SET_DECL_VALUE_EXPR (found, result);
DECL_HAS_VALUE_EXPR_P (found) = 1;
the code is there since the merge from tree-ssa which added tree-nrv.c.
Jakub added the DECL_VALUE_EXPR in g:938650d8fddb878f623e315f0b7fd94b217efa96
and Jason added the abstract origin setting conditional in g:7716876bbd3a
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/104337] [9/10/11/12 Regression] ICE when compiling with optimize attribute and always_inline at -m32 -g3 -O0
2022-02-01 22:52 [Bug debug/104337] New: ICE when compiling with optimize attribute at -m32 -g3 -O0 tlwang at uwaterloo dot ca
` (2 preceding siblings ...)
2022-02-02 10:20 ` rguenth at gcc dot gnu.org
@ 2022-02-02 10:20 ` rguenth at gcc dot gnu.org
2022-02-03 15:02 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-02 10:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104337
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/104337] [9/10/11/12 Regression] ICE when compiling with optimize attribute and always_inline at -m32 -g3 -O0
2022-02-01 22:52 [Bug debug/104337] New: ICE when compiling with optimize attribute at -m32 -g3 -O0 tlwang at uwaterloo dot ca
` (3 preceding siblings ...)
2022-02-02 10:20 ` rguenth at gcc dot gnu.org
@ 2022-02-03 15:02 ` cvs-commit at gcc dot gnu.org
2022-03-16 8:22 ` [Bug debug/104337] [9/10/11 " cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-03 15:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104337
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:1d5c7584fd6e72bfdbede86cef5ff04ae35f9744
commit r12-7026-g1d5c7584fd6e72bfdbede86cef5ff04ae35f9744
Author: Richard Biener <rguenther@suse.de>
Date: Thu Feb 3 11:20:59 2022 +0100
debug/104337 - avoid messing with the abstract origin chain in NRV
The following avoids NRV from massaging DECL_ABSTRACT_ORIGIN after
variable creation since NRV runs _after_ the function was inlined and thus
affects the inlined variables copy indirectly. We may adjust the abstract
origin of a variable only at the point we create it, not further along the
path since otherwise the (new) invariant that the abstract origin is always
the ultimate origin cannot be maintained.
The intent of what NRV does is OK I guess and it may improve the debug
experience. But I also notice we do
SET_DECL_VALUE_EXPR (found, result);
DECL_HAS_VALUE_EXPR_P (found) = 1;
the code is there since the merge from tree-ssa which added tree-nrv.c.
Jakub added the DECL_VALUE_EXPR in
g:938650d8fddb878f623e315f0b7fd94b217efa96
and Jason added the abstract origin setting conditional in g:7716876bbd3a
The follwoing takes the radical approach and remove the attempt
to "optimize" the debug info.
The gdb testsuites show no regressions.
2022-02-03 Richard Biener <rguenther@suse.de>
PR debug/104337
* tree-nrv.cc (pass_nrv::execute): Remove tieing result and found
together via DECL_ABSTRACT_ORIGIN.
* gcc.dg/debug/pr104337.c: New testcase.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/104337] [9/10/11 Regression] ICE when compiling with optimize attribute and always_inline at -m32 -g3 -O0
2022-02-01 22:52 [Bug debug/104337] New: ICE when compiling with optimize attribute at -m32 -g3 -O0 tlwang at uwaterloo dot ca
` (4 preceding siblings ...)
2022-02-03 15:02 ` cvs-commit at gcc dot gnu.org
@ 2022-03-16 8:22 ` cvs-commit at gcc dot gnu.org
2022-04-21 12:51 ` [Bug debug/104337] [9/10 " cvs-commit at gcc dot gnu.org
2022-05-27 9:54 ` [Bug debug/104337] [9 " rguenth at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-16 8:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104337
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:24ec11aec20fd621a74c4a3bc7d61aaddf8ef8c8
commit r11-9657-g24ec11aec20fd621a74c4a3bc7d61aaddf8ef8c8
Author: Richard Biener <rguenther@suse.de>
Date: Thu Feb 3 11:20:59 2022 +0100
debug/104337 - avoid messing with the abstract origin chain in NRV
The following avoids NRV from massaging DECL_ABSTRACT_ORIGIN after
variable creation since NRV runs _after_ the function was inlined and thus
affects the inlined variables copy indirectly. We may adjust the abstract
origin of a variable only at the point we create it, not further along the
path since otherwise the (new) invariant that the abstract origin is always
the ultimate origin cannot be maintained.
The intent of what NRV does is OK I guess and it may improve the debug
experience. But I also notice we do
SET_DECL_VALUE_EXPR (found, result);
DECL_HAS_VALUE_EXPR_P (found) = 1;
the code is there since the merge from tree-ssa which added tree-nrv.c.
Jakub added the DECL_VALUE_EXPR in
g:938650d8fddb878f623e315f0b7fd94b217efa96
and Jason added the abstract origin setting conditional in g:7716876bbd3a
The follwoing takes the radical approach and remove the attempt
to "optimize" the debug info.
The gdb testsuites show no regressions.
2022-02-03 Richard Biener <rguenther@suse.de>
PR debug/104337
* tree-nrv.c (pass_nrv::execute): Remove tieing result and found
together via DECL_ABSTRACT_ORIGIN.
* gcc.dg/debug/pr104337.c: New testcase.
(cherry picked from commit 1d5c7584fd6e72bfdbede86cef5ff04ae35f9744)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/104337] [9/10 Regression] ICE when compiling with optimize attribute and always_inline at -m32 -g3 -O0
2022-02-01 22:52 [Bug debug/104337] New: ICE when compiling with optimize attribute at -m32 -g3 -O0 tlwang at uwaterloo dot ca
` (5 preceding siblings ...)
2022-03-16 8:22 ` [Bug debug/104337] [9/10/11 " cvs-commit at gcc dot gnu.org
@ 2022-04-21 12:51 ` cvs-commit at gcc dot gnu.org
2022-05-27 9:54 ` [Bug debug/104337] [9 " rguenth at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-21 12:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104337
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:f058e124350d3b19a79b3b7754b2ccab59bec7b1
commit r10-10546-gf058e124350d3b19a79b3b7754b2ccab59bec7b1
Author: Richard Biener <rguenther@suse.de>
Date: Thu Feb 3 11:20:59 2022 +0100
debug/104337 - avoid messing with the abstract origin chain in NRV
The following avoids NRV from massaging DECL_ABSTRACT_ORIGIN after
variable creation since NRV runs _after_ the function was inlined and thus
affects the inlined variables copy indirectly. We may adjust the abstract
origin of a variable only at the point we create it, not further along the
path since otherwise the (new) invariant that the abstract origin is always
the ultimate origin cannot be maintained.
The intent of what NRV does is OK I guess and it may improve the debug
experience. But I also notice we do
SET_DECL_VALUE_EXPR (found, result);
DECL_HAS_VALUE_EXPR_P (found) = 1;
the code is there since the merge from tree-ssa which added tree-nrv.c.
Jakub added the DECL_VALUE_EXPR in
g:938650d8fddb878f623e315f0b7fd94b217efa96
and Jason added the abstract origin setting conditional in g:7716876bbd3a
The follwoing takes the radical approach and remove the attempt
to "optimize" the debug info.
The gdb testsuites show no regressions.
2022-02-03 Richard Biener <rguenther@suse.de>
PR debug/104337
* tree-nrv.c (pass_nrv::execute): Remove tieing result and found
together via DECL_ABSTRACT_ORIGIN.
* gcc.dg/debug/pr104337.c: New testcase.
(cherry picked from commit 1d5c7584fd6e72bfdbede86cef5ff04ae35f9744)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/104337] [9 Regression] ICE when compiling with optimize attribute and always_inline at -m32 -g3 -O0
2022-02-01 22:52 [Bug debug/104337] New: ICE when compiling with optimize attribute at -m32 -g3 -O0 tlwang at uwaterloo dot ca
` (6 preceding siblings ...)
2022-04-21 12:51 ` [Bug debug/104337] [9/10 " cvs-commit at gcc dot gnu.org
@ 2022-05-27 9:54 ` rguenth at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27 9:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104337
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |9.5.0
Target Milestone|9.0 |10.4
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed for GCC 10.4.
^ permalink raw reply [flat|nested] 9+ messages in thread