new file mode 100644
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+struct b {
+ char *volatile c;
+};
+struct b * __attribute__((noipa))
+d()
+{
+ char *e;
+ struct b *b = __builtin_malloc(sizeof(b));
+ void *f = __builtin_malloc(1);
+
+ e = __builtin_memcpy(f, "z", 1);
+ b->c = e;
+ return b;
+}
+
+int main()
+{
+ struct b b = *d();
+ if (b.c[0] != 'z')
+ __builtin_abort();
+ return 0;
+}
@@ -3104,7 +3104,7 @@ process_constraint (constraint_t t)
it here by turning it into *ANYTHING. */
if (lhs.type == ADDRESSOF
&& lhs.var == anything_id)
- lhs.type = DEREF;
+ t->lhs.type = lhs.type = DEREF;
/* ADDRESSOF on the lhs is invalid. */
gcc_assert (lhs.type != ADDRESSOF);