/* Subroutines used for code generation on Renesas RL78 processors.
- Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Copyright (C) 2011-2024 Free Software Foundation, Inc.
Contributed by Red Hat.
This file is part of GCC.
&& strcmp (lang_hooks.name, "GNU C")
&& strcmp (lang_hooks.name, "GNU C11")
&& strcmp (lang_hooks.name, "GNU C17")
- && strcmp (lang_hooks.name, "GNU C2X")
+ && strcmp (lang_hooks.name, "GNU C23")
&& strcmp (lang_hooks.name, "GNU C89")
&& strcmp (lang_hooks.name, "GNU C99")
/* Compiling with -flto results in a language of GNU GIMPLE being used... */
#define TARGET_ATTRIBUTE_TABLE rl78_attribute_table
/* Table of RL78-specific attributes. */
-const struct attribute_spec rl78_attribute_table[] =
+TARGET_GNU_ATTRIBUTES (rl78_attribute_table,
{
/* Name, min_len, max_len, decl_req, type_req, fn_type_req,
affects_type_identity, handler, exclude. */
{ "saddr", 0, 0, true, false, false, false,
rl78_handle_saddr_attribute, NULL },
{ "vector", 1, -1, true, false, false, false,
- rl78_handle_vector_attribute, NULL },
- { NULL, 0, 0, false, false, false, false, NULL, NULL }
-};
+ rl78_handle_vector_attribute, NULL }
+});
\f
bool
rl78_as_legitimate_address (machine_mode mode ATTRIBUTE_UNUSED, rtx x,
- bool strict ATTRIBUTE_UNUSED, addr_space_t as ATTRIBUTE_UNUSED)
+ bool strict ATTRIBUTE_UNUSED,
+ addr_space_t as ATTRIBUTE_UNUSED, code_helper)
{
rtx base, index, addend;
bool is_far_addr = false;
rl78_insert_attributes (tree decl, tree *attributes ATTRIBUTE_UNUSED)
{
if (TARGET_ES0
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& TREE_READONLY (decl)
&& TREE_ADDRESSABLE (decl)
&& TYPE_ADDR_SPACE (TREE_TYPE (decl)) == ADDR_SPACE_GENERIC)
if (priority != DEFAULT_INIT_PRIORITY)
{
/* This section of the function is based upon code copied
- from: gcc/varasm.c:get_cdtor_priority_section(). */
+ from: gcc/varasm.cc:get_cdtor_priority_section(). */
char buf[18];
sprintf (buf, "%s.%.5u", is_ctor ? ".ctors" : ".dtors",
this address. So we can skip adding in the high bytes. */
if (TARGET_ES0
&& GET_CODE (operands[2]) == SYMBOL_REF
- && TREE_CODE (SYMBOL_REF_DECL (operands[2])) == VAR_DECL
+ && VAR_P (SYMBOL_REF_DECL (operands[2]))
&& TREE_READONLY (SYMBOL_REF_DECL (operands[2]))
&& ! TREE_SIDE_EFFECTS (SYMBOL_REF_DECL (operands[2])))
return "movw ax, %h1\n\taddw ax, %h2\n\tmovw %h0, ax";
}
\f
+/* The strub runtime uses asms, and physical register allocation won't
+ deal with them, so disable it. */
+#undef TARGET_HAVE_STRUB_SUPPORT_FOR
+#define TARGET_HAVE_STRUB_SUPPORT_FOR hook_bool_tree_false
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-rl78.h"