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.
&& 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.
--- /dev/null
+/* 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);
+ }
+}