]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix PR rtl-optimization/102306
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 17 Sep 2021 08:12:12 +0000 (10:12 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Fri, 17 Sep 2021 08:19:19 +0000 (10:19 +0200)
commit469aad8b5d787c728fbe8b4ec6537385d7815d5a
tree432f8a51bf000794c25a44724055c5ec58d5f0b1
parenta6aa2458a92fb8124534cabf9f5fbec8895d737c
Fix PR rtl-optimization/102306

This is a duplication of volatile loads introduced during GCC 9 development
by the 2->2 mechanism of the RTL combiner.  There is already a substantial
checking for volatile references in can_combine_p but it implicitly assumes
that the combination reduces the number of instructions, which is of course
not the case here.  So the fix teaches try_combine to abort the combination
when it is about to make a copy of volatile references to preserve them.

gcc/
PR rtl-optimization/102306
* combine.c (try_combine): Abort the combination if we are about to
duplicate volatile references.

gcc/testsuite/
* gcc.target/sparc/20210917-1.c: New test.
gcc/combine.c
gcc/testsuite/gcc.target/sparc/20210917-1.c [new file with mode: 0644]