public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] CRIS: Don't include tree.h in cris-protos.h, PR bootstrap/111021
@ 2023-08-15  4:57 Hans-Peter Nilsson
  2023-08-15  5:13 ` Hans-Peter Nilsson
  0 siblings, 1 reply; 2+ messages in thread
From: Hans-Peter Nilsson @ 2023-08-15  4:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: linkw

I'll commit this in a few hours pending testing.  It seems
trivial enough to be posted before testing is finished
though, now that it has passed the previous
point-of-breakage.  JFTR, I'm testing against the version
with the "first" breaking commit: r14-3092, not r14-3093 the
one with recog.h.

-- >8 --
While there's another patch that fixes the immediate error
in the PR by other means, the include of tree.h here is
something I prefer to avoid.

	PR bootstrap/111021
	* config/cris/cris-protos.h: Revert recent change.
	* config/cris/cris.cc (cris_legitimate_address_p): Remove
	code_helper unused parameter.
	(cris_legitimate_address_p_hook): New wrapper function.
	(TARGET_LEGITIMATE_ADDRESS_P): Change to
	cris_legitimate_address_p_hook.
---
 gcc/config/cris/cris-protos.h |  5 +----
 gcc/config/cris/cris.cc       | 13 +++++++++++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h
index 58555943986c..666e04f9eeec 100644
--- a/gcc/config/cris/cris-protos.h
+++ b/gcc/config/cris/cris-protos.h
@@ -20,8 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 
 /* Prototypes for the CRIS port.  */
 
-#include "tree.h" /* For ERROR_MARK.  */
-
 extern bool cris_simple_epilogue (void);
 #ifdef RTX_CODE
 extern const char *cris_op_str (rtx);
@@ -36,8 +34,7 @@ extern bool cris_base_or_autoincr_p (const_rtx, bool);
 extern bool cris_bdap_index_p (const_rtx, bool);
 extern void cris_reduce_compare (rtx *, rtx *, rtx *);
 extern bool cris_biap_index_p (const_rtx, bool);
-extern bool cris_legitimate_address_p (machine_mode, rtx, bool,
-				       code_helper = ERROR_MARK);
+extern bool cris_legitimate_address_p (machine_mode, rtx, bool);
 extern bool cris_store_multiple_op_p (rtx);
 extern bool cris_movem_load_rest_p (rtx);
 extern void cris_asm_output_symbol_ref (FILE *, rtx);
diff --git a/gcc/config/cris/cris.cc b/gcc/config/cris/cris.cc
index 853c07920f07..4eaaf2184b63 100644
--- a/gcc/config/cris/cris.cc
+++ b/gcc/config/cris/cris.cc
@@ -168,6 +168,8 @@ static unsigned int cris_hard_regno_nregs (unsigned int, machine_mode);
 static bool cris_hard_regno_mode_ok (unsigned int, machine_mode);
 static HOST_WIDE_INT cris_static_rtx_alignment (machine_mode);
 static HOST_WIDE_INT cris_constant_alignment (const_tree, HOST_WIDE_INT);
+static bool cris_legitimate_address_p_hook (machine_mode, rtx, bool,
+					    code_helper);
 
 /* This is the parsed result of the "-max-stack-stackframe=" option.  If
    it (still) is zero, then there was no such option given.  */
@@ -217,7 +219,7 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
 #define TARGET_INIT_LIBFUNCS cris_init_libfuncs
 
 #undef TARGET_LEGITIMATE_ADDRESS_P
-#define TARGET_LEGITIMATE_ADDRESS_P cris_legitimate_address_p
+#define TARGET_LEGITIMATE_ADDRESS_P cris_target_legitimate_address_p
 
 #undef TARGET_PREFERRED_RELOAD_CLASS
 #define TARGET_PREFERRED_RELOAD_CLASS cris_preferred_reload_class
@@ -1536,8 +1538,15 @@ cris_biap_index_p (const_rtx x, bool strict)
 
 /* Worker function for TARGET_LEGITIMATE_ADDRESS_P.  */
 
+static bool
+cris_legitimate_address_p_hook (machine_mode mode, rtx x, bool strict,
+				code_helper)
+{
+  return cris_legitimate_address_p (mode, x, strict);
+}
+
 bool
-cris_legitimate_address_p (machine_mode mode, rtx x, bool strict, code_helper)
+cris_legitimate_address_p (machine_mode mode, rtx x, bool strict)
 {
   const_rtx x1, x2;
 
-- 
2.30.2


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

* Re: [PATCH] CRIS: Don't include tree.h in cris-protos.h, PR bootstrap/111021
  2023-08-15  4:57 [PATCH] CRIS: Don't include tree.h in cris-protos.h, PR bootstrap/111021 Hans-Peter Nilsson
@ 2023-08-15  5:13 ` Hans-Peter Nilsson
  0 siblings, 0 replies; 2+ messages in thread
From: Hans-Peter Nilsson @ 2023-08-15  5:13 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gcc-patches, linkw

> From: Hans-Peter Nilsson <hp@axis.com>
> Date: Tue, 15 Aug 2023 06:57:04 +0200

Whoops, of course there was a typo due to
insufficient-last-minute-renaming syndrome. :)

> -#define TARGET_LEGITIMATE_ADDRESS_P cris_legitimate_address_p
> +#define TARGET_LEGITIMATE_ADDRESS_P cris_target_legitimate_address_p

*cris_legitimate_address_p_hook

brgds, H-P

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

end of thread, other threads:[~2023-08-15  5:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-15  4:57 [PATCH] CRIS: Don't include tree.h in cris-protos.h, PR bootstrap/111021 Hans-Peter Nilsson
2023-08-15  5:13 ` Hans-Peter Nilsson

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).