re PR debug/7241 (DWARF encoding for "char" incorrect in gcc)
authorJakub Jelinek <jakub@redhat.com>
Thu, 1 Sep 2005 13:53:45 +0000 (15:53 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 1 Sep 2005 13:53:45 +0000 (15:53 +0200)
PR debug/7241
* 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.

From-SVN: r103727

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 62686b0d5e27efe901455d0a794988d5342a16aa..65e2a67b01e05b8f94b586c37f4852aaf5de50d1 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 2dc03f4d0e6c5e92b5135d6d24dd0024d02bb9a8..a0277b2fd3c3573bee70e797dcb23b5c36e62c73 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 515ea5a026a640a8d6eb2463ad140515dfb38178..26c40aa5ad498bbb72bd4fa12c86a5781f1244e8 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 39f0bf2792a17df0e5f1c135ae91fcc3f0303cdf..fdfbf83215edfcaa42776f50e27951dde3d4ad71 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 48bce243d41f7e5f4033e1777b50cc93cea81bfa..ac897ab78c17207922a2017cf8d9a65139fc27ca 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 34fddfaffc08f9c832379729a2d18574c5c8209a..04b2f36c3b3d461d6c7416d199cf681999bcb9c8 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 b3a245d2b1102fd1a9c4b3f0537b34e01bf9a98b..3fefd41ef94962e78494825c715c83cbb394be09 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 40cdc8dee37ea0191ae3f58c22acf8159163825e..d8f477f54e8bc81e32c466a8a7e422411f35e707 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 d8d013af38c22c124562cdbcf4004d69434c2391..b747076bac63168ce8ec5dabbf862b39467298da 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 f0237cc823cc71f1dc5e36bb0ced324b56e3ffec..7bcebe355e55e4319bb5da3d36b4a75eb547d864 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 45e937372830abd370c91a4f901a285a682b0e09..4efb25e8c22af6af390b82e77b75ea0e0cd04392 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" } } */