diff options
| author | Jakub Jelinek <jakub@redhat.com> | 2016-01-26 12:12:03 +0100 |
|---|---|---|
| committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-01-26 12:12:03 +0100 |
| commit | 6c06e0e822db96b71c80e268260d2b4b4c1bc1f5 (patch) | |
| tree | 13dabb40608100e7283aa3ad638031f8b5807728 /gcc/combine.c | |
| parent | b96824c4848d33c8cc9b574ce29da98464feaabb (diff) | |
| download | gcc-6c06e0e822db96b71c80e268260d2b4b4c1bc1f5.zip gcc-6c06e0e822db96b71c80e268260d2b4b4c1bc1f5.tar.gz gcc-6c06e0e822db96b71c80e268260d2b4b4c1bc1f5.tar.bz2 | |
re PR target/69442 (wrong code with -Og and 64bit modulo @ armv7a)
PR target/69442
* combine.c (combine_instructions): For REG_EQUAL note with
SET_DEST being ZERO_EXTRACT, also temporarily set SET_DEST
to the underlying register.
* doc/rtl.texi (REG_EQUAL): Document the behavior of
REG_EQUAL/REG_EQUIV notes if SET_DEST is ZERO_EXTRACT.
* gcc.dg/pr69442.c: New test.
From-SVN: r232819
Diffstat (limited to 'gcc/combine.c')
| -rw-r--r-- | gcc/combine.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 2f913dd..858552d 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1454,15 +1454,21 @@ combine_instructions (rtx_insn *f, unsigned int nregs) && ! unmentioned_reg_p (note, SET_SRC (set)) && (GET_MODE (note) == VOIDmode ? SCALAR_INT_MODE_P (GET_MODE (SET_DEST (set))) - : GET_MODE (SET_DEST (set)) == GET_MODE (note))) + : (GET_MODE (SET_DEST (set)) == GET_MODE (note) + && (GET_CODE (SET_DEST (set)) != ZERO_EXTRACT + || (GET_MODE (XEXP (SET_DEST (set), 0)) + == GET_MODE (note)))))) { /* Temporarily replace the set's source with the contents of the REG_EQUAL note. The insn will be deleted or recognized by try_combine. */ - rtx orig = SET_SRC (set); + rtx orig_src = SET_SRC (set); + rtx orig_dest = SET_DEST (set); + if (GET_CODE (SET_DEST (set)) == ZERO_EXTRACT) + SET_DEST (set) = XEXP (SET_DEST (set), 0); SET_SRC (set) = note; i2mod = temp; - i2mod_old_rhs = copy_rtx (orig); + i2mod_old_rhs = copy_rtx (orig_src); i2mod_new_rhs = copy_rtx (note); next = try_combine (insn, i2mod, NULL, NULL, &new_direct_jump_p, @@ -1473,7 +1479,8 @@ combine_instructions (rtx_insn *f, unsigned int nregs) statistics_counter_event (cfun, "insn-with-note combine", 1); goto retry; } - SET_SRC (set) = orig; + SET_SRC (set) = orig_src; + SET_DEST (set) = orig_dest; } } |
