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
This commit is contained in:
Eric Botcazou 2006-09-30 13:31:29 +00:00
parent 10d2ebc511
commit 2d72242356
4 changed files with 63 additions and 3 deletions

View File

@ -1,4 +1,10 @@
2006-09-28 Eric Botcazou <ebotcazou@adacore.com>
2006-09-30 Eric Botcazou <ebotcazou@libertysurf.fr>
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.
2006-09-29 Eric Botcazou <ebotcazou@adacore.com>
* builtins.c (expand_builtin_setjmp): Delete.
(expand_builtin) <BUILT_IN_SETJMP>: Mark as unreachable.

View File

@ -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)

View File

@ -1,3 +1,7 @@
2006-09-30 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.c-torture/execute/20060930-1.c: New test.
2006-09-29 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/18791
@ -15,7 +19,7 @@
* gfortran.dg/nearest_1.f90: Add -ffloat-store to defeat extra
precision on some archs.
2006-09-28 Eric Botcazou <ebotcazou@adacore.com>
2006-09-29 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/non-local-goto-1.c: New test.
* gcc.dg/non-local-goto-2.c: Likewise.

View File

@ -0,0 +1,42 @@
/* PR rtl-optimization/28096 */
/* Origin: Jan Stein <jan@gatespacetelematics.com> */
extern void abort (void);
int bar (int, int) __attribute__((noinline));
int bar (int a, int b)
{
if (b != 1)
abort ();
}
void foo(int, int) __attribute__((noinline));
void foo (int e, int n)
{
int i, bb2, bb5;
if (e > 0)
e = -e;
for (i = 0; i < n; i++)
{
if (e >= 0)
{
bb2 = 0;
bb5 = 0;
}
else
{
bb5 = -e;
bb2 = bb5;
}
bar (bb5, bb2);
}
}
int main(void)
{
foo (1, 1);
return 0;
}