* Commit: M32R: Fix handling of the __model__ attribute
@ 2015-07-31 16:10 Nick Clifton
0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2015-07-31 16:10 UTC (permalink / raw)
To: gcc-patches
Hi Guys,
I am checking in the patch below to fix the M32R port's handling of
its __model__ attribute. This attribute takes a parameter identifying
the memory model to use, but gcc was not being told to expect this
identifier.
Cheers
Nick
gcc/ChangeLog
2015-07-31 Nick Clifton <nickc@redhat.com>
* config/m32r/m32r.c (m32r_attribute_identifier): New function.
Returns true for __model__.
(TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P): Define.
Index: gcc/config/m32r/m32r.c
===================================================================
--- gcc/config/m32r/m32r.c (revision 226444)
+++ gcc/config/m32r/m32r.c (working copy)
@@ -113,6 +113,7 @@
static void m32r_conditional_register_usage (void);
static void m32r_trampoline_init (rtx, tree, rtx);
static bool m32r_legitimate_constant_p (machine_mode, rtx);
+static bool m32r_attribute_identifier (const_tree);
\f
/* M32R specific attributes. */
@@ -129,6 +130,8 @@
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE m32r_attribute_table
+#undef TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P
+#define TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P m32r_attribute_identifier
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P m32r_legitimate_address_p
@@ -404,6 +407,13 @@
return NULL_TREE;
}
+
+static bool
+m32r_attribute_identifier (const_tree name)
+{
+ return strcmp (IDENTIFIER_POINTER (name), "model") == 0
+ || strcmp (IDENTIFIER_POINTER (name), "__model__") == 0;
+}
\f
/* Encode section information of DECL, which is either a VAR_DECL,
FUNCTION_DECL, STRING_CST, CONSTRUCTOR, or ???.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-31 15:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-31 16:10 Commit: M32R: Fix handling of the __model__ attribute Nick Clifton
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).