[Bug ipa/114790] [13/14/15/16 regression] ICE when building intel-compute-runtime (error: direct call to ... speculative call sequence has no speculative flag)

2025-07-11 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114790

--- Comment #16 from GCC Commits  ---
The master branch has been updated by Jan Hubicka :

https://gcc.gnu.org/g:52d9c2272f6366cd5b30e9540ce8ef16b482cee5

commit r16-2196-g52d9c2272f6366cd5b30e9540ce8ef16b482cee5
Author: Jan Hubicka 
Date:   Fri Jul 11 12:37:24 2025 +0200

Fix ICE in speculative devirtualization

This patch fixes ICE bilding lto1 with autoprofiledbootstrap and in
pr114790.
What happens is that auto-fdo speculatively devirtualizes to a wrong
target.
This is due to a bug where it mixes up dwarf names and linkage names of
inline
functions I need to fix as well.

Later we clone at WPA time. At ltrans time clone is materialized and call
is
turned into a direct call (this optimization is missed by ipa-cp
propagation).
At this time we should resolve speculation but we don't.  As a result we
get
error from verifier after inlining complaining that there is speculative
call
with corresponding direct call lacking speculative flag.

This seems long-lasting problem in cgraph_update_edges_for_call_stmt_node
but
I suppose it does not trigger since we usually speculate correctly or
notice
the direct call at WPA time already.

Bootstrapped/regtested x86_64-linux.

gcc/ChangeLog:

PR ipa/114790
* cgraph.cc (cgraph_update_edges_for_call_stmt_node): Resolve
devirtualization
if call statement was optimized out or turned to direct call.

gcc/testsuite/ChangeLog:

* g++.dg/lto/pr114790_0.C: New test.
* g++.dg/lto/pr114790_1.C: New test.

[Bug ipa/114790] [13/14/15/16 regression] ICE when building intel-compute-runtime (error: direct call to ... speculative call sequence has no speculative flag)

2025-07-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114790

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|12.5|13.5

--- Comment #15 from Richard Biener  ---
GCC 12 branch is being closed.