PR debug/7241
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Sep 2005 13:53:45 +0000 (13:53 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Sep 2005 13:53:45 +0000 (13:53 +0000)
* dwarf2out.c (base_type_die): Compare char_type_node with
TYPE_MAIN_VARIANT (type), not type.

* gcc.dg/debug/dwarf2/dwarf-char1.c: New test.
* gcc.dg/debug/dwarf2/dwarf-char2.c: New test.
* gcc.dg/debug/dwarf2/dwarf-char3.c: New test.

* gcc.dg/debug/dwarf2/dwarf-die1.c: Fix a typo.
* gcc.dg/debug/dwarf2/dwarf-die2.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf-die3.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf-die5.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf-die6.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf-die7.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf-uninit.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf2-macro.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103727 138bc75d-0d04-0410-961f-82ee72b054a4

14 files changed:
gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die1.c
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die2.c
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die3.c
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die5.c
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die6.c
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die7.c
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-uninit.c
gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro.c

index 62686b0..65e2a67 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-01  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/7241
+       * dwarf2out.c (base_type_die): Compare char_type_node with
+       TYPE_MAIN_VARIANT (type), not type.
+
 2005-09-01  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/15366
index 2dc03f4..a0277b2 100644 (file)
@@ -8014,7 +8014,7 @@ base_type_die (tree type)
         that contain spaces; other names might occur by coincidence in other
         languages.  */
       if (! (TYPE_PRECISION (type) == CHAR_TYPE_SIZE
-            && (type == char_type_node
+            && (TYPE_MAIN_VARIANT (type) == char_type_node
                 || ! strcmp (type_name, "signed char")
                 || ! strcmp (type_name, "unsigned char"))))
        {
index 515ea5a..26c40aa 100644 (file)
@@ -1,3 +1,19 @@
+2005-09-01  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/7241
+       * gcc.dg/debug/dwarf2/dwarf-char1.c: New test.
+       * gcc.dg/debug/dwarf2/dwarf-char2.c: New test.
+       * gcc.dg/debug/dwarf2/dwarf-char3.c: New test.
+
+       * gcc.dg/debug/dwarf2/dwarf-die1.c: Fix a typo.
+       * gcc.dg/debug/dwarf2/dwarf-die2.c: Likewise.
+       * gcc.dg/debug/dwarf2/dwarf-die3.c: Likewise.
+       * gcc.dg/debug/dwarf2/dwarf-die5.c: Likewise.
+       * gcc.dg/debug/dwarf2/dwarf-die6.c: Likewise.
+       * gcc.dg/debug/dwarf2/dwarf-die7.c: Likewise.
+       * gcc.dg/debug/dwarf2/dwarf-uninit.c: Likewise.
+       * gcc.dg/debug/dwarf2/dwarf2-macro.c: Likewise.
+
 2005-08-31  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR objc/23306
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char1.c
new file mode 100644 (file)
index 0000000..53ed91a
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR debug/7241 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf-2 -dA" } */
+/* { dg-final { scan-assembler "0x\[68\]\[ \t\]# DW_AT_encoding" } } */
+/* { dg-final { scan-assembler-not "0x\[57\]\[ \t\]# DW_AT_encoding" } } */
+
+char a;
+const char b;
+signed char c;
+volatile signed char d;
+unsigned char e;
+volatile const unsigned char f;
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char2.c
new file mode 100644 (file)
index 0000000..dd3bf93
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR debug/7241 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf-2 -dA" } */
+/* { dg-final { scan-assembler "0x\[68\]\[ \t\]# DW_AT_encoding" } } */
+/* { dg-final { scan-assembler-not "0x\[57\]\[ \t\]# DW_AT_encoding" } } */
+
+const char a;
+char b;
+volatile signed char c;
+signed char d;
+const volatile unsigned char e;
+unsigned char f;
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char3.c
new file mode 100644 (file)
index 0000000..d9e589a
--- /dev/null
@@ -0,0 +1,7 @@
+/* PR debug/7241 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf-2 -dA" } */
+/* { dg-final { scan-assembler "0x\[68\]\[ \t\]# DW_AT_encoding" } } */
+/* { dg-final { scan-assembler-not "0x\[57\]\[ \t\]# DW_AT_encoding" } } */
+
+const char *p = "abc";
index 39f0bf2..fdfbf83 100644 (file)
@@ -1,5 +1,5 @@
 /* Verify that inline function never actually inlined has no abstract DIE.  */
-/* { dg-do compile */
+/* { dg-do compile */
 /* { dg-options "-O2 -gdwarf-2 -dA" } */
 /* { dg-final { scan-assembler-not "DW_AT_inline" } } */
 inline int t()
index 48bce24..ac897ab 100644 (file)
@@ -1,5 +1,5 @@
 /* Verify that inline function never actually emit has no DIE.  */
-/* { dg-do compile */
+/* { dg-do compile */
 /* { dg-options "-O0 -gdwarf-2 -dA" } */
 /* { dg-final { scan-assembler-not "CIE Version" } } */
 static inline int t()
index 34fddfa..04b2f36 100644 (file)
@@ -1,5 +1,5 @@
 /* Verify that extern inline function never actually inlined has no abstract DIE.  */
-/* { dg-do compile */
+/* { dg-do compile */
 /* { dg-options "-O0 -gdwarf-2 -dA" } */
 /* { dg-final { scan-assembler-not "DW_AT_inline" } } */
 extern inline int t()
index b3a245d..3fefd41 100644 (file)
@@ -1,5 +1,5 @@
 /* Inlined inline function must have abstract DIE  */
-/* { dg-do compile */
+/* { dg-do compile */
 /* { dg-options "-O2 -gdwarf-2 -dA -fpreprocessed" } */
 /* { dg-final { scan-assembler "3.*DW_AT_inline" } } */
 #1 "test.h"
index 40cdc8d..d8f477f 100644 (file)
@@ -1,5 +1,5 @@
 /* not inline inline function must not have abstract DIE  */
-/* { dg-do compile */
+/* { dg-do compile */
 /* { dg-options "-O2 -fno-inline -gdwarf-2 -dA -fpreprocessed" } */
 /* { dg-final { scan-assembler-not "DW_AT_inline" } } */
 #1 "test.h"
index d8d013a..b747076 100644 (file)
@@ -1,5 +1,5 @@
 /* Inlined non-inline function must have abstract DIE  */
-/* { dg-do compile */
+/* { dg-do compile */
 /* { dg-options "-O2 -gdwarf-2 -dA -fpreprocessed" } */
 /* { dg-final { scan-assembler "1.*DW_AT_inline" } } */
 #1 "test.h"
index f0237cc..7bcebe3 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do compile */
+/* { dg-do compile */
 /* { dg-options "-O2 -gdwarf-2 -dA" } */
 /* { dg-final { scan-assembler "DW_TAG_variable" } } */
 /* PR debug/21828 */
index 45e9373..4efb25e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test to make sure the mcaro info includes a start file command for the main source */
-/* { dg-do compile */
+/* { dg-do compile */
 /* { dg-options "-g3 -gdwarf-2 -dA -fverbose-asm" } */
 /* { dg-final { scan-assembler "Start new file" } } */