summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-06 01:35:10 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-06 01:35:10 +0000
commit37f26c2d8427efa0b0b36a0ee705f8c15ccb5926 (patch)
treed183f0b9e7eb1fc5592761718d4cc3a1467dce6f /gcc
parentb67f0bc6f336d9ac17ae15c025ea23429b4431e5 (diff)
downloadppe42-gcc-37f26c2d8427efa0b0b36a0ee705f8c15ccb5926.tar.gz
ppe42-gcc-37f26c2d8427efa0b0b36a0ee705f8c15ccb5926.zip
gcc/ChangeLog:
PR debug/30189 * dwarf2out.c (modified_type_die): Follow DECL_ORIGINAL_TYPE even if cv-qualification is the same. gcc/testsuite/ChangeLog: PR debug/30189 * gcc.dg/pr30189.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121638 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr30189.c18
4 files changed, 34 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b09ca01a88a..01aa9dc59c1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2007-02-05 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/30189
+ * dwarf2out.c (modified_type_die): Follow DECL_ORIGINAL_TYPE
+ even if cv-qualification is the same.
+
2007-02-05 Geoffrey Keating <geoffk@apple.com>
* config/rs6000/darwin-tramp.asm (__trampoline_setup): Call
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 186c979abb5..d529d8c879d 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -8519,9 +8519,11 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
gen_type_die (qualified_type, context_die);
return lookup_type_die (qualified_type);
}
- else if (DECL_ORIGINAL_TYPE (name)
- && (is_const_type < TYPE_READONLY (dtype)
- || is_volatile_type < TYPE_VOLATILE (dtype)))
+ else if (is_const_type < TYPE_READONLY (dtype)
+ || is_volatile_type < TYPE_VOLATILE (dtype)
+ || (is_const_type <= TYPE_READONLY (dtype)
+ && is_volatile_type <= TYPE_VOLATILE (dtype)
+ && DECL_ORIGINAL_TYPE (name) != type))
/* cv-unqualified version of named type. Just use the unnamed
type to which it refers. */
return modified_type_die (DECL_ORIGINAL_TYPE (name),
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9723b16106f..abfefcc631f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-05 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/30189
+ * gcc.dg/pr30189.c: New test.
+
2007-02-05 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
* gcc.dg/i386-cpuid.h: Test whether SSE4A is supported
diff --git a/gcc/testsuite/gcc.dg/pr30189.c b/gcc/testsuite/gcc.dg/pr30189.c
new file mode 100644
index 00000000000..6aa963e7a10
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30189.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-g -O" } */
+
+extern void foo (void);
+
+static
+void baz (int i)
+{
+ foo ();
+ typedef char A[i];
+ struct { A b; } *x = 0;
+}
+
+void
+bar (i)
+{
+ baz (i);
+}
OpenPOWER on IntegriCloud