Received: (qmail 11514 invoked from network); 17 Feb 2004 09:42:54 -0000
Received: from sources.redhat.com (67.72.78.213)
  by ns1.codewiz.org with SMTP; 17 Feb 2004 09:42:53 -0000
Received: (qmail 17099 invoked by alias); 17 Feb 2004 09:42:21 -0000
Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:gcc-patches-unsubscribe-bernie=develer.com@gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-patches/>
List-Post: <mailto:gcc-patches@gcc.gnu.org>
List-Help: <mailto:gcc-patches-help@gcc.gnu.org>
Sender: gcc-patches-owner@gcc.gnu.org
Delivered-To: mailing list gcc-patches@gcc.gnu.org
Received: (qmail 17092 invoked from network); 17 Feb 2004 09:42:18 -0000
Received: from unknown (HELO kirk.baltic.net) (193.189.247.10)
  by sources.redhat.com with SMTP; 17 Feb 2004 09:42:18 -0000
Received: (qmail 4043 invoked from network); 17 Feb 2004 09:38:32 -0000
Received: from waldorf.gecko.de (HELO kermit.int.gecko.de) (193.189.247.200)
  by kirk.baltic.net with SMTP; 17 Feb 2004 09:38:32 -0000
Received: from lorien.int.gecko.de (lorien [192.168.120.159])
	by kermit.int.gecko.de (8.12.10+Sun/8.12.10) with ESMTP id i1H9h0aG003043;
	Tue, 17 Feb 2004 10:43:00 +0100 (CET)
Received: from lorien.int.gecko.de (localhost [127.0.0.1])
	by lorien.int.gecko.de (8.12.9/8.12.9) with ESMTP id i1H9gdxt032721;
	Tue, 17 Feb 2004 10:42:39 +0100 (MET)
	(envelope-from munk@lorien.int.gecko.de)
Received: (from munk@localhost)
	by lorien.int.gecko.de (8.12.9/8.12.9/Submit) id i1H9gdVh032720;
	Tue, 17 Feb 2004 10:42:39 +0100 (MET)
Date: Tue, 17 Feb 2004 10:42:39 +0100
From: Gunther Nikl <gni@gecko.de>
To: Bernardo Innocenti <bernie@develer.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [patch/m68k] convert USE_GAS into a compile-time constant
Message-ID: <20040217094239.GA32586@lorien.int.gecko.de>
References: <20040216152043.GA13242@lorien.int.gecko.de> <40315EF9.7080701@develer.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <40315EF9.7080701@develer.com>
User-Agent: Mutt/1.4.2.1i

On Tue, Feb 17, 2004 at 01:23:21AM +0100, Bernardo Innocenti wrote:
> Gunther Nikl wrote:
> 
> >This patch converts all uses of USE_GAS into a compile-time boolean. That
> >way it can be used in C expressions just like MOTOROLA. Tested by compiling
> >cc1 with m68k-elf as target.
> 
> Good idea.
> 
> I can't see you in the "Write after approval" list.  Shall I commit these
> approved patches for you?

  Yes, please - at least the HPUX_ASM patch.

> By the way, m68k-*-aout seems to be the only target that doesn't define 
> USE_GAS. As Ian Lance Taylor said, it should be safe to assume nobody is
> using m68k-*-aout without GAS, therefore we might remove USE_GAS.

  I just checked whether USE_GAS could go and I think it might go. m68k.md
  uses it together with a check with MOTOROLA. Using "jbsr" directly is safe
  there.
  The uses in m68k.c are slightly more difficult to jude. One USE_GAS use
  could safely be removed (second use in m68k_output_mi_thunk): it uses the
  same test as the m68k.md cases. The first use in m68k_output_mi_thunk is
  a bit more difficult for the case "!MOTOROLA": there jra %0,a1" should be
  selected because all GAS versions support "jra" (and there isn't a target
  with !MOTOROLA and USE_GAS). m68k_output_pic_call should probably use the
  instruction selected by USE_GAS.

> No, wait!  OpenBSD still needs it :-(((

  OpenBSD uses GAS without the need to state it and its !MOTOROLA :-)

  I am attaching an updated patch which removes USE_GAS which should be
  safe. If you think removing USE_GAS should be done later, then please
  commit the approved USE_GAS convert patch.

  Gunther

-- cut --

2004-02-16  Gunther Nikl  <gni@gecko.de>

	* config.gcc (m68k-*): Remove USE_GAS from tm_defines.
	* config/m68k/m68k.c (m68k_output_pic_call, m68k_output_mi_thunk):
	Do support GAS only.
	* config/m68k/m68k.md (anonymous call and call_value define_insn):
	Likewise.

--- gcc/config.gcc~	Mon Feb 16 11:08:39 2004
+++ gcc/config.gcc	Tue Feb 17 10:18:51 2004
@@ -1178,20 +1178,20 @@ m68k-*-aout*)
 	;;
 m68k-*-coff*)
 	tmake_file=m68k/t-m68kbare
-	tm_defines="MOTOROLA USE_GAS"
+	tm_defines="MOTOROLA"
 	tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kemb.h dbxcoff.h m68k/coff.h dbx.h"
 	use_fixproto=yes
 	;;
 m68020-*-elf* | m68k-*-elf*)
 	tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h"
-	tm_defines="MOTOROLA USE_GAS"
+	tm_defines="MOTOROLA"
 	tmake_file=m68k/t-m68kelf
 	extra_parts="crtbegin.o crtend.o"
 	use_fixproto=yes
 	;;
 m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
 	tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h m68k/netbsd-elf.h"
-	tm_defines="MOTOROLA USE_GAS"
+	tm_defines="MOTOROLA"
 	case ${target} in
 	m68010*)
 		target_cpu_default="0"
@@ -1211,7 +1211,7 @@ m68k*-*-openbsd*)
 	;;
 m68k-*-uclinux*)		# Motorola m68k/ColdFire running uClinux with uClibc
 	tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/uclinux.h"
- 	tm_defines="MOTOROLA USE_GAS"
+ 	tm_defines="MOTOROLA"
 	tmake_file=m68k/t-uclinux
 	use_fixproto=no
 	;;
@@ -1219,13 +1219,13 @@ m68k-*-linux*)		# Motorola m68k's runnin
 				# with ELF format using glibc 2
 				# aka the GNU/Linux C library 6.
 	tm_file="m68k/m68k.h dbxelf.h elfos.h svr4.h linux.h m68k/linux.h"
-	tm_defines="MOTOROLA USE_GAS"
+	tm_defines="MOTOROLA"
 	tmake_file="t-slibgcc-elf-ver t-linux"
 	;;
 m68k-*-rtems*)
 	tmake_file="m68k/t-m68kbare m68k/t-crtstuff t-rtems m68k/t-rtems"
 	tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h"
-	tm_defines="MOTOROLA USE_GAS"
+	tm_defines="MOTOROLA"
 	extra_parts="crtbegin.o crtend.o"
 	;;
 mcore-*-elf)
diff -up m68k.old/m68k.c m68k/m68k.c
--- gcc/config/m68k/m68k.c	Mon Feb 16 15:07:08 2004
+++ gcc/config/m68k/m68k.c	Tue Feb 17 10:09:44 2004
@@ -1009,11 +1009,7 @@ m68k_output_pic_call(rtx dest)
   else if (TARGET_PCREL)
     out = "bsr.l %o0";
   else if ((flag_pic == 1) || TARGET_68020)
-#if defined(USE_GAS)
     out = "bsr.l %0@PLTPC";
-#else
-    out = "bsr %0@PLTPC";
-#endif
   else if (optimize_size || TARGET_ID_SHARED_LIBRARY)
     out = "move.l %0@GOT(%%a5), %%a1\n\tjsr (%%a1)";
   else
@@ -3373,20 +3369,7 @@ m68k_output_mi_thunk (FILE *file, tree t
       if (TARGET_PCREL)
 	fmt = "bra.l %o0";
       else if ((flag_pic == 1) || TARGET_68020)
-	{
-	  if (MOTOROLA)
-#if defined(USE_GAS)
-	    fmt = "bra.l %0@PLTPC";
-#else
-	    fmt = "bra %0@PLTPC";
-#endif
-	  else /* !MOTOROLA */
-#ifdef USE_GAS
-	    fmt = "bra.l %0";
-#else
-	    fmt = "jra %0,a1";
-#endif
-	}
+	fmt = MOTOROLA ? "bra.l %0@PLTPC" : "jra %0,a1";
       else if (optimize_size || TARGET_ID_SHARED_LIBRARY)
         fmt = "move.l %0@GOT(%%a5), %%a1\n\tjmp (%%a1)";
       else
@@ -3394,11 +3377,7 @@ m68k_output_mi_thunk (FILE *file, tree t
     }
   else
     {
-#if MOTOROLA && !defined (USE_GAS)
-      fmt = "jmp %0";
-#else
       fmt = "jra %0";
-#endif
     }
 
   output_asm_insn (fmt, xops);
diff -up m68k.old/m68k.md m68k/m68k.md
--- gcc/config/m68k/m68k.md	Wed Feb 11 11:11:37 2004
+++ gcc/config/m68k/m68k.md	Tue Feb 17 09:56:28 2004
@@ -6241,11 +6241,7 @@
 
   "! flag_pic"
 {
-#if MOTOROLA && !defined (USE_GAS)
-  return "jsr %0";
-#else
   return "jbsr %0";
-#endif
 })
 
 ;; This is a PIC call sequence.
@@ -6283,11 +6279,7 @@
   ;; Operand 2 not really used on the m68000.
   "! flag_pic"
 {
-#if MOTOROLA && !defined (USE_GAS)
-  return "jsr %1";
-#else
   return "jbsr %1";
-#endif
 })
 
 ;; This is a PIC call_value
-- cut --

