[Bug target/14798] [3.4/3.5 Regression] [unit-at-a-time?] In case of SH target with -O2 option #pragma interrupt doesn't get resetted.

anilp1 at kpitcummins dot com gcc-bugzilla@gcc.gnu.org
Tue Jun 1 06:49:00 GMT 2004


------- Additional Comments From anilp1 at kpitcummins dot com  2004-06-01 06:49 -------
Subject: RE:  [3.4/3.5 Regression] [unit-at-a-time?] In case of SH target with -O2 option #pragma interrupt doesn't get resetted.

Hi all,

Please find patch updated with change suggested by Alexandre Oliva.

ChangeLog
2004-06-01	Anil Paranjpe <anilp1@kpitcummins.com>
	* sh/sh.c (sh_insert_attributes) : Reset pragma_interrupt after inserting interrupt_handler attribute.

Patch text
******************************************************************
--- gcc-3.4.0/gcc/config/sh/sh.c.orig	Sat May  1 16:40:57 2004
+++ gcc-3.4.0/gcc/config/sh/sh.c	Tue Jun  1 10:16:26 2004
@@ -6687,13 +6687,14 @@ sh_insert_attributes (tree node, tree *a
   if (! pragma_interrupt
       || TREE_CODE (node) != FUNCTION_DECL)
     return;
-
   /* We are only interested in fields.  */
   if (TREE_CODE_CLASS (TREE_CODE (node)) != 'd')
     return;
 
   /* Add a 'handle_interrupt' attribute.  */
   * attributes = tree_cons (get_identifier ("interrupt_handler"), NULL, * attributes);
+
+    pragma_interrupt = 0;
 
   return;
 }
******************************************************************

Please apply as i don't have access rights.

Regards,
Anil Paranjpe
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools are released on June 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


-----Original Message-----
From: aoliva at gcc dot gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org]
Sent: Tuesday, June 01, 2004 9:49 AM
To: Anil Paranjape
Subject: [Bug target/14798] [3.4/3.5 Regression] [unit-at-a-time?] In
case of SH target with -O2 option #pragma interrupt doesn't get
resetted.



------- Additional Comments From aoliva at gcc dot gnu dot org  2004-06-01 04:19 -------
Given the comment above the variable pragma_interrupt in sh.c, I assume the
behavior expected by Anil is the correct and intended behavior.  Although the
patch correctly implements this, I'd prefer to clear the variable only after
successfully adding the interrupt_handler attribute, right before returning. 
Patch approved with that change.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14798



More information about the Gcc-bugs mailing list