CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2020-08-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 10 06:24:39 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h

Log Message:
PR port-m68k/6

Reset STACK_BOUNDARY to default, 16, to fix strange freeze for amiga,
when kernel is compiled by GCC8.

For m68k, the stack pointer is required to be aligned to 16-bit boundary
by architecture. Whereas System V ABI demands it to be aligned to 32-bit
boundary.

According to the document, STACK_BOUNDARY is ``the minimum alignment
enforced by hardware for the stack pointer on this machine.'' Whereas,
PREFERRED_STACK_BOUNDARY should be used ``if you wish to preserve a
certain alignment for the stack pointer, greater than what the hardware
enforces.''

Therefore, STACK_BOUNDARY and PREFERRED_STACK_BOUNDARY should be 16 and
32, respectively, for m68k. This is how Linux/m68k does.

GCC 8 generates codes that wisely allocate 64-bit objects on stack by
using STACK_BOUNDARY. This corrupts the stack frame if it is not properly
aligned.

Since the architecture only guarantees the stack pointer to be aligned to
16-bit boundary, it is not aligned to 32-bit boundary in an instance in
general. If the interrupt occurs at this moment, the interrupt handler
spoils the stack frame as explained above, which results in the mysterious
kernel freezes.

I guess that similar failures can occur even for userland with signal.

With this setting, amiga kernel works just fine as far as I can see.
Furthermore, I've confirmed for amiga, mac68k, and sun3,

(1)   Kernel compiled by patched GCC8 works with
(1-a) userland built by GCC7 and non-modified GCC8, and
(1-b) userland built by patched GCC8.

(2)   Userland binaries compiled by GCC7 and non-modified GCC8 work fine
  with kernel and base libraries built by patched GCC8.

(3)   There's no regression observed for tests/kernel, tests/lib/libc/sys,
  and tests/lib/libc/gen.

This also fixes sun2 kernel to a considerable extent. With non-modified
GCC8, sun2 kernel crashes in strange ways during the early boot stages.
With this change, it boots singleuser.

OK mrg


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.15 src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.16
--- src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.15	Tue Oct  1 10:38:18 2019
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h	Mon Aug 10 06:24:39 2020
@@ -292,8 +292,6 @@ while (0)
 /* Boundary (in *bits*) on which stack pointer should be aligned.
The m68k/SVR4 convention is to keep the stack pointer longword aligned.  */
 
-#undef STACK_BOUNDARY
-#define STACK_BOUNDARY 32
 #undef PREFERRED_STACK_BOUNDARY
 #define PREFERRED_STACK_BOUNDARY 32
 



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2017-02-23 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Thu Feb 23 18:43:02 UTC 2017

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: m68k.c

Log Message:
revert rev 1.2 (disabling split wide types) because it's no longer necessary
after rev 1.6 of m68k.md (which itself reverted a local patch that hadn't
been necessary for over a decade... see gcc bugzilla 12792).
discussed with christos and confirmed no regressions with the atf tests.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c:1.2 src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c:1.3
--- src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c:1.2	Fri Sep 16 20:31:00 2016
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c	Thu Feb 23 18:43:01 2017
@@ -684,8 +684,6 @@ m68k_option_override (void)
   else
 	m68k_sched_mac = MAC_NO;
 }
-// XXX: Avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71695
-flag_split_wide_types = 0;
 }
 
 /* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE.  */



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2016-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 17 00:55:40 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: m68k.md

Log Message:
undo the attempt to figure out mult clobbering; breaks compilation; revert
to the fsf version


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md:1.5 src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md:1.6
--- src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md:1.5	Fri Sep 16 16:30:14 2016
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md	Fri Sep 16 20:55:40 2016
@@ -3135,34 +3135,16 @@
 ;; We need a separate DEFINE_EXPAND for u?mulsidi3 to be able to use the
 ;; proper matching constraint.  This is because the matching is between
 ;; the high-numbered word of the DImode operand[0] and operand[1].
-;;
-;; Note: life_analysis() does not keep track of the individual halves of the
-;; DImode register.  To prevent spurious liveness before the u?mulsidi3 insn
-;; (which causes "uninitialized variable" warnings), we explicitly clobber
-;; the DImode register.
 (define_expand "umulsidi3"
-  [(set (match_operand:DI 0 "register_operand" "")
-	(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" ""))
-		 (zero_extend:DI (match_operand:SI 2 "register_operand" ""]
-  "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
-  "")
-
-(define_insn_and_split "*umulsidi3_split"
-  [(set (match_operand:DI 0 "register_operand" "")
-	(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" ""))
-		 (zero_extend:DI (match_operand:SI 2 "register_operand" ""]
-  "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
-  "#"
-  "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
-  [
-   (parallel
-[(set (subreg:SI (match_dup 0) 4)
-	  (mult:SI (match_dup 1) (match_dup 2)))
+  [(parallel
+[(set (subreg:SI (match_operand:DI 0 "register_operand" "") 4)
+	  (mult:SI (match_operand:SI 1 "register_operand" "")
+		   (match_operand:SI 2 "register_operand" "")))
  (set (subreg:SI (match_dup 0) 0)
 	  (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
 	 (zero_extend:DI (match_dup 2)))
-(const_int 32])
-   (clobber (match_dup 0))]
+(const_int 32])]
+  "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
   "")
 
 (define_insn ""
@@ -3193,27 +3175,15 @@
   "mulu%.l %2,%3:%0")
 
 (define_expand "mulsidi3"
-  [(set (match_operand:DI 0 "register_operand" "")
-	(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" ""))
-		 (sign_extend:DI (match_operand:SI 2 "register_operand" ""]
-  "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
-  "")
-
-(define_insn_and_split "*mulsidi3_split"
-  [(set (match_operand:DI 0 "register_operand" "")
-	(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" ""))
-		 (sign_extend:DI (match_operand:SI 2 "register_operand" ""]
-  "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
-  "#"
-  "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
   [(parallel
-[(set (subreg:SI (match_dup 0) 4)
-	  (mult:SI (match_dup 1) (match_dup 2)))
+[(set (subreg:SI (match_operand:DI 0 "register_operand" "") 4)
+	  (mult:SI (match_operand:SI 1 "register_operand" "")
+		   (match_operand:SI 2 "register_operand" "")))
  (set (subreg:SI (match_dup 0) 0)
 	  (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
 	 (sign_extend:DI (match_dup 2)))
-(const_int 32])
-   (clobber (match_dup 0))]
+(const_int 32])]
+  "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
   "")
 
 (define_insn ""



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2016-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 16 20:30:14 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: m68k.md

Log Message:
put the clobber after the instruction.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md:1.4 src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md:1.5
--- src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md:1.4	Sun Jan 24 04:43:33 2016
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.md	Fri Sep 16 16:30:14 2016
@@ -3154,14 +3154,15 @@
   "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
   "#"
   "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
-  [(clobber (match_dup 0))
+  [
(parallel
 [(set (subreg:SI (match_dup 0) 4)
 	  (mult:SI (match_dup 1) (match_dup 2)))
  (set (subreg:SI (match_dup 0) 0)
 	  (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
 	 (zero_extend:DI (match_dup 2)))
-(const_int 32])]
+(const_int 32])
+   (clobber (match_dup 0))]
   "")
 
 (define_insn ""
@@ -3205,14 +3206,14 @@
   "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
   "#"
   "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
-  [(clobber (match_dup 0))
-   (parallel
+  [(parallel
 [(set (subreg:SI (match_dup 0) 4)
 	  (mult:SI (match_dup 1) (match_dup 2)))
  (set (subreg:SI (match_dup 0) 0)
 	  (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
 	 (sign_extend:DI (match_dup 2)))
-(const_int 32])]
+(const_int 32])
+   (clobber (match_dup 0))]
   "")
 
 (define_insn ""



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2016-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 16 20:31:00 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: m68k.c

Log Message:
turn off split wide types to avoid gcc bug. Arguably this should be fixed
in m68k.md, but I will leave this to someone more qualified.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c:1.1.1.3 src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c:1.2
--- src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c:1.1.1.3	Sun Jan 24 01:06:28 2016
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/m68k.c	Fri Sep 16 16:31:00 2016
@@ -684,6 +684,8 @@ m68k_option_override (void)
   else
 	m68k_sched_mac = MAC_NO;
 }
+// XXX: Avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71695
+flag_split_wide_types = 0;
 }
 
 /* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE.  */



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2016-06-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jun 26 15:46:42 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h

Log Message:
Drop extra argument not used by format string.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.8 src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.9
--- src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.8	Sun Jan 24 09:43:33 2016
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h	Sun Jun 26 15:46:42 2016
@@ -101,7 +101,7 @@ do	\
 if (TARGET_COLDFIRE)		\
   {	\
 asm_fprintf (FILE, "\tmovea.l #%LLP%d-.,%Ra1\n", (LABELNO));	\
-asm_fprintf (FILE, "\tlea (-6,%Rpc,%Ra1),%Ra1\n", (LABELNO));	\
+asm_fprintf (FILE, "\tlea (-6,%Rpc,%Ra1),%Ra1\n");	\
   }	\
 else\
   asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO));	\



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2013-08-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug 21 21:11:30 UTC 2013

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: lb1sf68.asm

Log Message:
When compiling use @PLTPC to generate PLT relocs for NetBSD.
When building libgcc_s.so for m68k, this gets rid of
m68k--netbsdelf/4.5.4/../../../../m68k--netbsdelf/bin/ld: warning: creating a 
DT_TEXTREL in a shared object.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/gcc/config/m68k/lb1sf68.asm

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/lb1sf68.asm
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/lb1sf68.asm:1.2 src/external/gpl3/gcc/dist/gcc/config/m68k/lb1sf68.asm:1.3
--- src/external/gpl3/gcc/dist/gcc/config/m68k/lb1sf68.asm:1.2	Sun Sep 25 13:33:11 2011
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/lb1sf68.asm	Wed Aug 21 21:11:30 2013
@@ -202,6 +202,8 @@ see the files COPYING3 and COPYING.RUNTI
 #if defined (__mcoldfire__)  !defined (__mcfisab__)  !defined (__mcfisac__)
 	lea	\addr-.-8,a0
 	jsr	pc@(a0)
+#elif defined(__NetBSD__)
+	jbsr	\addr@PLTPC
 #else
 	jbsr	\addr
 #endif
@@ -211,9 +213,11 @@ see the files COPYING3 and COPYING.RUNTI
 	/* ISA C has no bra.l instruction, and since this assembly file
 	   gets assembled into multiple object files, we avoid the
 	   bra instruction entirely.  */
-#if (defined (__mcoldfire__)  !defined (__mcfisab__)) || defined(__NetBSD__)
+#if (defined (__mcoldfire__)  !defined (__mcfisab__))
 	lea	\addr-.-8,a0
 	jmp	pc@(a0)
+#elif defined(__NetBSD__)
+	bra	\addr@PLTPC
 #else
 	bra	\addr
 #endif



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2013-07-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul 18 22:38:52 UTC 2013

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h

Log Message:
Cleanup old cruft that wasn't working properly
Adjust for supporting Coldfire processors (default them to softfloat).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.5 src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.6
--- src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.5	Sun Sep 25 13:33:43 2011
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h	Thu Jul 18 22:38:52 2013
@@ -35,53 +35,39 @@ along with GCC; see the file COPYING3.  
 }		\
   while (0)
 
-/* Don't try using XFmode on the 68010.  */ 
+/* Don't try using XFmode on the 68010 or coldfire.  */ 
 #undef LONG_DOUBLE_TYPE_SIZE
 #define LONG_DOUBLE_TYPE_SIZE (TARGET_68020 ? 80 : 64)
 
 #undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
-#ifdef __mc68010__
+#if defined(__mc68010__) || defined(__mcoldfire__)
 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
 #else
 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
 #endif
 
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS \
+  { \
+if (TARGET_COLDFIRE) \
+  { \
+	target_flags |= MASK_STRICT_ALIGNMENT | MASK_CF_HWDIV; \
+	if ((target_flags_explicit  MASK_HARD_FLOAT) == 0) \
+	  { \
+	target_flags = ~MASK_HARD_FLOAT; \
+	m68k_fpu = FPUTYPE_NONE; \
+	  } \
+  } \
+  }
 
 #undef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
-  { cpp_cpu_default_spec, CPP_CPU_DEFAULT_SPEC }, \
-  { cpp_cpu_spec, CPP_CPU_SPEC }, \
-  { cpp_fpu_spec, CPP_FPU_SPEC }, \
-  { asm_default_spec, ASM_DEFAULT_SPEC }, \
   { netbsd_cpp_spec,  NETBSD_CPP_SPEC }, \
   { netbsd_entry_point,   NETBSD_ENTRY_POINT },
 
 
-#define CPP_CPU_SPEC \
-  %{m68010:-D__mc68010__} \
-   %{m68020:-D__mc68020__} \
-   %{m68030:-D__mc68030__} \
-   %{m68040:-D__mc68040__} \
-   %(cpp_cpu_default_spec)
-
-
 #undef TARGET_VERSION
-#if TARGET_DEFAULT  MASK_68020
 #define TARGET_VERSION fprintf (stderr,  (NetBSD/m68k ELF));
-#define CPP_CPU_DEFAULT_SPEC %{!m680*:-D__mc68020__}
-#define ASM_DEFAULT_SPEC %{!m680*:-m68020}
-#else
-#define TARGET_VERSION fprintf (stderr,  (NetBSD/68010 ELF));
-#define CPP_CPU_DEFAULT_SPEC %{!m680*:-D__mc68010__}
-#define ASM_DEFAULT_SPEC %{!m680*:-m68010}
-#endif
-
-
-#if TARGET_DEFAULT  MASK_68881
-#define CPP_FPU_SPEC %{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__}
-#else
-#define CPP_FPU_SPEC %{m68881:-D__HAVE_68881__ -D__HAVE_FPU__}
-#endif
 
 
 /* Provide a CPP_SPEC appropriate for NetBSD m68k targets.  Currently we
@@ -90,7 +76,7 @@ along with GCC; see the file COPYING3.  
 
 #undef CPP_SPEC
 #define CPP_SPEC \
-  %(netbsd_cpp_spec) %(cpp_cpu_spec) %(cpp_fpu_spec)
+  %(netbsd_cpp_spec)
 
 
 /* Provide an ASM_SPEC appropriate for NetBSD m68k ELF targets.  We need
@@ -100,6 +86,8 @@ along with GCC; see the file COPYING3.  
 #define ASM_SPEC \
   %(asm_default_spec) \
 %{m68010} %{m68020} %{m68030} %{m68040} %{m68060} \
+%{m5200} %{m5206e} %{m528x} %{m5307} %{m5407} %{mcfv4e}\
+%{mcpu=*:-mcpu=%*} %{march=*:-march=%*}\
 %{fpic|fpie:-k} %{fPIC|fPIE:-k -K}
 
 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
@@ -123,7 +111,13 @@ along with GCC; see the file COPYING3.  
 #define FUNCTION_PROFILER(FILE, LABELNO)\
 do	\
   {	\
-asm_fprintf (FILE, \tlea (%LLP%d,%Rpc),%Ra1\n, (LABELNO));	\
+if (TARGET_COLDFIRE)		\
+  {	\
+asm_fprintf (FILE, \tmovea.l #%LLP%d-.,%Ra1\n, (LABELNO));	\
+asm_fprintf (FILE, \tlea (-6,%Rpc,%Ra1),%Ra1\n, (LABELNO));	\
+  }	\
+else\
+  asm_fprintf (FILE, \tlea (%LLP%d,%Rpc),%Ra1\n, (LABELNO));	\
 if (flag_pic)			\
   fprintf (FILE, \tbsr.l __mcount@PLTPC\n);			\
 else\



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2012-04-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 22 15:15:46 UTC 2012

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: constraints.md

Log Message:
Bring in fix from:
http://gcc.gnu.org/bugzilla/show_bug.cgi?format=multipleid=43804
Allows libmudflap to compile on m68k:

/usr/src/external/gpl3/gcc/dist/libmudflap/mf-hooks1.c: In function
'__mf_wrap_alloca_indirect':
/usr/src/external/gpl3/gcc/dist/libmudflap/mf-hooks1.c:492:1: error:
insn does not satisfy its constraints:
(insn 360 142 68 13
/usr/src/external/gpl3/gcc/dist/libmudflap/mf-impl.h:257 (set (reg/f:SI
6 %d6 [159])
(const:SI (unspec:SI [
(symbol_ref:SI (__mf_state_1) [flags 0x50]
var_decl 0x7f7ff7304d20 __mf_state_1)
 (const_int 1 [0x1])
 ] 6))) 36 {*movsi_m68k}
(nil))/usr/src/external/gpl3/gcc/dist/libmudflap/mf-hooks1.c:492:1:
internal compiler error: in reload_cse_simplify_operands, at postreload.c:396


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/m68k/constraints.md

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/constraints.md
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/constraints.md:1.1.1.1 src/external/gpl3/gcc/dist/gcc/config/m68k/constraints.md:1.2
--- src/external/gpl3/gcc/dist/gcc/config/m68k/constraints.md:1.1.1.1	Mon Jun 20 21:22:28 2011
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/constraints.md	Sun Apr 22 11:15:46 2012
@@ -94,7 +94,8 @@
 (define_constraint T
   Used for operands that satisfy 's' when -mpcrel is not in effect.
   (and (match_code symbol_ref,label_ref,const)
-   (match_test !flag_pic)))
+   (match_test !TARGET_PCREL)
+   (match_test !flag_pic || LEGITIMATE_PIC_OPERAND_P (op
 
 (define_memory_constraint Q
   Means address register indirect addressing mode.



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2011-12-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Dec 15 08:33:55 UTC 2011

Added Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: t-m68010-netbsd

Log Message:
make sure m68010-netbsdelf chooses the right unwinder.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gcc/dist/gcc/config/m68k/t-m68010-netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/t-m68010-netbsd
diff -u /dev/null src/external/gpl3/gcc/dist/gcc/config/m68k/t-m68010-netbsd:1.1
--- /dev/null	Thu Dec 15 08:33:55 2011
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/t-m68010-netbsd	Thu Dec 15 08:33:55 2011
@@ -0,0 +1,4 @@
+# Use unwind-dw2-fde-glibc
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
+  $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2011-09-25 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Sep 25 13:33:43 UTC 2011

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h

Log Message:
define PREFERRED_STACK_BOUNDARY to be the same as STACK_BOUNDARY,
gcc 4.5 wants them both.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.4 src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.5
--- src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.4	Mon Jul 11 08:23:48 2011
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h	Sun Sep 25 13:33:43 2011
@@ -323,6 +323,8 @@ while (0)
 
 #undef STACK_BOUNDARY
 #define STACK_BOUNDARY 32
+#undef PREFERRED_STACK_BOUNDARY
+#define PREFERRED_STACK_BOUNDARY 32
 
 
 /* Alignment of field after `int : 0' in a structure.



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2011-07-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 11 08:23:16 UTC 2011

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: fpgnulib.c

Log Message:
XXX: add a prototype for __cmpdf2() so this compiles with -Werror.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/m68k/fpgnulib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/fpgnulib.c
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/fpgnulib.c:1.1.1.1 src/external/gpl3/gcc/dist/gcc/config/m68k/fpgnulib.c:1.2
--- src/external/gpl3/gcc/dist/gcc/config/m68k/fpgnulib.c:1.1.1.1	Tue Jun 21 01:22:28 2011
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/fpgnulib.c	Mon Jul 11 08:23:16 2011
@@ -549,6 +549,7 @@
   return - (double) x1;
 }
 
+long __cmpdf2 (double, double);
 long
 __cmpxf2 (long double x1, long double x2)
 {



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2011-07-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 11 08:23:48 UTC 2011

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h

Log Message:
make this look more like the (working) gcc 4.1 configuration, and make
this actually work on netbsd/sun2.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.3 src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.4
--- src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.3	Sun Jul  3 09:10:42 2011
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h	Mon Jul 11 08:23:48 2011
@@ -46,21 +46,41 @@
 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
 #endif
 
+
 #undef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
+  { cpp_cpu_default_spec, CPP_CPU_DEFAULT_SPEC }, \
+  { cpp_cpu_spec, CPP_CPU_SPEC }, \
+  { cpp_fpu_spec, CPP_FPU_SPEC }, \
+  { asm_default_spec, ASM_DEFAULT_SPEC }, \
+  { netbsd_cpp_spec,  NETBSD_CPP_SPEC }, \
   { netbsd_entry_point,   NETBSD_ENTRY_POINT },
 
 
+#define CPP_CPU_SPEC \
+  %{m68010:-D__mc68010__} \
+   %{m68020:-D__mc68020__} \
+   %{m68030:-D__mc68030__} \
+   %{m68040:-D__mc68040__} \
+   %(cpp_cpu_default_spec)
+
+
 #undef TARGET_VERSION
-#if 0
-#define TARGET_VERSION			\
-  fprintf (stderr,			\
-	   TARGET_68010			\
-	   ?  (NetBSD/68010 ELF)	\
-	   :  (NetBSD/m68k ELF));
+#if TARGET_DEFAULT  MASK_68020
+#define TARGET_VERSION fprintf (stderr,  (NetBSD/m68k ELF));
+#define CPP_CPU_DEFAULT_SPEC %{!m680*:-D__mc68020__}
+#define ASM_DEFAULT_SPEC %{!m680*:-m68020}
+#else
+#define TARGET_VERSION fprintf (stderr,  (NetBSD/68010 ELF));
+#define CPP_CPU_DEFAULT_SPEC %{!m680*:-D__mc68010__}
+#define ASM_DEFAULT_SPEC %{!m680*:-m68010}
+#endif
+
+
+#if TARGET_DEFAULT  MASK_68881
+#define CPP_FPU_SPEC %{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__}
 #else
-#define TARGET_VERSION			\
-  fprintf (stderr, (NetBSD/m68k/68010 ELF));
+#define CPP_FPU_SPEC %{m68881:-D__HAVE_68881__ -D__HAVE_FPU__}
 #endif
 
 
@@ -69,14 +89,18 @@
whether or not use of the FPU is allowed.  */
 
 #undef CPP_SPEC
-#define CPP_SPEC NETBSD_CPP_SPEC
+#define CPP_SPEC \
+  %(netbsd_cpp_spec) %(cpp_cpu_spec) %(cpp_fpu_spec)
 
 
 /* Provide an ASM_SPEC appropriate for NetBSD m68k ELF targets.  We need
to pass PIC code generation options.  */
 
 #undef ASM_SPEC
-#define ASM_SPEC %(asm_cpu_spec) %{fpic|fpie:-k} %{fPIC|fPIE:-k -K}
+#define ASM_SPEC \
+  %(asm_default_spec) \
+%{m68010} %{m68020} %{m68030} %{m68040} %{m68060} \
+%{fpic|fpie:-k} %{fPIC|fPIE:-k -K}
 
 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
 



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2011-07-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul  3 09:10:42 UTC 2011

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h

Log Message:
don't use the netbsd LIBGCC_SPEC on sun2.  there's no libgcc_pic.a


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.2 src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.3
--- src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.2	Sat Jul  2 13:18:39 2011
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h	Sun Jul  3 09:10:42 2011
@@ -85,6 +85,11 @@
 #undef LINK_SPEC
 #define LINK_SPEC NETBSD_LINK_SPEC_ELF
 
+/* NetBSD/sun2 does not support shlibs, avoid using libgcc_pic.  */
+#if TARGET_DEFAULT_CPU == 0
+#undef REAL_LIBGCC_SPEC
+#endif
+
 #define NETBSD_ENTRY_POINT _start
 
 /* Output assembler code to FILE to increment profiler label # LABELNO



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2011-07-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jul  2 13:18:39 UTC 2011

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h

Log Message:
TARGET_VERSION is used in collect2.c now.  avoid referencing the
m68k_cpu_flags variable and simply print (NetBSD/m68k/68010 ELF).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.1.1.1 src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.2
--- src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.1.1.1	Tue Jun 21 01:22:28 2011
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h	Sat Jul  2 13:18:39 2011
@@ -52,11 +52,16 @@
 
 
 #undef TARGET_VERSION
+#if 0
 #define TARGET_VERSION			\
   fprintf (stderr,			\
 	   TARGET_68010			\
 	   ?  (NetBSD/68010 ELF)	\
 	   :  (NetBSD/m68k ELF));
+#else
+#define TARGET_VERSION			\
+  fprintf (stderr, (NetBSD/m68k/68010 ELF));
+#endif
 
 
 /* Provide a CPP_SPEC appropriate for NetBSD m68k targets.  Currently we