This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Switch to DWARF-2 on sparc-sun-solaris2.7+
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Mark Mitchell <mark at codesourcery dot com>
- Date: Sat, 3 Apr 2004 01:43:39 +0200
- Subject: Switch to DWARF-2 on sparc-sun-solaris2.7+
This patch implements the switch from STABS to DWARF-2 as the default
debugging format on sparc-sun-solaris2.x (x >= 7). Bootstrapped/regtested
on various sparc*-sun-solaris2.* targets. Moderately tested with GDB 5.3,
6.0 and DBX 7.1. And I've attached a patch against changes.html.
I'd also like to backport a few tweaks to SPARC-specific testcases from the
mainline, which fix spurious failures when you cross-test between 32-bit and
64-bit or with a non multilibed compiler.
OK for 3.4 branch?
2004-04-03 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sol2-bi.h (PREFERRED_DEBUGGING_TYPE): Set
to DWARF2_DEBUG unconditionally.
(ASM_DEBUG_SPEC): Set the default to --gdwarf2 unconditionally.
2004-04-03 Eric Botcazou <ebotcazou@libertysurf.fr>
Backport from mainline:
2004-03-26 James A. Morrison <ja2morri@uwaterloo.ca>
* gcc.dg/20001013-1.c: Run on 32-bit and 64-bit SPARC.
* gcc.dg/20001101-1.c: Likewise.
* gcc.dg/20001102-1.c: Likewise.
2004-03-22 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/ultrasp2.c: Do not pass -m64. Remove redundant lines.
* gcc.dg/ultrasp4.c: Likewise.
* gcc.dg/ultrasp8.c: Do not pass -m64. Add sparcv9-*-*.
--
Eric Botcazou
Index: config/sparc/sol2-bi.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sol2-bi.h,v
retrieving revision 1.14.4.1
diff -u -r1.14.4.1 sol2-bi.h
--- config/sparc/sol2-bi.h 1 Feb 2004 15:22:14 -0000 1.14.4.1
+++ config/sparc/sol2-bi.h 2 Apr 2004 09:39:50 -0000
@@ -216,17 +216,9 @@
#define MULTILIB_DEFAULTS { "m64" }
#endif
-/* We use stabs-in-elf in 32-bit mode, because that is what the native
- toolchain uses. But gdb can't handle truncated 32-bit stabs so we
- use dwarf2 in 64-bit mode. */
#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE (TARGET_ARCH32 ? DBX_DEBUG : DWARF2_DEBUG)
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-/* We can't use the above definition for the purposes of specs. */
#if defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
-# if DEFAULT_ARCH32_P
-# define ASM_DEBUG_SPEC "%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}}"
-# else
-# define ASM_DEBUG_SPEC "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}"
-# endif
+# define ASM_DEBUG_SPEC "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}"
#endif
Index: htdocs/gcc-3.4/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-3.4/changes.html,v
retrieving revision 1.106
diff -u -r1.106 changes.html
--- htdocs/gcc-3.4/changes.html 23 Mar 2004 18:48:30 -0000 1.106
+++ htdocs/gcc-3.4/changes.html 2 Apr 2004 06:25:49 -0000
@@ -862,6 +862,10 @@
<li>Several <a href="sparc-abi.html">ABI bugs</a> have been fixed.
Unfortunately, these changes will break binary compatibility with
earlier releases.</li>
+
+ <li>The default debugging format has been switched from STABS to
+ DWARF-2 for 32-bit code on Solaris 7 and later. DWARF-2 is already
+ the default debugging format for 64-bit code on Solaris.</li>
</ul>
<h3>SuperH</h3>
Index: ultrasp2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/ultrasp2.c,v
retrieving revision 1.2
diff -u -r1.2 ultrasp2.c
--- testsuite/gcc.dg/ultrasp2.c 15 May 2001 02:45:32 -0000 1.2
+++ testsuite/gcc.dg/ultrasp2.c 22 Mar 2004 06:49:50 -0000
@@ -4,10 +4,7 @@
/* { dg-do compile } */
/* { dg-options "" } */
-/* { dg-options "-O0 -m64" { target sparc64-*-* } } */
-/* { dg-options "-O0 -m64" { target sparcv9-*-* } } */
-/* { dg-options "" { target sparc-*-solaris2.[0-6] } } */
-/* { dg-options "" { target sparc-*-solaris2.[0-6].* } } */
+/* { dg-options "-O0" { target sparc64-*-* sparcv9-*-* } } */
short foo() {
short i = (short)(1<<15);
Index: ultrasp4.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/ultrasp4.c,v
retrieving revision 1.1
diff -u -r1.1 ultrasp4.c
--- testsuite/gcc.dg/ultrasp4.c 16 Jan 2002 17:44:24 -0000 1.1
+++ testsuite/gcc.dg/ultrasp4.c 22 Mar 2004 06:49:50 -0000
@@ -1,10 +1,7 @@
/* Simplified from PR target/5309. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-options "-O2 -m64 -mcpu=ultrasparc" { target sparc64-*-* } } */
-/* { dg-options "-O2 -m64 -mcpu=ultrasparc" { target sparcv9-*-* } } */
-/* { dg-options "-O2" { target sparc-*-solaris2.[0-6] } } */
-/* { dg-options "-O2" { target sparc-*-solaris2.[0-6].* } } */
+/* { dg-options "-O2 -mcpu=ultrasparc" { target sparc64-*-* sparcv9-*-* } } */
long bar (unsigned int);
long foo (long x, unsigned int y)
Index: ultrasp8.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/ultrasp8.c,v
retrieving revision 1.2
diff -u -r1.2 ultrasp8.c
--- testsuite/gcc.dg/ultrasp8.c 12 Apr 2003 17:45:01 -0000 1.2
+++ testsuite/gcc.dg/ultrasp8.c 22 Mar 2004 06:49:50 -0000
@@ -1,7 +1,7 @@
/* PR target/10067 */
/* Originator: <dat94ali@ludat.lth.se> */
/* { dg-do compile { target sparc*-*-* } } */
-/* { dg-options "-O2 -m64 -mtune=supersparc" { target sparc64-*-* } } */
+/* { dg-options "-O2 -mtune=supersparc" { target sparc64-*-* sparcv9-*-* } } */
struct _reent;
Index: testsuite/gcc.dg/20001013-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/20001013-1.c,v
retrieving revision 1.2
diff -u -p -r1.2 20001013-1.c
--- testsuite/gcc.dg/20001013-1.c 25 Mar 2002 22:33:43 -0000 1.2
+++ testsuite/gcc.dg/20001013-1.c 26 Mar 2004 07:30:03 -0000
@@ -1,7 +1,5 @@
-/* ??? It'd be nice to run this for sparc32 as well, if we could know
- for sure that we're on an ultrasparc, rather than an older cpu. */
-/* { dg-do run { target sparcv9-*-* sparc64-*-* } } */
-/* { dg-options "-O2 -m32 -mcpu=ultrasparc -mvis" } */
+/* { dg-do run { target sparc*-*-* } } */
+/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
int l;
Index: testsuite/gcc.dg/20001101-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/20001101-1.c,v
retrieving revision 1.2
diff -u -p -r1.2 20001101-1.c
--- testsuite/gcc.dg/20001101-1.c 27 Mar 2002 01:23:35 -0000 1.2
+++ testsuite/gcc.dg/20001101-1.c 26 Mar 2004 07:30:03 -0000
@@ -1,7 +1,5 @@
-/* ??? It'd be nice to run this for sparc32 as well, if we could know
- for sure that we're on an ultrasparc, rather than an older cpu. */
-/* { dg-do run { target sparcv9-*-* sparc64-*-* } } */
-/* { dg-options "-O2 -m32 -mcpu=ultrasparc -mvis" } */
+/* { dg-do run { target sparc*-*-* } } */
+/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
int foo(double a, int b, int c, double *d, int h)
{
Index: testsuite/gcc.dg/20001102-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/20001102-1.c,v
retrieving revision 1.2
diff -u -p -r1.2 20001102-1.c
--- testsuite/gcc.dg/20001102-1.c 27 Mar 2002 01:23:35 -0000 1.2
+++ testsuite/gcc.dg/20001102-1.c 26 Mar 2004 07:30:03 -0000
@@ -1,7 +1,5 @@
-/* ??? It'd be nice to run this for sparc32 as well, if we could know
- for sure that we're on an ultrasparc, rather than an older cpu. */
-/* { dg-do run { target sparcv9-*-* sparc64-*-* } } */
-/* { dg-options "-O2 -m32 -mcpu=ultrasparc -mvis" } */
+/* { dg-do run { target sparc*-*-* } } */
+/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
int foo(double a, int b, int c, double *d, int h)
{