2008-11-20 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37868
* gcc.dg/torture/pr37868.c: New testcase.
* gcc.c-torture/execute/pr38048-1.c: Likewise.
* gcc.c-torture/execute/pr38048-2.c: Likewise.
From-SVN: r142041
+2008-11-20 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37868
+ * gcc.dg/torture/pr37868.c: New testcase.
+ * gcc.c-torture/execute/pr38048-1.c: Likewise.
+ * gcc.c-torture/execute/pr38048-2.c: Likewise.
+
2008-11-20 Jakub Jelinek <jakub@redhat.com>
PR fortran/38181
--- /dev/null
+extern void abort(void);
+
+int foo ()
+{
+ int mat[2][1];
+ int (*a)[1] = mat;
+ int det = 0;
+ int i;
+ mat[0][0] = 1;
+ mat[1][0] = 2;
+ for (i = 0; i < 2; ++i)
+ det += a[i][0];
+ return det;
+}
+
+int main()
+{
+ if (foo () != 3)
+ abort ();
+ return 0;
+}
+
--- /dev/null
+extern void abort (void);
+
+static int inv_J(int a[][2])
+{
+ int i, j;
+ int det = 0.0;
+ for (j=0; j<2; ++j)
+ det += a[j][0] + a[j][1];
+ return det;
+}
+
+int foo()
+{
+ int mat[2][2];
+ mat[0][0] = 1;
+ mat[0][1] = 2;
+ mat[1][0] = 4;
+ mat[1][1] = 8;
+ return inv_J(mat);
+}
+
+int main()
+{
+ if (foo () != 15)
+ abort ();
+ return 0;
+}
+
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-fno-strict-aliasing" } */
+
+extern void abort (void);
+
+struct X {
+ unsigned char pad : 4;
+ unsigned int a : 32;
+ unsigned int b : 24;
+ unsigned int c : 6;
+} __attribute__((packed));
+
+int main (void)
+{
+ struct X x;
+ unsigned int bad_bits;
+
+ x.pad = -1;
+ x.a = -1;
+ x.b = -1;
+ x.c = -1;
+
+ bad_bits = ((unsigned int)-1) ^ *(1+(unsigned int *) &x);
+ if (bad_bits != 0)
+ abort ();
+ return 0;
+}
+