+2007-11-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/34225
+ * config/rs6000/rs6000.c (adjacent_mem_locations): Don't assume
+ MEM_SIZE is set on all MEMs.
+
2007-11-27 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.opt (mhard-float): Add the option to be
|| (GET_CODE (XEXP (b, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (b, 0), 1)) == CONST_INT)))
{
- HOST_WIDE_INT val0 = 0, val1 = 0;
+ HOST_WIDE_INT val0 = 0, val1 = 0, val_diff;
rtx reg0, reg1;
- int val_diff;
if (GET_CODE (XEXP (a, 0)) == PLUS)
{
val_diff = val1 - val0;
return ((REGNO (reg0) == REGNO (reg1))
- && (val_diff == INTVAL (MEM_SIZE (a))
- || val_diff == -INTVAL (MEM_SIZE (b))));
+ && ((MEM_SIZE (a) && val_diff == INTVAL (MEM_SIZE (a)))
+ || (MEM_SIZE (b) && val_diff == -INTVAL (MEM_SIZE (b)))));
}
return false;
--- /dev/null
+/* PR target/34225 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -fstack-protector" } */
+/* { dg-require-effective-target fstack_protector } */
+
+typedef __SIZE_TYPE__ size_t;
+extern int sscanf (const char *, const char *, ...);
+struct C
+{
+ char c[240];
+};
+struct O
+{
+ char **o;
+};
+struct P
+{
+ int p1;
+ char p2[256];
+ char p3[256];
+ char p4[256];
+};
+
+extern void *s;
+extern int f1 (char *, struct C *);
+extern void f2 (void *, const char *);
+extern void f3 (char *, const char *);
+extern int f4 (int, double *, int);
+
+int
+foo (char *a[], struct O *b, int c, int d, struct P *e, int f, int *h,
+ char *l)
+{
+ int i, g = 7, m = 0, n;
+ struct C j[150];
+ double *k[150];
+ char o[100];
+
+ if (f1 (o, &j[g]) < 0)
+ g++;
+
+ while (!m)
+ {
+ f2 (s, "xxx");
+ for (i = 0; i < f; i++)
+ if ((!b->o && __builtin_strncmp (l, "abcde", 5) == 0)
+ || (b->o && !b->o[c]))
+ {
+ *e[d].p4 = *e[d].p3 = *e[d].p2 = 0;
+ sscanf (l, "%s %s %[^\n]", e[d].p3, e[d].p2, e[d].p4);
+ }
+ for (n = 0; n < d; n++)
+ for (i = 0; i < g; i++)
+ {
+ f3 (a[i + 1], "foo");
+ if (f4 (h[i], k[i], e[n].p1) < 0)
+ f3 (a[i + 1], "bar");
+ }
+ }
+ return 0;
+}