diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-03-16 18:52:20 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-03-16 18:52:20 +0100 |
commit | c73d295c48fd246c2fd85827ab798e894f600033 (patch) | |
tree | 0708e09e5edd3bef4be596c6056156cb9c994023 /gcc/rtlanal.c | |
parent | b2794066f3691f020a0fa096c4bab76fe94d7957 (diff) | |
download | gcc-c73d295c48fd246c2fd85827ab798e894f600033.zip gcc-c73d295c48fd246c2fd85827ab798e894f600033.tar.gz gcc-c73d295c48fd246c2fd85827ab798e894f600033.tar.bz2 |
re PR middle-end/70245 (Miscompilation of ICU on i386 with atom tuning starting with r227382)
PR target/70245
* rtlanal.c (replace_rtx): For REG, if from is a REG,
return to even if only REGNO is equal, and assert
mode is the same.
* g++.dg/opt/pr70245.C: New test.
* g++.dg/opt/pr70245.h: New file.
* g++.dg/opt/pr70245-aux.cc: New file.
Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r234265
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index bacc5f2..74b593d 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -2961,7 +2961,16 @@ replace_rtx (rtx x, rtx from, rtx to) if (x == 0) return 0; - if (GET_CODE (x) == SUBREG) + if (GET_CODE (x) == REG) + { + if (GET_CODE (from) == REG + && REGNO (x) == REGNO (from)) + { + gcc_assert (GET_MODE (x) == GET_MODE (from)); + return to; + } + } + else if (GET_CODE (x) == SUBREG) { rtx new_rtx = replace_rtx (SUBREG_REG (x), from, to); |