Unfortunately I made a silly copy-and paste error in may patch
introducing the recipient_only flag. This patch fixes it, correctly
bailing out in ipa-bit-cp when it is set during propagation.
gcc/ChangeLog:
2026-01-12 Martin Jambor <mjambor@suse.cz>
PR ipa/123543
* ipa-cp.cc (propagate_bits_across_jump_function): Fix test for
recipient_only_p.
gcc/testsuite/ChangeLog:
2026-01-12 Martin Jambor <mjambor@suse.cz>
PR ipa/123543
* gcc.dg/ipa/pr123543.c: New test.
and we store it in jump function during analysis stage. */
if (!src_lats->bits_lattice.bottom_p ()
- || src_lats->bits_lattice.recipient_only_p ())
+ && !src_lats->bits_lattice.recipient_only_p ())
{
if (!op_type)
op_type = ipa_get_type (caller_info, src_idx);
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+__attribute__((noinline))
+static int local_f(int a, int b) { return a + b; }
+
+__attribute__((noinline))
+int extern_f(int a, int b) { return local_f(a, b); }
+
+int unused_g1(int b) { return extern_f(0, b); }
+
+int (*volatile fp)(int, int) = extern_f;
+
+int main() { if (fp(1, 2) != 3) __builtin_abort(); }