This is the mail archive of the gcc-bugs@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]

[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 anilp1 at kpitcummins dot com  2004-04-15 12:46 -------
Subject: RE:  New: In case of SH target with -O2 option #pragma interrupt doesn't get resetted.

Hi,

Please find following patch for bug no. 14798,

ChangeLog
2004-04-15	Anil Paranjpe <anilp1@kpitcummins.com>
	* sh/sh.c (sh_insert_attributes) : Flag pragma_interrupt is set to zero.

--- gcc/config/sh/sh.c.old	2004-04-15 17:25:30.000000000 +0530
+++ gcc/config/sh/sh.c	2004-04-15 17:36:08.000000000 +0530
@@ -6688,7 +6688,7 @@ sh_insert_attributes (tree node, tree *a
   if (! pragma_interrupt
       || TREE_CODE (node) != FUNCTION_DECL)
     return;
-
+    pragma_interrupt = 0;
   /* We are only interested in fields.  */
   if (TREE_CODE_CLASS (TREE_CODE (node)) != 'd')
     return;

Regards,
Anil Paranjpe

-----Original Message-----
From: anilp1 at kpitcummins dot com [mailto:gcc-bugzilla@gcc.gnu.org]
Sent: Wednesday, March 31, 2004 4:42 PM
To: Anil Paranjape
Subject: [Bug target/14798] New: In case of SH target with -O2 option
#pragma interrupt doesn't get resetted.


Hi,

I am using GCC 3.4 snapshot dated 17-03-2004.Please find following testcase 
which to produce the bug. 

test.c
*************************************************************
#pragma interrupt
void isr()
{
}
void delay(int a)
{
}
int main()
{
  return 0;
}
*************************************************************
Above test code is compiled with following options to gcc,
-m2e -S -O2

Since #pragma interrupt is written above "isr", so only "isr" should be treated 
as interrupt handler. But the functions mentioned below "isr" are also treated 
as interrupt handlers i.e. it saves all registers and generates "rte" instead 
of "rts". 

Compiler should treat only "isr" as interuupt handler.

Regards,
Anil Paranjpe

-- 
           Summary: In case of SH target with -O2 option #pragma interrupt
                    doesn't get resetted.
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anilp1 at kpitcummins dot com
                CC: anilp1 at kpitcummins dot com,gcc-bugs at gcc dot gnu
                    dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh-unknown-elf


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

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
You are on the CC list for the bug, or are watching someone who is.


-- 


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


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