* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
@ 2020-10-24 20:06 ` slyfox at gcc dot gnu.org
2020-10-26 8:14 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: slyfox at gcc dot gnu.org @ 2020-10-24 20:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
--- Comment #1 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
If I change 'abort' name to 'foo' then test works fine:
$ cat abort.cpp
extern "C" void foo(void) {
foo();
}
$ cat main.cpp
extern "C" void foo(void);
int main(int argc, char * argv[]) {
foo();
}
$ cat o.res
2
main.o 2
203 3cd4d3b7ff8d0f59 PREVAILING_DEF main
206 3cd4d3b7ff8d0f59 RESOLVED_IR foo
abort.o 1
191 2179600d205ec4af PREVAILING_DEF_IRONLY foo
Looks like 'abort' is considered a builtin of some sort that conflicts with
user's override in a way that breaks LTO streaming of type declaration.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
2020-10-24 20:06 ` [Bug ipa/97565] " slyfox at gcc dot gnu.org
@ 2020-10-26 8:14 ` rguenth at gcc dot gnu.org
2020-11-09 15:25 ` rguenth at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-26 8:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2020-10-26
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
2020-10-24 20:06 ` [Bug ipa/97565] " slyfox at gcc dot gnu.org
2020-10-26 8:14 ` rguenth at gcc dot gnu.org
@ 2020-11-09 15:25 ` rguenth at gcc dot gnu.org
2021-07-12 19:35 ` xry111 at mengyan1223 dot wang
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-09 15:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the odd thing is that PTA sees
/* Nodes without a body are not interesting. Especially do not
visit clones at this point for now - we get duplicate decls
there for inline clones at least. */
if (!node->has_gimple_body_p () || node->inlined_to)
continue;
node->get_body ();
(gdb) p node->debug ()
abort/0 (abort) @0x7ffff661b000
Type: function definition
Visibility: in_other_partition externally_visible prevailing_def_ironly_exp
external public visibility_specified
References:
Referring: abort/2 (alias)
Read from file: ./t.ltrans0.o
Availability: available
Unit id: 2
Function flags: count:1073741824 (estimated locally) nonfreeing_fn
unlikely_executed
Called by:
Calls:
but
/* Return true when callgraph node is a function with Gimple body defined
in current unit. Functions can also be define externally or they
can be thunks with no Gimple representation.
Note that at WPA stage, the function body may not be present in memory.
*/
inline bool has_gimple_body_p (void);
where I assume that this means the current _LTRANS_ unit has the body
defined.
The other odd thing is that the node has ->used_from_other_partition false.
Full initial symtab:
Creating file ./t.ltrans0.o with sub id 0x7c0d6948e785db2d
Symbol table:
abort/0 (abort) @0x7f3431cf9000
Type: function definition
Visibility: in_other_partition externally_visible prevailing_def_ironly_exp
external public visibility_specified
References:
Referring: abort/2 (alias)
Read from file: ./t.ltrans0.o
Unit id: 2
Function flags: count:1073741824 (estimated locally) nonfreeing_fn
unlikely_executed
Called by:
Calls:
abort/2 (abort) @0x7f3431ef5ee0
Type: function definition analyzed alias transparent_alias
Visibility: externally_visible external public visibility_specified
References: abort/0 (alias)
Referring:
Read from file: ./t.ltrans0.o
Unit id: 3
Function flags:
Called by: main/1 (0 (precise),0.00 per call) (can throw external)
Calls:
main/1 (main) @0x7f3431ef5dd0
Type: function definition analyzed
Visibility: externally_visible prevailing_def public
References:
Referring:
Read from file: ./t.ltrans0.o
Unit id: 3
Function flags: count:0 (precise) only_called_at_startup nonfreeing_fn
unlikely_executed
Called by:
Calls: abort/2 (0 (precise),0.00 per call) (can throw external)
oddly enough symbol and alias are in different partitions?
Honza - is this a PTA bug (need to check in_other_partition?) or a IPA bug?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
` (2 preceding siblings ...)
2020-11-09 15:25 ` rguenth at gcc dot gnu.org
@ 2021-07-12 19:35 ` xry111 at mengyan1223 dot wang
2021-07-13 6:57 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: xry111 at mengyan1223 dot wang @ 2021-07-12 19:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
--- Comment #4 from Xi Ruoyao <xry111 at mengyan1223 dot wang> ---
This issue still exists in trunk. "-fno-builtin-abort" can be used as a
workaround for SpiderMonkey though.
Any progress?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
` (3 preceding siblings ...)
2021-07-12 19:35 ` xry111 at mengyan1223 dot wang
@ 2021-07-13 6:57 ` rguenth at gcc dot gnu.org
2021-08-23 12:08 ` hubicka at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-13 6:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2020-10-26 00:00:00 |2021-7-13
Known to fail|10.2.0 |10.3.0, 11.1.1, 12.0
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
No, I'm still waiting for feedback from Honza. It can also be worked around by
not using -fipa-pta ;)
Re-confirmed btw.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
` (4 preceding siblings ...)
2021-07-13 6:57 ` rguenth at gcc dot gnu.org
@ 2021-08-23 12:08 ` hubicka at gcc dot gnu.org
2021-08-23 14:30 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-08-23 12:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
has_gimple_body_p really cares about the WPA unit (we should probably note that
in the comment). Here you seem to have function that is in the WPA translation
unit but lands in different partition and in that case you have
in_other_partition.
used_from_other_partition is about symbols defined in current ltrans partition
but being used from other ltrans.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
` (5 preceding siblings ...)
2021-08-23 12:08 ` hubicka at gcc dot gnu.org
@ 2021-08-23 14:30 ` cvs-commit at gcc dot gnu.org
2021-08-23 14:31 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-23 14:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
--- Comment #7 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:0230e69a3fabe6ad1d80cdf308ad1bf1934c4381
commit r12-3085-g0230e69a3fabe6ad1d80cdf308ad1bf1934c4381
Author: Richard Biener <rguenther@suse.de>
Date: Mon Aug 23 15:37:48 2021 +0200
ipa/97565 - fix IPA PTA body availability check
Looks like the existing check using has_gimple_body_p isn't enough
at LTRANS time but I need to check in_other_partition as well.
2021-08-23 Richard Biener <rguenther@suse.de>
PR ipa/97565
* tree-ssa-structalias.c (ipa_pta_execute): Check
in_other_partition
in addition to has_gimple_body.
* g++.dg/lto/pr97565_0.C: New testcase.
* g++.dg/lto/pr97565_1.C: Likewise.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
` (6 preceding siblings ...)
2021-08-23 14:30 ` cvs-commit at gcc dot gnu.org
@ 2021-08-23 14:31 ` rguenth at gcc dot gnu.org
2021-08-23 18:16 ` slyfox at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-08-23 14:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |12.0
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar, will push it to branches if it happens to help.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
` (7 preceding siblings ...)
2021-08-23 14:31 ` rguenth at gcc dot gnu.org
@ 2021-08-23 18:16 ` slyfox at gcc dot gnu.org
2021-08-24 7:58 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: slyfox at gcc dot gnu.org @ 2021-08-23 18:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
--- Comment #9 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
Tested gcc-master against spidermonkey-78.13.0 with -flto -fipa-pta -O1. Works
without a problem. Thank you!
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
` (8 preceding siblings ...)
2021-08-23 18:16 ` slyfox at gcc dot gnu.org
@ 2021-08-24 7:58 ` cvs-commit at gcc dot gnu.org
2021-08-24 9:17 ` cvs-commit at gcc dot gnu.org
2021-08-24 9:18 ` rguenth at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-24 7:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
--- Comment #10 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:5bc33f0318152235ce10220f0d1a2e0c87bde9f1
commit r11-8897-g5bc33f0318152235ce10220f0d1a2e0c87bde9f1
Author: Richard Biener <rguenther@suse.de>
Date: Mon Aug 23 15:37:48 2021 +0200
ipa/97565 - fix IPA PTA body availability check
Looks like the existing check using has_gimple_body_p isn't enough
at LTRANS time but I need to check in_other_partition as well.
2021-08-23 Richard Biener <rguenther@suse.de>
PR ipa/97565
* tree-ssa-structalias.c (ipa_pta_execute): Check
in_other_partition
in addition to has_gimple_body.
* g++.dg/lto/pr97565_0.C: New testcase.
* g++.dg/lto/pr97565_1.C: Likewise.
(cherry picked from commit 0230e69a3fabe6ad1d80cdf308ad1bf1934c4381)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
` (9 preceding siblings ...)
2021-08-24 7:58 ` cvs-commit at gcc dot gnu.org
@ 2021-08-24 9:17 ` cvs-commit at gcc dot gnu.org
2021-08-24 9:18 ` rguenth at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-24 9:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
--- Comment #11 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:3b0c38012093078549811ae1ca0215d1047a2be2
commit r10-10061-g3b0c38012093078549811ae1ca0215d1047a2be2
Author: Richard Biener <rguenther@suse.de>
Date: Mon Aug 23 15:37:48 2021 +0200
ipa/97565 - fix IPA PTA body availability check
Looks like the existing check using has_gimple_body_p isn't enough
at LTRANS time but I need to check in_other_partition as well.
2021-08-23 Richard Biener <rguenther@suse.de>
PR ipa/97565
* tree-ssa-structalias.c (ipa_pta_execute): Check
in_other_partition
in addition to has_gimple_body.
* g++.dg/lto/pr97565_0.C: New testcase.
* g++.dg/lto/pr97565_1.C: Likewise.
(cherry picked from commit 0230e69a3fabe6ad1d80cdf308ad1bf1934c4381)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug ipa/97565] -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body()
2020-10-24 19:26 [Bug ipa/97565] New: -flto -ipa-pta ICE: at cgraph_node::get_untransformed_body() slyfox at gcc dot gnu.org
` (10 preceding siblings ...)
2021-08-24 9:17 ` cvs-commit at gcc dot gnu.org
@ 2021-08-24 9:18 ` rguenth at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-08-24 9:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97565
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to fail|11.1.1 |11.2.0
Known to work| |10.3.1, 11.2.1
Target Milestone|--- |10.4
Keywords| |ice-on-valid-code
Resolution|--- |FIXED
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed up to where originally reported.
^ permalink raw reply [flat|nested] 13+ messages in thread