aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorFranz Sirl <Franz.Sirl-kernel@lauterbach.com>2003-07-14 09:29:44 +0000
committerFranz Sirl <sirl@gcc.gnu.org>2003-07-14 09:29:44 +0000
commitbbd288a44df5e39c05583b77349b436eb3fcc866 (patch)
tree911a0f712d5caaf322cd0f488abc5387f110cbba /gcc/gcse.c
parent3a009999ba155c613c5545fd752e54a093aec05b (diff)
downloadgcc-bbd288a44df5e39c05583b77349b436eb3fcc866.zip
gcc-bbd288a44df5e39c05583b77349b436eb3fcc866.tar.gz
gcc-bbd288a44df5e39c05583b77349b436eb3fcc866.tar.bz2
re PR rtl-optimization/11440 (gcc-3.3.1 miscompiles c++ code with -O2, -fno-gcse cures it)
2003-07-14 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> PR optimization/11440 * gcse.c (try_replace_reg): Don't attach notes to ZERO_EXTRACT or SIGN_EXTRACT SETs. From-SVN: r69325
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 8ddcd73..30d4c1e 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -3856,9 +3856,12 @@ try_replace_reg (rtx from, rtx to, rtx insn)
&& validate_change (insn, &SET_SRC (set), src, 0))
success = 1;
- /* If we've failed to do replacement, have a single SET, and don't already
- have a note, add a REG_EQUAL note to not lose information. */
- if (!success && note == 0 && set != 0)
+ /* If we've failed to do replacement, have a single SET, don't already
+ have a note, and have no special SET, add a REG_EQUAL note to not
+ lose information. */
+ if (!success && note == 0 && set != 0
+ && GET_CODE (XEXP (set, 0)) != ZERO_EXTRACT
+ && GET_CODE (XEXP (set, 0)) != SIGN_EXTRACT)
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}