This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Unreviewed PATCH] h8300 #pragma interrupt works only forfirst ISR with -O3


Hi Dhananjay,

Regarding

http://gcc.gnu.org/ml/gcc-patches/2002-06/msg01263.html,

I am comitting a revised patch.

Tested on h8300 port.

Kazu Hirata

2002-06-19  Dhananjay R. Deshpande  <dhananjayd@kpit.com>

	* config/h8300/h8300.c (TARGET_INSERT_ATTRIBUTES): Define.
	(h8300_insert_attributes): New.

Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.134
diff -u -r1.134 h8300.c
--- h8300.c	1 Jun 2002 10:38:57 -0000	1.134
+++ h8300.c	19 Jun 2002 12:38:32 -0000
@@ -61,6 +61,7 @@
 static tree h8300_handle_tiny_data_attribute PARAMS ((tree *, tree, tree, int, bool *));
 static void h8300_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
 static void h8300_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void h8300_insert_attributes PARAMS ((tree, tree *));
 #ifndef OBJECT_FORMAT_ELF
 static void h8300_asm_named_section PARAMS ((const char *, unsigned int));
 #endif
@@ -119,6 +120,9 @@
 #undef TARGET_STRIP_NAME_ENCODING
 #define TARGET_STRIP_NAME_ENCODING h8300_strip_name_encoding
 
+#undef TARGET_INSERT_ATTRIBUTES
+#define TARGET_INSERT_ATTRIBUTES h8300_insert_attributes
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Initialize various cpu specific globals at start up.  */
@@ -3407,6 +3411,22 @@
 
   a = lookup_attribute ("tiny_data", DECL_ATTRIBUTES (decl));
   return a != NULL_TREE;
+}
+
+/* Generate an 'interrupt_handler' attribute for decls.  */
+
+static void
+h8300_insert_attributes (node, attributes)
+     tree node;
+     tree *attributes;
+{
+  if (!interrupt_handler
+      || TREE_CODE (node) != FUNCTION_DECL)
+    return;
+
+  /* Add an 'interrupt_handler' attribute.  */
+  *attributes = tree_cons (get_identifier ("interrupt_handler"),
+			   NULL, *attributes);
 }
 
 /* Supported attributes:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]