Commit fd25e957 by Eric Botcazou

re PR rtl-optimization/13318 (ICE: floating point exception in the loop optimizer)

	PR optimization/13318
	* loop.c (express_from): Protect integer division from overflow.

From-SVN: r74387
parent 5c6ef9be
2003-12-07 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/13318
* loop.c (express_from): Protect integer division from overflow.
2003-12-07 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/13060
* function.c (fixup_var_refs_1) [SUBREG]: Recognize even if a
replacement already exists. Fix again the whole insn if that fails.
......
......@@ -7196,6 +7196,9 @@ express_from (struct induction *g1, struct induction *g2)
&& GET_CODE (g2->mult_val) == CONST_INT)
{
if (g1->mult_val == const0_rtx
|| (g1->mult_val == constm1_rtx
&& INTVAL (g2->mult_val)
== (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1))
|| INTVAL (g2->mult_val) % INTVAL (g1->mult_val) != 0)
return NULL_RTX;
mult = GEN_INT (INTVAL (g2->mult_val) / INTVAL (g1->mult_val));
......
2003-12-07 Wolfgang Bangerth <bangerth@dealii.org>
* gcc.dg/overflow-1.c: New test.
2003-12-07 Eric Botcazou <ebotcazou@libertysurf.fr>
* g77.f-torture/compile/13060.f: New test.
......
/* PR optimization/13318 */
/* Origin: <bremner@unb.ca> */
/* Reduced testcase: Wolfgang Bangerth <bangerth@dealii.org> */
/* Verify that the big multiplier doesn't cause an integer
overflow in the loop optimizer. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
struct S {
int key;
int rnext,rprev;
};
void foo(struct S* H)
{
int i, k;
for (i=0; i<2; i++){
struct S* cell=H+k;
cell->key=i*(0xffffffffUL/2);
cell->rnext=k+(1-i);
cell->rprev=k+(1-i);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment