]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add tree-inlined gconds to caller cond->expr map
authorJørgen Kvalsvik <j@lambda.is>
Mon, 8 Apr 2024 07:28:27 +0000 (09:28 +0200)
committerJørgen Kvalsvik <j@lambda.is>
Tue, 9 Apr 2024 07:56:44 +0000 (09:56 +0200)
commit2daeb89d6f025d6daf7e560575863b3280120be8
tree8e63589cab2e5ba583c8ce9b97da6165251885f9
parent21c9fd9688d9de9562b3cb491e4ab50ce09e663a
Add tree-inlined gconds to caller cond->expr map

Properly add the condition -> expression mapping of inlined gconds from
the caller into the callee map. This is a fix for PR114599 that works
beyond fixing the segfault, as the previous fixed copied references to
the source gconds, not the deep copied ones that end up in the calle
body.

The new tests checks this, both in the case of a calle without
conditions (which triggered the segfault), and a test that shows that
conditions are properly mapped, and not mixed.

PR middle-end/114599

gcc/ChangeLog:

* tree-inline.cc (copy_bb): Copy cond_uids into callee.
(prepend_lexical_block): Remove outdated comment.
(add_local_variables): Remove bad cond_uids copy.

gcc/testsuite/ChangeLog:

* gcc.misc-tests/gcov-19.c: New test.
gcc/testsuite/gcc.misc-tests/gcov-19.c
gcc/tree-inline.cc