]> gcc.gnu.org Git - gcc.git/commit
cprop: Fix -fcompare-debug bug in constprop_register [PR100148]
authorJakub Jelinek <jakub@redhat.com>
Wed, 21 Apr 2021 10:31:45 +0000 (12:31 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 4 May 2021 12:19:33 +0000 (14:19 +0200)
commit959719061ab3e9cfa11a2551e20cc0d8c5570a4c
tree188954d4034ef36d512f5255201039b0444ac7f6
parent843ef3bebfd7bfb4a4be068b7bf66d0129f8a2be
cprop: Fix -fcompare-debug bug in constprop_register [PR100148]

The following testcase shows different behavior between -g and -g0
in constprop_register, if a flags register setter is separated
from a conditional jump using those flags with -g by a DEBUG_INSN.
As it uses just NEXT_INSN, for -g it will look at the DEBUG_INSN which is
not a conditional jump, while otherwise it would look at the conditional
jump and call cprop_jump.

2021-04-21  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/100148
* cprop.c (constprop_register): Use next_nondebug_insn instead of
NEXT_INSN.

* g++.dg/opt/pr100148.C: New test.

(cherry picked from commit 022f6ee3ad67ee30f62c8c2aeeb4156494f3284e)
gcc/cprop.c
gcc/testsuite/g++.dg/opt/pr100148.C [new file with mode: 0644]
This page took 0.061199 seconds and 5 git commands to generate.