]> git.ipfire.org Git - thirdparty/gcc.git/commit
ipa/122798: Adjust local and address_taken flags for callback clones.
authorJosef Melcr <josef.melcr@suse.com>
Mon, 8 Dec 2025 08:21:38 +0000 (09:21 +0100)
committerJosef Melcr <josef.melcr@suse.com>
Mon, 8 Dec 2025 09:40:15 +0000 (10:40 +0100)
commitfe22bdabd4ca51c036e5e2ab89f56ffe32f4cac9
treead0e8ffbfc53c73e85918400ce51492ebb3d79fb
parentc7136f5b378e2684cf291b21e9a512c4c30ba9ef
ipa/122798: Adjust local and address_taken flags for callback clones.

Hi,
previously, clones of callback functions had their local flag set.
Because callback edges are direct rather than indirect, GCC falsely
assumes that their callsites are available and that it can change their
ABI, leading to segfaults.  This patch fixes that.  Additionally, this
patch fixes a check in redirect_callee for clearing the address_taken
flag.

PR ipa/122798

gcc/ChangeLog:

* cgraph.cc (cgraph_edge::redirect_callee): Use
iterate_referring instead of referred_to_p.
* cgraphclones.cc (set_new_clone_decl_and_node_flags): Set local
to true iff the node does not have its address taken.

Signed-off-by: Josef Melcr <josef.melcr@suse.com>
gcc/cgraph.cc
gcc/cgraphclones.cc