This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR debug/7241 (regression from 2.95.x)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 1 Sep 2005 10:05:22 -0400
- Subject: [PATCH] Fix PR debug/7241 (regression from 2.95.x)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
I'm very sorry, completely forgot about this.
http://gcc.gnu.org/ml/gcc-patches/2002-07/msg00534.html
has been approved by Mark more than 3 years ago:
http://gcc.gnu.org/ml/gcc-patches/2002-07/msg00540.html
but I forgot to check it in. The following is what I have retested
now (incorporating the suggestion by Jason to not check type_name
in that case, as it is known to be "char"). I fixed also a bunch
of obvious bugs in the debug/dwarf2/ tests (missing closing }
for { dg-do compile) and committed to HEAD (or is it supposed to be
approved again?) and 4.0.
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.
* 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.
--- gcc/dwarf2out.c.jj 2005-08-27 10:57:54.000000000 +0200
+++ gcc/dwarf2out.c 2005-09-01 13:18:47.000000000 +0200
@@ -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"))))
{
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char1.c.jj 2005-09-01 13:36:09.000000000 +0200
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char1.c 2005-09-01 13:32:29.000000000 +0200
@@ -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;
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char2.c.jj 2005-09-01 13:36:11.000000000 +0200
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char2.c 2005-09-01 13:34:56.000000000 +0200
@@ -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;
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char3.c.jj 2005-09-01 13:36:13.000000000 +0200
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char3.c 2005-09-01 13:35:18.000000000 +0200
@@ -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";
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die1.c.jj 2004-01-12 17:25:32.000000000 +0100
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die1.c 2005-09-01 13:24:58.000000000 +0200
@@ -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()
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die2.c.jj 2004-01-12 17:25:32.000000000 +0100
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die2.c 2005-09-01 13:25:02.000000000 +0200
@@ -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()
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die3.c.jj 2004-01-12 17:25:32.000000000 +0100
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die3.c 2005-09-01 13:25:04.000000000 +0200
@@ -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()
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die5.c.jj 2004-01-12 17:25:32.000000000 +0100
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die5.c 2005-09-01 13:25:07.000000000 +0200
@@ -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"
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die6.c.jj 2004-01-12 17:25:32.000000000 +0100
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die6.c 2005-09-01 13:25:10.000000000 +0200
@@ -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"
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die7.c.jj 2004-01-12 17:25:32.000000000 +0100
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die7.c 2005-09-01 13:25:12.000000000 +0200
@@ -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"
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-uninit.c.jj 2005-07-22 19:40:37.000000000 +0200
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-uninit.c 2005-09-01 13:25:16.000000000 +0200
@@ -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 */
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro.c.jj 2005-03-04 04:08:10.000000000 +0100
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro.c 2005-09-01 13:25:18.000000000 +0200
@@ -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" } } */
Jakub