Hi,
PR78652 was fixed by patch for PR77856, this patch adds a test for it. Test
result checked, is it OK?
Thanks,
bin
gcc/testsuite/ChangeLog
2016-12-07 Bin Cheng <bin.ch...@arm.com>
PR rtl-optimization/78652
* gcc.c-torture/execute/pr78652.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr78652.c
b/gcc/testsuite/gcc.c-torture/execute/pr78652.c
new file mode 100644
index 0000000..277f108
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr78652.c
@@ -0,0 +1,77 @@
+/* PR rtl-optimization/78652 */
+/* { dg-options "-fno-strict-aliasing" } */
+
+short a, b = 1, p, t;
+struct {
+ signed f1 : 9;
+} m = {3};
+
+int c, g = 0, h = 8, i, k, l, q, r, s, w, x = 9;
+long long d = 1;
+long long e = 1;
+char f[9][6][4] = {{{1}}};
+short j[6] = {1};
+
+unsigned n;
+static long long *o = &e;
+char u;
+short *v;
+char *y = &f[6][4][3];
+short fn1 (short p1) { return a == 0 ? p1 : p1 % a; }
+
+static int *fn2 (signed char p1, int p2, signed char p3) {
+lbl_2057:
+ if (n >= (q >= fn1 (3)))
+ return &r;
+ if (p2)
+ t = u;
+ *v = (t | *o) * p2;
+ for (;;) {
+ for (; u <= 1;)
+ goto lbl_2057;
+ if (p1)
+ s = g = 0;
+ }
+}
+
+void fn3 (int *p1) {
+ if (*p1)
+ ;
+ else {
+ x = w;
+ for (;;)
+ ;
+ }
+}
+
+int *fn4 (long p1) {
+ for (; p1; p1--)
+ e = 1;
+ y = 0;
+ return &h;
+}
+
+__attribute__((noinline))
+void bar (int a)
+{
+ if (a != 3)
+ __builtin_abort ();
+}
+
+__attribute__((section(".text")))
+int main () {
+ int *z;
+ long t1;
+ long long *t2 = &d;
+ *t2 = b;
+ z = fn4 (*t2);
+ fn3 (z);
+ short *t3 = &j[0];
+ *t3 = f[6][4][3] >= (b = i);
+ t1 = p < n;
+ fn2 (c < t1 >= m.f1, l, k);
+ j[5]++;
+ bar (m.f1);
+
+ return 0;
+}