summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-03 15:42:43 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-03 15:42:43 +0000
commitea81e5c7d0639c57a1cda2c49ee86c8aa501222f (patch)
tree064998e2e6ce5bd8a2620920fa96c470d556c47d /gcc/testsuite/gcc.dg/debug
parenta1db17f632a97825e15c6047ed4b325487501260 (diff)
downloadgcc-ea81e5c7d0639c57a1cda2c49ee86c8aa501222f.tar.gz
PR debug/43972
* config/i386/i386.c (ix86_delegitimize_address): Make sure the result mode matches original rtl mode. * gcc.dg/debug/pr43972.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158989 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/debug')
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr43972.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/debug/pr43972.c b/gcc/testsuite/gcc.dg/debug/pr43972.c
new file mode 100644
index 00000000000..5fcf1e0e87f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr43972.c
@@ -0,0 +1,29 @@
+/* PR debug/43972 */
+/* { dg-do compile } */
+/* { dg-options "-g -w" } */
+/* { dg-options "-g -fpic -w" { target fpic } } */
+
+struct { int *b1; } *f1 ();
+short v1[1];
+struct S { int b2; };
+void
+foo (struct S *a1, union { char *b3; unsigned *b4; int *b5; } *a2)
+{
+ int d;
+ switch (d)
+ {
+ case 0:
+ {
+ int c = a1->b2, i;
+ if (f1 () == 0)
+ *a2->b3++ = 2;
+ else if (((long) (f1 () - f1 ())) ^ ((long) f1 ()->b1 - ((long) f1 () & 8)))
+ *a2->b3++ = (long) f1 - ((long) f1 () & 0xff);
+ else
+ *a2->b4++ = (long) f1;
+ for (i = 0; i < c; i++)
+ *a2->b5++ = (long) v1;
+ foo (a1, a2);
+ }
+ }
+}