diff mbox

[committed,SH] Fix target/52503

Message ID 20120308.070731.385460837.kkojima@rr.iij4u.or.jp
State New
Headers show

Commit Message

Kaz Kojima March 7, 2012, 10:07 p.m. UTC
Hi,

The attached patch is to fix PR target/52503 which is a build failure
for sh-wrs-vxworks.  We've defined too many target option masks.
Tested with usual tests on sh4-unknown-linux-gnu and with a cc1-only
build on sh-wrs-vxworks.  Applied on trunk.

Regards,
	kaz
--
2012-03-07  Oleg Endo  <olegendo@gcc.gnu.org>
	    Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/52503
	* config/sh/sh.opt (msoft-atomic): Use Var instead of Mask.
	* config/sh/linux.h (TARGET_DEFAULT): Remove MASK_SOFT_ATOMIC.
	(SUBTARGET_OVERRIDE_OPTIONS): Define.
diff mbox

Patch

diff -upr ORIG/trunk/gcc/config/sh/linux.h trunk/gcc/config/sh/linux.h
--- ORIG/trunk/gcc/config/sh/linux.h	2011-12-05 10:04:44.000000000 +0900
+++ trunk/gcc/config/sh/linux.h	2012-03-07 13:54:42.000000000 +0900
@@ -1,5 +1,6 @@ 
 /* Definitions for SH running Linux-based GNU systems using ELF
-   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2011
+   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2011,
+   2012
    Free Software Foundation, Inc.
    Contributed by Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
 
@@ -41,7 +42,7 @@  along with GCC; see the file COPYING3.  
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT \
   (TARGET_CPU_DEFAULT | MASK_USERMODE | TARGET_ENDIAN_DEFAULT \
-   | TARGET_OPT_DEFAULT | MASK_SOFT_ATOMIC)
+   | TARGET_OPT_DEFAULT)
 
 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
@@ -135,3 +136,13 @@  along with GCC; see the file COPYING3.  
 /* Install the __sync libcalls.  */
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS  sh_init_sync_libfuncs
+
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS			\
+  do							\
+    {							\
+      /* Defaulting to -msoft-atomic.  */		\
+      if (global_options_set.x_TARGET_SOFT_ATOMIC == 0)	\
+	TARGET_SOFT_ATOMIC = 1;				\
+    }							\
+  while (0)
diff -upr ORIG/trunk/gcc/config/sh/sh.opt trunk/gcc/config/sh/sh.opt
--- ORIG/trunk/gcc/config/sh/sh.opt	2012-03-06 10:28:32.000000000 +0900
+++ trunk/gcc/config/sh/sh.opt	2012-03-07 07:13:58.000000000 +0900
@@ -320,7 +320,7 @@  Target Mask(HITACHI) MaskExists
 Follow Renesas (formerly Hitachi) / SuperH calling conventions
 
 msoft-atomic
-Target Report Mask(SOFT_ATOMIC)
+Target Report Var(TARGET_SOFT_ATOMIC)
 Use software atomic sequences supported by kernel
 
 menable-tas