This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Remove old code in the SPARC backend
> This patch is a combination of
> http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01783.html
> http://gcc.gnu.org/ml/gcc/2004-03/msg01210.html and
> http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01793.html
Note that we generally prefer separate patches. The ChangeLog entry
should at least show that the changes are independent.
> 2004-03-22 James A. Morrison <ja2morri@uwaterloo.ca>
>
> * config.gcc: Remove sparc-tti-*.
> * config/sparc/pbd.h: Remove.
Space here.
> * config/sparc/sparc.c (print_operand): Remove Sun OS 4 DBX hack.
Did you check that it is not needed on Solaris 2.5.1? If no, we shouldn't
remove it.
> * config/sparc/sparc.md (call, call_value, nonlocal_goto): Remove
> if 0'd code
> (*unimp_insn) Remove.
> * config/sparc/sol2.h: Remove note about Sun OS 4.x.
> * config/sparc/aout.h: Likewise.
> * config/sparc/sparc.h: Remove if 0'd code.
OK.
> testsuite:
> * gcc.dg/20001013-1.c: Run on sparc*-*-*.
> * gcc.dg/20001101-1.c: Likewise.
> * gcc.dg/20001102-1.c: Likewise.
You can remove the duplicate sparc*-*-* string and the -m32 switch from the
dg-options line, they pass in 64-bit mode too.
With these changes, the testsuite results are now identical for a multilib-ed
and a non multilib-ed compiler, both in 32-bit and 64-bit mode, which has
been one of my long-standing goals.
I've bootstrapped/regtested the final patch on sparc64-sun-solaris2.9 and
sparc-sun-solaris2.8 with --disable-multilib and applied it on mainline with
the following ChangeLog entries:
2004-03-26 James A. Morrison <ja2morri@uwaterloo.ca>
* config.gcc: Remove sparc-tti-*.
* config/sparc/pbd.h: Delete.
* config/sparc/sol2.h: Remove note about Sun OS 4.x.
* config/sparc/aout.h: Likewise.
* config/sparc/sparc.h: Remove if 0'd code.
* config/sparc/sparc.md (call): Remove if 0'd code.
(call_value): Likewise.
(nonlocal_goto): Likewise.
(unimp_insn): Delete.
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.
Thanks!
--
Eric Botcazou
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.443
diff -u -p -r1.443 config.gcc
--- config.gcc 23 Mar 2004 13:45:28 -0000 1.443
+++ config.gcc 26 Mar 2004 07:26:49 -0000
@@ -1785,10 +1785,6 @@ sh-*-*)
tm_file="${tm_file} dbxcoff.h sh/coff.h"
use_fixproto=yes
;;
-sparc-tti-*)
- tm_file="${tm_file} sparc/pbd.h"
- use_fixproto=yes
- ;;
sparc-*-netbsdelf*)
tm_file="${tm_file} elfos.h svr4.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
;;
Index: config/sparc/aout.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/aout.h,v
retrieving revision 1.14
diff -u -p -r1.14 aout.h
--- config/sparc/aout.h 15 Mar 2004 18:20:49 -0000 1.14
+++ config/sparc/aout.h 26 Mar 2004 07:26:50 -0000
@@ -48,10 +48,7 @@ do { \
#define DATA_SECTION_ASM_OP "\t.data"
/* This is how to output a note to DBX telling it the line number
- to which the following sequence of instructions corresponds.
-
- This is needed for SunOS 4.0, and should not hurt for 3.2
- versions either. */
+ to which the following sequence of instructions corresponds. */
#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
fprintf (file, ".stabn 68,0,%d,LM%d\nLM%d:\n", \
line, counter, counter)
Index: config/sparc/sol2.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sol2.h,v
retrieving revision 1.61
diff -u -p -r1.61 sol2.h
--- config/sparc/sol2.h 3 Feb 2004 12:36:22 -0000 1.61
+++ config/sparc/sol2.h 26 Mar 2004 07:26:50 -0000
@@ -130,8 +130,6 @@ Boston, MA 02111-1307, USA. */
#undef SUPPORTS_INIT_PRIORITY
#define SUPPORTS_INIT_PRIORITY 0
-/* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
- Instead, it is enabled here, because it does work under Solaris. */
/* Define for support of TFmode long double.
SPARC ABI says that long double is 4 words. */
#define LONG_DOUBLE_TYPE_SIZE 128
Index: config/sparc/sparc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.h,v
retrieving revision 1.249
diff -u -p -r1.249 sparc.h
--- config/sparc/sparc.h 15 Mar 2004 21:06:43 -0000 1.249
+++ config/sparc/sparc.h 26 Mar 2004 07:27:28 -0000
@@ -699,14 +699,9 @@ extern struct sparc_cpu_select sparc_sel
#define LONG_LONG_TYPE_SIZE 64
#define FLOAT_TYPE_SIZE 32
#define DOUBLE_TYPE_SIZE 64
-
-#if 0
-/* ??? This does not work in SunOS 4.x, so it is not enabled here.
- Instead, it is enabled in sol2.h, because it does work under Solaris. */
-/* Define for support of TFmode long double.
- SPARC ABI says that long double is 4 words. */
-#define LONG_DOUBLE_TYPE_SIZE 128
-#endif
+/* LONG_DOUBLE_TYPE_SIZE is defined per OS even though the
+ SPARC ABI says that it is 128-bit wide. */
+/* #define LONG_DOUBLE_TYPE_SIZE 128 */
/* Width in bits of a pointer.
See also the macro `Pmode' defined below. */
Index: config/sparc/sparc.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.md,v
retrieving revision 1.199
diff -u -p -r1.199 sparc.md
--- config/sparc/sparc.md 26 Feb 2004 18:40:41 -0000 1.199
+++ config/sparc/sparc.md 26 Mar 2004 07:27:44 -0000
@@ -7309,15 +7309,6 @@
"jmp\t%a0%#"
[(set_attr "type" "uncond_branch")])
-;; This pattern recognizes the "instruction" that appears in
-;; a function call that wants a structure value,
-;; to inform the called function if compiled with Sun CC.
-;(define_insn "*unimp_insn"
-; [(match_operand:SI 0 "immediate_operand" "")]
-; "GET_CODE (operands[0]) == CONST_INT && INTVAL (operands[0]) > 0"
-; "unimp\t%0"
-; [(set_attr "type" "marker")])
-
;;- jump to subroutine
(define_expand "call"
;; Note that this expression is not used for generating RTL.
@@ -7328,7 +7319,7 @@
;; operands[3] is struct_value_size_rtx.
""
{
- rtx fn_rtx, nregs_rtx;
+ rtx fn_rtx;
if (GET_MODE (operands[0]) != FUNCTION_MODE)
abort ();
@@ -7362,42 +7353,21 @@
fn_rtx = operands[0];
- /* Count the number of parameter registers being used by this call.
- if that argument is NULL, it means we are using them all, which
- means 6 on the sparc. */
-#if 0
- if (operands[2])
- nregs_rtx = GEN_INT (REGNO (operands[2]) - 8);
- else
- nregs_rtx = GEN_INT (6);
-#else
- nregs_rtx = const0_rtx;
-#endif
-
if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0)
emit_call_insn
(gen_rtx_PARALLEL
(VOIDmode,
- gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx),
+ gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, const0_rtx),
operands[3],
gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)))));
else
emit_call_insn
(gen_rtx_PARALLEL
(VOIDmode,
- gen_rtvec (2, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx),
+ gen_rtvec (2, gen_rtx_CALL (VOIDmode, fn_rtx, const0_rtx),
gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)))));
finish_call:
-#if 0
- /* If this call wants a structure value,
- emit an unimp insn to let the called function know about this. */
- if (! TARGET_ARCH64 && INTVAL (operands[3]) > 0)
- {
- rtx insn = emit_insn (operands[3]);
- SCHED_GROUP_P (insn) = 1;
- }
-#endif
DONE;
})
@@ -7502,7 +7472,7 @@
;; operand 3 is next_arg_register
""
{
- rtx fn_rtx, nregs_rtx;
+ rtx fn_rtx;
rtvec vec;
if (GET_MODE (operands[1]) != FUNCTION_MODE)
@@ -7510,18 +7480,9 @@
fn_rtx = operands[1];
-#if 0
- if (operands[3])
- nregs_rtx = GEN_INT (REGNO (operands[3]) - 8);
- else
- nregs_rtx = GEN_INT (6);
-#else
- nregs_rtx = const0_rtx;
-#endif
-
vec = gen_rtvec (2,
gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx)),
+ gen_rtx_CALL (VOIDmode, fn_rtx, const0_rtx)),
gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)));
emit_call_insn (gen_rtx_PARALLEL (VOIDmode, vec));
--- config/sparc/pbd.h 2004-03-19 19:32:00.000000000 -0500
+++ /dev/null 2004-01-27 07:53:25.000000000 -0500
@@ -1,145 +0,0 @@
-/* Definitions of target machine for GNU compiler, Citicorp/TTI Unicom PBD
- version (using GAS and COFF (encapsulated is unacceptable) )
- Copyright (C) 1990, 1996, 2000, 2004 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* Target OS builtins. */
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define_std ("unix"); \
- builtin_define_std ("UnicomPBD"); \
- builtin_assert ("system=unix"); \
- } \
- while (0)
-
-/* We want DBX format for use with gdb under COFF. */
-
-#define DBX_DEBUGGING_INFO 1
-
-/* Generate calls to memcpy, memcmp and memset. */
-
-#define TARGET_MEM_FUNCTIONS
-
-/* we use /lib/libp/lib* when profiling */
-
-#undef LIB_SPEC
-#define LIB_SPEC "%{p:-L/usr/lib/libp} %{pg:-L/usr/lib/libp} -lc"
-
-
-/* Use crt1.o as a startup file and crtn.o as a closing file. */
-/*
- * The loader directive file gcc.ifile defines how to merge the constructor
- * sections into the data section. Also, since gas only puts out those
- * sections in response to N_SETT stabs, and does not (yet) have a
- * ".sections" directive, gcc.ifile also defines the list symbols
- * __DTOR_LIST__ and __CTOR_LIST__.
- *
- * Finally, we must explicitly specify the file from libgcc.a that defines
- * exit(), otherwise if the user specifies (for example) "-lc_s" on the
- * command line, the wrong exit() will be used and global destructors will
- * not get called .
- */
-
-#define STARTFILE_SPEC \
-"%{!r: gcc.ifile%s} %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} \
-%{!r:_exit.o%s}"
-
-#define ENDFILE_SPEC "crtn.o%s"
-
-/* LINK_SPEC is needed only for SunOS 4. */
-
-#undef LINK_SPEC
-
-/* Although the gas we use can create .ctor and .dtor sections from N_SETT
- stabs, it does not support section directives, so we need to have the loader
- define the lists.
- */
-#define CTOR_LISTS_DEFINED_EXTERNALLY
-
-/* similar to default, but allows for the table defined by ld with gcc.ifile.
- nptrs is always 0. So we need to instead check that __DTOR_LIST__[1] != 0.
- The old check is left in so that the same macro can be used if and when
- a future version of gas does support section directives. */
-
-#define DO_GLOBAL_DTORS_BODY {int nptrs = *(int *)__DTOR_LIST__; int i; \
- if (nptrs == -1 || (__DTOR_LIST__[0] == 0 && __DTOR_LIST__[1] != 0)) \
- for (nptrs = 0; __DTOR_LIST__[nptrs + 1] != 0; nptrs++); \
- for (i = nptrs; i >= 1; i--) \
- __DTOR_LIST__[i] (); }
-
-/*
- * Here is an example gcc.ifile. I've tested it on PBD sparc
- * systems. The NEXT(0x200000) works on just about all 386 and m68k systems,
- * but can be reduced to any power of 2 that is >= NBPS (0x40000 on a pbd).
-
- SECTIONS {
- .text BIND(0x41000200) BLOCK (0x200) :
- { *(.init) *(.text) vfork = fork; *(.fini) }
-
- GROUP BIND( NEXT(0x200000) + ADDR(.text) + SIZEOF(.text)):
- { .data : { __CTOR_LIST__ = . ; . += 4; *(.ctor) . += 4 ;
- __DTOR_LIST__ = . ; . += 4; *(.dtor) . += 4 ; }
- .bss : { }
- }
- }
- */
-
-/* The prefix to add to user-visible assembler symbols. */
-
-#undef USER_LABEL_PREFIX
-#define USER_LABEL_PREFIX ""
-
-/* fixes: */
-/*
- * Internal labels are prefixed with a period.
- */
-
-#undef LOCAL_LABEL_PREFIX
-#define LOCAL_LABEL_PREFIX "."
-
-/* This is how to store into the string LABEL
- the symbol_ref name of an internal numbered label where
- PREFIX is the class of label and NUM is the number within the class.
- This is suitable for output with `assemble_name'. */
-
-#undef ASM_GENERATE_INTERNAL_LABEL
-#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
- sprintf (LABEL, "*.%s%ld", PREFIX, (long)(NUM))
-
-/* This is how to output an element of a case-vector that is relative. */
-
-#undef ASM_OUTPUT_ADDR_DIFF_ELT
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
-
-/* This is how to output an element of a case-vector that is absolute.
- (The 68000 does not use such vectors,
- but we must define this macro anyway.) */
-
-#undef ASM_OUTPUT_ADDR_VEC_ELT
-#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
- fprintf (FILE, "\t.word .L%d\n", VALUE)
-
-/* This is needed for SunOS 4.0, and should not hurt for 3.2
- versions either. */
-#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
- fprintf (file, ".stabn 68,0,%d,.LM%d\n.LM%d:\n", \
- line, counter, counter)
? testsuite/gcc.dg/loop-3.c
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)
{