aboutsummaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2006-09-30 13:31:29 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2006-09-30 13:31:29 +0000
commit2d7224235688114edd75330c61527621c3731ee8 (patch)
treed07cacf4059837374203a5fe4bbf8717106d9a66 /gcc/ifcvt.c
parent10d2ebc511a7ded41cb31255b3e4c306e44e5f4e (diff)
downloadgcc-2d7224235688114edd75330c61527621c3731ee8.zip
gcc-2d7224235688114edd75330c61527621c3731ee8.tar.gz
gcc-2d7224235688114edd75330c61527621c3731ee8.tar.bz2
re PR rtl-optimization/28096 (fdlibm/strtod.c miscompiled at -O2)
PR rtl-optimization/28096 * ifcvt.c (check_cond_move_block): Return FALSE if the source of an assignment has already been used as a destination earlier in the block. From-SVN: r117331
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 41da0b3..8609823 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2424,7 +2424,7 @@ check_cond_move_block (basic_block bb, rtx *vals, rtx cond)
src = SET_SRC (set);
if (!REG_P (dest)
|| (SMALL_REGISTER_CLASSES && HARD_REGISTER_P (dest)))
- return false;
+ return FALSE;
if (!CONSTANT_P (src) && !register_operand (src, VOIDmode))
return FALSE;
@@ -2435,6 +2435,14 @@ check_cond_move_block (basic_block bb, rtx *vals, rtx cond)
if (may_trap_p (src) || may_trap_p (dest))
return FALSE;
+ /* Don't try to handle this if the source register was
+ modified earlier in the block. */
+ if ((REG_P (src)
+ && vals[REGNO (src)] != NULL)
+ || (GET_CODE (src) == SUBREG && REG_P (SUBREG_REG (src))
+ && vals[REGNO (SUBREG_REG (src))] != NULL))
+ return FALSE;
+
/* Don't try to handle this if the destination register was
modified earlier in the block. */
if (vals[REGNO (dest)] != NULL)