* gcc.c-torture/execute/
20071018-1.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129485
138bc75d-0d04-0410-961f-
82ee72b054a4
2007-10-19 Richard Guenther <rguenther@suse.de>
+ * gcc.c-torture/execute/20071018-1.c: New testcase.
+
+2007-10-19 Richard Guenther <rguenther@suse.de>
+
PR middle-end/32921
* gfortran.dg/pr32921.f: New testcase.
--- /dev/null
+extern void abort(void);
+
+struct foo {
+ int rank;
+ char *name;
+};
+
+struct mem {
+ struct foo *x[4];
+};
+
+void __attribute__((noinline)) bar(struct foo **f)
+{
+ *f = __builtin_malloc(sizeof(struct foo));
+}
+struct foo * foo(int rank)
+{
+ void *x = __builtin_malloc(sizeof(struct mem));
+ struct mem *as = x;
+ struct foo **upper = &as->x[rank * 8 - 1];
+ *upper = 0;
+ bar(upper);
+ return *upper;
+}
+
+int main()
+{
+ if (foo(0) == 0)
+ abort ();
+ return 0;
+}