Index: gcc/ChangeLog
authorGeoffrey Keating <geoffk@apple.com>
Tue, 22 Aug 2006 19:16:03 +0000 (19:16 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Tue, 22 Aug 2006 19:16:03 +0000 (19:16 +0000)
2006-08-21  Geoffrey Keating  <geoffk@apple.com>

PR debug/28692
* dwarf2out.c (rtl_for_decl_init): Don't try to create RTL for
complex values, nor for generic vector values.

Index: gcc/testsuite/ChangeLog
2006-08-21  Geoffrey Keating  <geoffk@apple.com>

PR debug/28692
* gcc.dg/debug/const-1.c: New.
* gcc.dg/debug/const-2.c: New.
* gcc.dg/debug/dwarf2/const-1.c: New.
* gcc.dg/debug/dwarf2/const-2.c: New.
* gcc.dg/debug/dwarf2/const-2b.c: New.

From-SVN: r116331

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/const-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/const-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/dwarf2/const-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/dwarf2/const-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c [new file with mode: 0644]

index caf083ba5414d59d274648a41b5c3c6d5f37ba3b..195c92b9929fb93a6d7b748be41ed0805c6251e7 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-21  Geoffrey Keating  <geoffk@apple.com>
+
+       PR debug/28692
+       * dwarf2out.c (rtl_for_decl_init): Don't try to create RTL for
+       complex values, nor for generic vector values.
+
 2006-08-22  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/28776
index 896f85386b64ed324fa94ce7f2f31aab369b31ec..76fd7f07f9e82c9df97c42e077e3f947d66f74c3 100644 (file)
@@ -9942,10 +9942,13 @@ rtl_for_decl_init (tree init, tree type)
        rtl = gen_rtx_CONST_STRING (VOIDmode,
                                    ggc_strdup (TREE_STRING_POINTER (init)));
     }
-  /* Although DWARF could easily handle other kinds of aggregates, we
-     have no way to represent such values as RTL constants, so skip
-     those.  */
-  else if (AGGREGATE_TYPE_P (type))
+  /* Other aggregates, and complex values, could be represented using
+     CONCAT: FIXME!  */
+  else if (AGGREGATE_TYPE_P (type) || TREE_CODE (type) == COMPLEX_TYPE)
+    ;
+  /* Vectors only work if their mode is supported by the target.  
+     FIXME: generic vectors ought to work too.  */
+  else if (TREE_CODE (type) == VECTOR_TYPE && TYPE_MODE (type) == BLKmode)
     ;
   /* If the initializer is something that we know will expand into an
      immediate RTL constant, expand it now.  We must be careful not to
index 5c029fa566a61f727dfd5f2fcb8f7d46b371545e..502921ce67946a28587aa4d3f20be10756148ba1 100644 (file)
@@ -1,3 +1,12 @@
+2006-08-21  Geoffrey Keating  <geoffk@apple.com>
+
+       PR debug/28692
+       * gcc.dg/debug/const-1.c: New.
+       * gcc.dg/debug/const-2.c: New.
+       * gcc.dg/debug/dwarf2/const-1.c: New.
+       * gcc.dg/debug/dwarf2/const-2.c: New.
+       * gcc.dg/debug/dwarf2/const-2b.c: New.
+
 2006-08-22  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/28776
diff --git a/gcc/testsuite/gcc.dg/debug/const-1.c b/gcc/testsuite/gcc.dg/debug/const-1.c
new file mode 100644 (file)
index 0000000..bc52661
--- /dev/null
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+typedef float FloatVect __attribute__((__vector_size__(16)));
+static FloatVect Foo = { 250000000.0, 0.0, 0.0, 0.0 };
diff --git a/gcc/testsuite/gcc.dg/debug/const-2.c b/gcc/testsuite/gcc.dg/debug/const-2.c
new file mode 100644 (file)
index 0000000..7b9c244
--- /dev/null
@@ -0,0 +1,2 @@
+/* { dg-do compile } */
+static __complex__ int x = 3.0;
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/const-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/const-1.c
new file mode 100644 (file)
index 0000000..aa20e6d
--- /dev/null
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O -gdwarf-2 -dA" } */
+/* { dg-final { scan-assembler "DW_AT_const_value" } } */
+
+extern void x();
+static void (*f)() = x;
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/const-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/const-2.c
new file mode 100644 (file)
index 0000000..d3039c6
--- /dev/null
@@ -0,0 +1,6 @@
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-O -gdwarf-2 -dA -maltivec" } */
+/* { dg-final { scan-assembler "DW_AT_const_value" } } */
+
+typedef float FloatVect __attribute__((__vector_size__(16)));
+static FloatVect Foo = { 250000000.0, 0.0, 0.0, 0.0 };
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c b/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c
new file mode 100644 (file)
index 0000000..9d577ea
--- /dev/null
@@ -0,0 +1,6 @@
+/* { dg-do compile { target i386*-*-* } } */
+/* { dg-options "-O -gdwarf-2 -dA -msse" } */
+/* { dg-final { scan-assembler "DW_AT_const_value" } } */
+
+typedef float FloatVect __attribute__((__vector_size__(16)));
+static FloatVect Foo = { 250000000.0, 0.0, 0.0, 0.0 };