]> gcc.gnu.org Git - gcc.git/commit
cfgrtl: Fix up fixup_partitions caused ICE [PR99085]
authorJakub Jelinek <jakub@redhat.com>
Wed, 3 Mar 2021 08:51:54 +0000 (09:51 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 19 Mar 2021 23:27:51 +0000 (00:27 +0100)
commita7c4a70077ad7291f57663aef62d097018d28a10
treee3d752527bf2531ad8912e4dd9e1b6dac68bb655
parent8f9308936cf1df134d5aac1f890eb67266530ab5
cfgrtl: Fix up fixup_partitions caused ICE [PR99085]

fixup_partitions sometimes changes some basic blocks from hot partition to
cold partition, in particular if after unreachable block removal or other
optimizations a hot partition block is dominated by cold partition block(s).
It fixes up the edges and jumps on those edges, but when after reorder
blocks and in rtl (non-cfglayout) mode that is clearly not enough, because
it keeps the block order the same and so we can end up with more than
1 hot/cold section transition in the same function.

So, this patch fixes that up too.

2021-03-03  Jakub Jelinek  <jakub@redhat.com>

PR target/99085
* cfgrtl.c (fixup_partitions): When changing some bbs from hot to cold
partitions, if in non-layout mode after reorder_blocks also move
affected blocks to ensure a single partition transition.

* gcc.dg/graphite/pr99085.c: New test.

(cherry picked from commit 4ad5b1915d50cc39691487f58794d699c7900ace)
gcc/cfgrtl.c
gcc/testsuite/gcc.dg/graphite/pr99085.c [new file with mode: 0644]
This page took 0.063228 seconds and 5 git commands to generate.