]> git.ipfire.org Git - thirdparty/gcc.git/commit
Copy condition->expr map when inlining [PR114599]
authorJørgen Kvalsvik <j@lambda.is>
Fri, 5 Apr 2024 19:42:07 +0000 (21:42 +0200)
committerJørgen Kvalsvik <j@lambda.is>
Sat, 6 Apr 2024 11:10:29 +0000 (13:10 +0200)
commitc6892a430a9752aea167265621c3ae7a3e11159f
tree7c1a22cf3f526849aa57642fa17868f545a0105f
parent888bf719728e9ab1da22900d39956e0d80889e30
Copy condition->expr map when inlining [PR114599]

When a function is tree-inlined, copy the condition -> expression mapping
from the inlined function into the caller, shifted so uids are not
mixed.  Tree inlining was always problematic under condition coverage -
either through a nullptr dereference (triggered by the test case), or
through quietly mixing caller conditions with the callee conditions.

PR middle-end/114599

gcc/ChangeLog:

* tree-inline.cc (add_local_variables): Copy cond_uids mappings.

gcc/testsuite/ChangeLog:

* gcc.misc-tests/gcov-pr114599.c: New test.
gcc/testsuite/gcc.misc-tests/gcov-pr114599.c [new file with mode: 0644]
gcc/tree-inline.cc