summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr52693.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-27 18:22:39 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-27 18:22:39 +0000
commit49c38e9331980a340472cdad0c5de2f8bbf9c224 (patch)
tree7ff5b04eaa1b80005f086c7bd7ab9004f5039f7d /gcc/testsuite/gcc.dg/torture/pr52693.c
parent9bf1a5dd1346e377d5befae26e031f7e8e535aa9 (diff)
downloadgcc-49c38e9331980a340472cdad0c5de2f8bbf9c224.tar.gz
2012-03-27 Martin Jambor <mjambor@suse.cz>
PR middle-end/52693 * tree-sra.c (sra_modify_assign): Do not call load_assign_lhs_subreplacements when working with an unscalarizable region. * testsuite/gcc.dg/torture/pr52693.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185891 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr52693.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr52693.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr52693.c b/gcc/testsuite/gcc.dg/torture/pr52693.c
new file mode 100644
index 00000000000..93e0680ac7c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr52693.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+struct pair
+{
+ int x;
+ int y;
+};
+
+struct array
+{
+ struct pair elems[ 2 ];
+ unsigned index;
+};
+
+extern void abort ();
+
+void __attribute__ ((noinline,noclone))
+test_results (int x1, int y1, int x2, int y2)
+{
+ if (x1 != x2 || y1 != y2)
+ abort ();
+}
+
+int
+main (void)
+{
+ struct array arr = {{{1,2}, {3,4}}, 1};
+ struct pair last = arr.elems[arr.index];
+
+ test_results ( last.x, last.y, arr.elems[1].x, arr.elems[1].y);
+
+ return 0;
+}