public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch committed SH] Fix build failure
@ 2016-09-07  6:26 Kaz Kojima
  0 siblings, 0 replies; 4+ messages in thread
From: Kaz Kojima @ 2016-09-07  6:26 UTC (permalink / raw)
  To: gcc-patches

I've committed the attached patch to fix build failure on SH
during compiling tree-profile.c:

../trunk/gcc/tree-profile.c: In function 'unsigned int tree_profiling()':
../trunk/gcc/tree-profile.c:560:12: error: 'TARGET_ATOMIC_ANY' was not declared in this scope

The target sets HAVE_atomic_compare_and_swapsi to TARGET_ATOMIC_ANY
defined in sh-protos.h which can't be seen from tree-profile.c.
The patch simply moves definitions for atomic models to sh.h from
sh-protos.h and guard them with __cplusplus.

Regards,
	kaz
--
2016-09-07  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/sh-protos.h (struct sh_atomic_model,
	selected_atomic_model, TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT,
	TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS,
	TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_IMASK): Move to...
	* config/sh/sh.h (struct sh_atomic_model,
	selected_atomic_model, TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT,
	TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS,
	TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_IMASK): ...here.
	Guard with __cplusplus.

diff --git a/config/sh/sh-protos.h b/config/sh/sh-protos.h
index fecbb88..f611dab 100644
--- a/config/sh/sh-protos.h
+++ b/config/sh/sh-protos.h
@@ -35,59 +35,6 @@ enum sh_function_kind {
   SFUNC_STATIC
 };
 
-/* Atomic model.  */
-struct sh_atomic_model
-{
-  enum enum_type
-  {
-    none = 0,
-    soft_gusa,
-    hard_llcs,
-    soft_tcb,
-    soft_imask,
-
-    num_models
-  };
-
-  /*  If strict is set, disallow mixing of different models, as it would
-      happen on SH4A.  */
-  bool strict;
-  enum_type type;
-
-  /* Name string as it was specified on the command line.  */
-  const char* name;
-
-  /* Name string as it is used in C/C++ defines.  */
-  const char* cdef_name;
-
-  /* GBR offset variable for TCB model.  */
-  int tcb_gbr_offset;
-};
-
-extern const sh_atomic_model& selected_atomic_model (void);
-
-/* Shortcuts to check the currently selected atomic model.  */
-#define TARGET_ATOMIC_ANY \
-  (selected_atomic_model ().type != sh_atomic_model::none)
-
-#define TARGET_ATOMIC_STRICT \
-  (selected_atomic_model ().strict)
-
-#define TARGET_ATOMIC_SOFT_GUSA \
-  (selected_atomic_model ().type == sh_atomic_model::soft_gusa)
-
-#define TARGET_ATOMIC_HARD_LLCS \
-  (selected_atomic_model ().type == sh_atomic_model::hard_llcs)
-
-#define TARGET_ATOMIC_SOFT_TCB \
-  (selected_atomic_model ().type == sh_atomic_model::soft_tcb)
-
-#define TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX \
-  GEN_INT (selected_atomic_model ().tcb_gbr_offset)
-
-#define TARGET_ATOMIC_SOFT_IMASK \
-  (selected_atomic_model ().type == sh_atomic_model::soft_imask)
-
 #ifdef RTX_CODE
 extern rtx sh_fsca_sf2int (void);
 extern rtx sh_fsca_int2sf (void);
diff --git a/config/sh/sh.h b/config/sh/sh.h
index 0403616..25b6cee 100644
--- a/config/sh/sh.h
+++ b/config/sh/sh.h
@@ -333,6 +333,63 @@ extern enum sh_divide_strategy_e sh_div_strategy;
 #define SH_DIV_STRATEGY_DEFAULT SH_DIV_CALL_DIV1
 #endif
 
+#ifdef __cplusplus
+
+/* Atomic model.  */
+struct sh_atomic_model
+{
+  enum enum_type
+  {
+    none = 0,
+    soft_gusa,
+    hard_llcs,
+    soft_tcb,
+    soft_imask,
+
+    num_models
+  };
+
+  /*  If strict is set, disallow mixing of different models, as it would
+      happen on SH4A.  */
+  bool strict;
+  enum_type type;
+
+  /* Name string as it was specified on the command line.  */
+  const char* name;
+
+  /* Name string as it is used in C/C++ defines.  */
+  const char* cdef_name;
+
+  /* GBR offset variable for TCB model.  */
+  int tcb_gbr_offset;
+};
+
+extern const sh_atomic_model& selected_atomic_model (void);
+
+/* Shortcuts to check the currently selected atomic model.  */
+#define TARGET_ATOMIC_ANY \
+  (selected_atomic_model ().type != sh_atomic_model::none)
+
+#define TARGET_ATOMIC_STRICT \
+  (selected_atomic_model ().strict)
+
+#define TARGET_ATOMIC_SOFT_GUSA \
+  (selected_atomic_model ().type == sh_atomic_model::soft_gusa)
+
+#define TARGET_ATOMIC_HARD_LLCS \
+  (selected_atomic_model ().type == sh_atomic_model::hard_llcs)
+
+#define TARGET_ATOMIC_SOFT_TCB \
+  (selected_atomic_model ().type == sh_atomic_model::soft_tcb)
+
+#define TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX \
+  GEN_INT (selected_atomic_model ().tcb_gbr_offset)
+
+#define TARGET_ATOMIC_SOFT_IMASK \
+  (selected_atomic_model ().type == sh_atomic_model::soft_imask)
+
+#endif // __cplusplus
+
 #define SUBTARGET_OVERRIDE_OPTIONS (void) 0
 
 \f

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch committed SH] Fix build failure
@ 2015-12-07  0:03 Kaz Kojima
  0 siblings, 0 replies; 4+ messages in thread
