* [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-15 18:05 [Bug lto/63546] New: ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64 trippels at gcc dot gnu.org
@ 2014-10-16 9:36 ` rguenth at gcc dot gnu.org
2014-10-16 11:02 ` hubicka at ucw dot cz
` (8 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-16 9:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63546
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
This may be too late to get at lto_file_decl_datas?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-15 18:05 [Bug lto/63546] New: ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64 trippels at gcc dot gnu.org
2014-10-16 9:36 ` [Bug lto/63546] " rguenth at gcc dot gnu.org
@ 2014-10-16 11:02 ` hubicka at ucw dot cz
2014-10-16 15:13 ` hubicka at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: hubicka at ucw dot cz @ 2014-10-16 11:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63546
--- Comment #2 from Jan Hubicka <hubicka at ucw dot cz> ---
> This may be too late to get at lto_file_decl_datas?
I think the problem is dwarf2out for whatever reason referring to a symbol that
was optimized out...
It does not make sense to try to figure out section of b when b is not going to
be output.
Honza
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-15 18:05 [Bug lto/63546] New: ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64 trippels at gcc dot gnu.org
2014-10-16 9:36 ` [Bug lto/63546] " rguenth at gcc dot gnu.org
2014-10-16 11:02 ` hubicka at ucw dot cz
@ 2014-10-16 15:13 ` hubicka at gcc dot gnu.org
2014-10-16 15:57 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-10-16 15:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63546
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-10-16
CC| |ccoutant at google dot com,
| |jakub at redhat dot com,
| |jason at redhat dot com
Ever confirmed|0 |1
--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
OK, the problem seems to be that dwarf2out tries to produce RTL for a variable
that is optimized out. This happens here:
/* Try harder to get a rtl. If this symbol ends up not being emitted
in the current CU, resolve_addr will remove the expression referencing
it. */
if (rtl == NULL_RTX
&& TREE_CODE (decl) == VAR_DECL
&& !DECL_EXTERNAL (decl)
&& TREE_STATIC (decl)
&& DECL_NAME (decl)
&& !DECL_HARD_REGISTER (decl)
&& DECL_MODE (decl) != VOIDmode)
{
rtl = make_decl_rtl_for_debug (decl);
if (!MEM_P (rtl)
|| GET_CODE (XEXP (rtl, 0)) != SYMBOL_REF
|| SYMBOL_REF_DECL (XEXP (rtl, 0)) != decl)
rtl = NULL_RTX;
}
producing RTL brings the function in, because it wants to work out its section
that breaks. I do not think dwarf2out really needs RTL for variable that was
never output.
Shall we kludge around and make make_decl_rtl-for_debug to not ICE but return
sort of random RTL or shall we just prevent this path with reference_to_unused
check?
For Martin and Trevor, I think safe workaround is to just comment out this
path.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-15 18:05 [Bug lto/63546] New: ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64 trippels at gcc dot gnu.org
` (2 preceding siblings ...)
2014-10-16 15:13 ` hubicka at gcc dot gnu.org
@ 2014-10-16 15:57 ` jakub at gcc dot gnu.org
2014-10-16 16:14 ` Jan Hubicka
2014-10-16 16:15 ` hubicka at ucw dot cz
` (5 subsequent siblings)
9 siblings, 1 reply; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-16 15:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63546
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #3)
> OK, the problem seems to be that dwarf2out tries to produce RTL for a
> variable that is optimized out. This happens here:
>
> /* Try harder to get a rtl. If this symbol ends up not being emitted
> in the current CU, resolve_addr will remove the expression referencing
> it. */
> if (rtl == NULL_RTX
> && TREE_CODE (decl) == VAR_DECL
> && !DECL_EXTERNAL (decl)
> && TREE_STATIC (decl)
> && DECL_NAME (decl)
> && !DECL_HARD_REGISTER (decl)
> && DECL_MODE (decl) != VOIDmode)
> {
> rtl = make_decl_rtl_for_debug (decl);
> if (!MEM_P (rtl)
> || GET_CODE (XEXP (rtl, 0)) != SYMBOL_REF
> || SYMBOL_REF_DECL (XEXP (rtl, 0)) != decl)
> rtl = NULL_RTX;
> }
>
> producing RTL brings the function in, because it wants to work out its
> section that breaks. I do not think dwarf2out really needs RTL for variable
> that was never output.
>
> Shall we kludge around and make make_decl_rtl-for_debug to not ICE but
> return sort of random RTL or shall we just prevent this path with
> reference_to_unused check?
>
> For Martin and Trevor, I think safe workaround is to just comment out this
> path.
Commenting that out will severely decrease debug info quality.
Yes, dwarf2out really needs a RTL for those, and some that will not affect
-fcompare-debug, with the right (mangled?) name of the var and various other
attributes on the MEM.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-16 15:57 ` jakub at gcc dot gnu.org
@ 2014-10-16 16:14 ` Jan Hubicka
0 siblings, 0 replies; 12+ messages in thread
From: Jan Hubicka @ 2014-10-16 16:14 UTC (permalink / raw)
To: jakub at gcc dot gnu.org; +Cc: gcc-bugs
>
> Commenting that out will severely decrease debug info quality.
It was meant as a workaround for PPC Firefox builds ;)
> Yes, dwarf2out really needs a RTL for those, and some that will not affect
> -fcompare-debug, with the right (mangled?) name of the var and various other
> attributes on the MEM.
Why are those needed for variables that was fully optimized out? Mangled name
is acccessible via DECL_ASSEMBLER_NAME, so it may be prettier if dwarf2out
took it directly from DECL rather than going to RTL.
I suppose one can bypass the whole ancros machinery for those and avoid the
ICE. Produced RTL however won't be useful for any real work on it.
Honza
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-15 18:05 [Bug lto/63546] New: ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64 trippels at gcc dot gnu.org
` (3 preceding siblings ...)
2014-10-16 15:57 ` jakub at gcc dot gnu.org
@ 2014-10-16 16:15 ` hubicka at ucw dot cz
[not found] ` <bug-63546-4-pR4ZD55AyB@http.gcc.gnu.org/bugzilla/>
` (4 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: hubicka at ucw dot cz @ 2014-10-16 16:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63546
--- Comment #5 from Jan Hubicka <hubicka at ucw dot cz> ---
>
> Commenting that out will severely decrease debug info quality.
It was meant as a workaround for PPC Firefox builds ;)
> Yes, dwarf2out really needs a RTL for those, and some that will not affect
> -fcompare-debug, with the right (mangled?) name of the var and various other
> attributes on the MEM.
Why are those needed for variables that was fully optimized out? Mangled name
is acccessible via DECL_ASSEMBLER_NAME, so it may be prettier if dwarf2out
took it directly from DECL rather than going to RTL.
I suppose one can bypass the whole ancros machinery for those and avoid the
ICE. Produced RTL however won't be useful for any real work on it.
Honza
^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <bug-63546-4-pR4ZD55AyB@http.gcc.gnu.org/bugzilla/>]
* Re: [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
[not found] ` <bug-63546-4-pR4ZD55AyB@http.gcc.gnu.org/bugzilla/>
@ 2014-10-16 16:29 ` Jan Hubicka
0 siblings, 0 replies; 12+ messages in thread
From: Jan Hubicka @ 2014-10-16 16:29 UTC (permalink / raw)
To: jakub at gcc dot gnu.org; +Cc: gcc-bugs
Here we die because we do not have variable constructor in LTO stream because
the variable was optimized out at compile time already. Do we still need to
build RTL here? We can easily check for optimized out vars...
But if we need a placeholder RTL, I suppose most practical variant would be
to avoid get_variable_section from ICEing for those optimized out vars and
just assume something (it is all about decision whether the var will be in
rodata/rodata.rel or rodata.rel.local - definitely not relevant for dwarf2out)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-15 18:05 [Bug lto/63546] New: ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64 trippels at gcc dot gnu.org
` (5 preceding siblings ...)
[not found] ` <bug-63546-4-pR4ZD55AyB@http.gcc.gnu.org/bugzilla/>
@ 2014-10-16 16:30 ` hubicka at ucw dot cz
2014-10-16 16:44 ` hubicka at ucw dot cz
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: hubicka at ucw dot cz @ 2014-10-16 16:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63546
--- Comment #7 from Jan Hubicka <hubicka at ucw dot cz> ---
Here we die because we do not have variable constructor in LTO stream because
the variable was optimized out at compile time already. Do we still need to
build RTL here? We can easily check for optimized out vars...
But if we need a placeholder RTL, I suppose most practical variant would be
to avoid get_variable_section from ICEing for those optimized out vars and
just assume something (it is all about decision whether the var will be in
rodata/rodata.rel or rodata.rel.local - definitely not relevant for dwarf2out)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-15 18:05 [Bug lto/63546] New: ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64 trippels at gcc dot gnu.org
` (6 preceding siblings ...)
2014-10-16 16:30 ` hubicka at ucw dot cz
@ 2014-10-16 16:44 ` hubicka at ucw dot cz
2015-02-07 10:49 ` trippels at gcc dot gnu.org
2015-03-02 11:26 ` trippels at gcc dot gnu.org
9 siblings, 0 replies; 12+ messages in thread
From: hubicka at ucw dot cz @ 2014-10-16 16:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63546
--- Comment #8 from Jan Hubicka <hubicka at ucw dot cz> ---
Hi,
this patch should avoid production of RTL only for those vars that we know are
never used by real code.
Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 216317)
+++ dwarf2out.c (working copy)
@@ -15755,7 +15755,9 @@ rtl_for_decl_location (tree decl)
&& TREE_STATIC (decl)
&& DECL_NAME (decl)
&& !DECL_HARD_REGISTER (decl)
- && DECL_MODE (decl) != VOIDmode)
+ && DECL_MODE (decl) != VOIDmode
+ && (symtab->state <= CONSTRUCTION
+ || varpool_node::get (decl)))
{
rtl = make_decl_rtl_for_debug (decl);
if (!MEM_P (rtl)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-15 18:05 [Bug lto/63546] New: ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64 trippels at gcc dot gnu.org
` (7 preceding siblings ...)
2014-10-16 16:44 ` hubicka at ucw dot cz
@ 2015-02-07 10:49 ` trippels at gcc dot gnu.org
2015-03-02 11:26 ` trippels at gcc dot gnu.org
9 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-02-07 10:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63546
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Priority|P3 |P1
Target Milestone|--- |5.0
--- Comment #9 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Adjusting importance because this is an ice-on-valid-code issue
on a primary platform.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug lto/63546] ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64
2014-10-15 18:05 [Bug lto/63546] New: ICE: Segmentation fault in lto_get_decl_name_mapping on ppc64 trippels at gcc dot gnu.org
` (8 preceding siblings ...)
2015-02-07 10:49 ` trippels at gcc dot gnu.org
@ 2015-03-02 11:26 ` trippels at gcc dot gnu.org
9 siblings, 0 replies; 12+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-02 11:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63546
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #10 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Seems to be fixed. Closing.
^ permalink raw reply [flat|nested] 12+ messages in thread