diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2013-11-11 18:57:25 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2013-11-11 18:57:25 +0000 |
commit | b2b262e3833249730f75bfb40fe842a0d5990e80 (patch) | |
tree | bd3f256f9532dd32e0b470b34c5b165d836cdf7d /gcc | |
parent | c733374a3d1ce1b1583baf023a7213c1dd6561b4 (diff) | |
download | gcc-b2b262e3833249730f75bfb40fe842a0d5990e80.zip gcc-b2b262e3833249730f75bfb40fe842a0d5990e80.tar.gz gcc-b2b262e3833249730f75bfb40fe842a0d5990e80.tar.bz2 |
re PR middle-end/59049 (Two VOIDmode constant in comparison passed to cstoresi4)
PR middle-end/59049
* expmed.c (emit_store_flag): Fail for const-const comparison.
From-SVN: r204682
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/expmed.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ca7e6a0..0fcb06e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-11-11 Joern Rennecke <joern.rennecke@embecosm.com> + + PR middle-end/59049 + * expmed.c (emit_store_flag): Fail for const-const comparison. + 2013-11-11 Tristan Gingold <gingold@adacore.com> Eric Botcazou <ebotcazou@adacore.com> diff --git a/gcc/expmed.c b/gcc/expmed.c index 59f81df..1617bc0 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -5401,6 +5401,13 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1, rtx subtarget; rtx tem, last, trueval; + /* If we compare constants, we shouldn't use a store-flag operation, + but a constant load. We can get there via the vanilla route that + usually generates a compare-branch sequence, but will in this case + fold the comparison to a constant, and thus elide the branch. */ + if (CONSTANT_P (op0) && CONSTANT_P (op1)) + return NULL_RTX; + tem = emit_store_flag_1 (target, code, op0, op1, mode, unsignedp, normalizep, target_mode); if (tem) |