From: Kaz Kojima @ 2015-12-07  0:03 UTC (permalink / raw)
  To: gcc-patches

I've committed the patch below to fix a build failure after
rsqrt_optab changes applied.  Now rsqrtsf2 is expected to have
just 2 operands and HAVE_rsqrtsf2 should be simple enough.
Tested with build for sh4-unknown-linux-gnu and running
gcc.target/sh/sh4a-fsrra.c.

Regards,
	kaz
--
2015-12-06  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/sh.md (rsqrtsf2): Adjust for canonical form with unspec.

diff --git a/config/sh/sh.md b/config/sh/sh.md
index 083febe..b6fe05c 100644
--- a/config/sh/sh.md
+++ b/config/sh/sh.md
@@ -13744,12 +13744,11 @@ label:
 
 (define_insn "rsqrtsf2"
   [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
-	(div:SF (match_operand:SF 1 "immediate_operand" "i")
-		(sqrt:SF (match_operand:SF 2 "fp_arith_reg_operand" "0"))))
+	(unspec:SF [(match_operand:SF 1 "fp_arith_reg_operand" "0")]
+		   UNSPEC_FSRRA))
    (clobber (reg:SI FPSCR_STAT_REG))
    (use (reg:SI FPSCR_MODES_REG))]
-  "TARGET_FPU_ANY && TARGET_FSRRA
-   && operands[1] == CONST1_RTX (SFmode)"
+  "TARGET_FPU_ANY && TARGET_FSRRA"
   "fsrra	%0"
   [(set_attr "type" "fsrra")
    (set_attr "fp_mode" "single")])

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch committed SH] Fix build failure
@ 2015-09-17  8:12 Kaz Kojima
  0 siblings, 0 replies; 4+ messages in thread
From: Kaz Kojima @ 2015-09-17  8:12 UTC (permalink / raw)
  To: gcc-patches

I've committed the attached obvious fix for build failure for SH.
object_allocator is changed so to remove the 2nd argument of its
constructor.

Regards,
	kaz
--
2015-09-17  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/sh.c (label_ref_list_d_pool): Adjust to
	object_allocator change.

diff --git a/config/sh/sh.c b/config/sh/sh.c
index 25149a6..ec0abc5 100644
--- a/config/sh/sh.c
+++ b/config/sh/sh.c
@@ -4659,7 +4659,7 @@ typedef struct label_ref_list_d
 } *label_ref_list_t;
 
 static object_allocator<label_ref_list_d> label_ref_list_d_pool
-  ("label references list", 30);
+  ("label references list");
 
 /* The SH cannot load a large constant into a register, constants have to
    come from a pc relative load.  The reference of a pc relative load

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch committed] SH: Fix build failure
@ 2007-03-10  7:47 Kaz Kojima
  0 siblings, 0 replies; 4+ messages in thread
From: Kaz Kojima @ 2007-03-10  7:47 UTC (permalink / raw)
  To: gcc-patches

The attached patch is a follow-up patch for

r122742 | aoliva | 2007-03-09 16:36:43 +0900 (Fri, 09 Mar 2007) | 15 lines

	* recog.c (decode_asm_operands): Add loc operand.

Without this, the trunk fails to build on SH with

../../ORIG/trunk/gcc/config/sh/sh.c: In function 'sh_insn_length_adjustment':
../../ORIG/trunk/gcc/config/sh/sh.c:8597: error: too few arguments to function 'decode_asm_operands'

Committed as obvious.

Regards,
	kaz
--
2007-03-10  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/sh.c (sh_insn_length_adjustment): Adjust for
	the change of decode_asm_operands.

diff -uprN ORIG/trunk/gcc/config/sh/sh.c LOCAL/trunk/gcc/config/sh/sh.c
--- ORIG/trunk/gcc/config/sh/sh.c	2007-02-20 09:54:08.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/sh.c	2007-03-10 14:48:17.000000000 +0900
@@ -8594,7 +8594,7 @@ sh_insn_length_adjustment (rtx insn)
 	template = XSTR (body, 0);
       else if (asm_noperands (body) >= 0)
 	template
-	  = decode_asm_operands (body, NULL, NULL, NULL, NULL);
+	  = decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL);
       else
 	return 0;
       do

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-07  4:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07  6:26 [patch committed SH] Fix build failure Kaz Kojima
  -- strict thread matches above, loose matches on Subject: below --
2015-12-07  0:03 Kaz Kojima
2015-09-17  8:12 Kaz Kojima
2007-03-10  7:47 [patch committed] SH: " Kaz Kojima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).