Bug 8973 - [arc-7-elf] the interupt handler does not return properly, uses j.d insted of j.d.f
Summary: [arc-7-elf] the interupt handler does not return properly, uses j.d insted of...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: 4.1.0
Assignee: Saurabh Verma
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: patch
Depends on:
Blocks:
 
Reported: 2002-12-17 01:26 UTC by or.poran
Modified: 2005-09-06 22:29 UTC (History)
1 user (show)

See Also:
Host:
Target: arc-7-elf
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-06-10 18:32:28


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description or.poran 2002-12-17 01:26:01 UTC
inteupt handler code:
void ivic3_handler (void) __attribute__ ((__interrupt__ ("ilink1")));
void ivic3_handler (void)
{
}

produce the asn code:
    .cpu base
    .section .text
    .align 4
    .global _ivic3_handler
    .type   _ivic3_handler,@function
_ivic3_handler:
    ; interrupt handler
    sub sp,sp,16
    ; BEGIN PROLOGUE ; vars= 0, regs= 0, args= 0, extra= 0
    st fp,[sp]
    mov fp,sp
    ; END PROLOGUE
    ; EPILOGUE
    ld.a fp,[sp,0]
    j.d ilink1
    add sp,sp,16
.Lfe1:
    .size   _ivic3_handler,.Lfe1-_ivic3_handler
    .ident  "GCC: (GNU) 3.2"


the return statement:
    j.d ilink1
should be
    j.d.f (to update the flags)

Release:
gcc version 3.2

Environment:
Configured with: ./configure --prefix=/afs/iil/home/o/oporan/fw/gcc/gcc-3.2/../install/ --target=arc-7-elf.

Linux
gcc as cross-compiler
Comment 1 or.poran 2002-12-17 01:26:01 UTC
Fix:
lines 1337 in gcc/config/arc/arc.c
should be replaced with:
    if (fn_type == ARC_FUNCTION_ILINK1 || fn_type == ARC_FUNCTION_ILINK2)
        fprintf (file, "\tj.d.f %s\n", reg_names[regs[fn_type]]);
    else    
        fprintf (file, "\tj.d %s\n", reg_names[regs[fn_type]]);
Comment 2 Dara Hazeghi 2003-05-26 20:46:46 UTC
Hello,

this bug is still present on gcc 3.3 branch and mainline (20030524).

Dara
Comment 3 Andrew Pinski 2003-05-26 20:48:04 UTC
See Dara's comment.
Comment 4 or.poran 2003-05-27 06:21:25 UTC
Subject: RE:  [arc-7-elf] the interrupt handler does not 
	return properly, uses j.d insted of j.d.f

It's extremely easy to solve this bug, I patched the version I have, see
above comments.

-----Original Message-----
From: pinskia@physics.uc.edu [mailto:gcc-bugzilla@gcc.gnu.org]
Sent: Monday, May 26, 2003 11:48 PM
To: Poran, Or
Subject: [Bug target/8973] [arc-7-elf] the interupt handler does not return
properly, uses j.d insted of j.d.f


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia@physics.uc.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-05-26 20:48:04
               date|                            |


------- Additional Comments From pinskia@physics.uc.edu  2003-05-26 20:48
-------
See Dara's comment.



------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
Comment 5 Dara Hazeghi 2003-05-27 06:52:50 UTC
Hello,

I'm not sure if you simply didn't respond correctly, or Bugzilla is being stupid, but your followup 
did not appear here (in the bug report). Can you please resend it? Entering it through the comment 
field should work fine too... Thanks,

Dara
Comment 6 or.poran 2003-05-27 08:22:15 UTC
It's extremely easy to solve this bug, I patched the version I have, see
above comments.
Comment 7 Dara Hazeghi 2003-05-31 07:56:36 UTC
Thanks for the comment and the patch. Would it be possible for you to create the patch using the 
diff utility (using the -u option) and post the resulting patch to the gcc-patches mailing list? The 
problem is that there is no one officially responsible for the arc port (no maintainer), so fixes are 
dealt with in a rather ad hoc manner, unless posted to gcc-patches... Thanks,

Dara
Comment 8 Nathanael C. Nerode 2003-07-09 22:27:48 UTC
Suspending until ARC gets a maintainer.  At the moment, there appears to be nobody both * willing to patch arc and * able to do it correctly.
Comment 9 Saurabh Verma 2005-06-10 08:50:15 UTC
Posted the patch on gcc-patches:
http://gcc.gnu.org/ml/gcc-patches/2005-06/msg00951.html

Cannot commit/change bug status, since i don't have the required permissions
Comment 10 Saurabh Verma 2005-06-10 18:29:48 UTC
Marking as waiting for feedback (See patch link above)
Comment 11 Giovanni Bajo 2005-06-10 18:32:28 UTC
No that's wrong. WAITING means waiting feedback *from submitter*.
Comment 12 Ramana Radhakrishnan 2005-07-27 10:20:24 UTC
(In reply to comment #11)
> No that's wrong. WAITING means waiting feedback *from submitter*.


This has been approved at : 

http://gcc.gnu.org/ml/gcc-patches/2005-06/msg01918.html

Can this be committed into 3.4.5 as well as mainline ? 
Comment 13 Andrew Pinski 2005-09-06 22:29:38 UTC
Fixed on the mainline for 4.1.0.
Comment 14 GCC Commits 2005-09-06 22:29:56 UTC
Subject: Bug 8973

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2005-09-06 22:29:46

Modified files:
	gcc            : ChangeLog 
	gcc/config/arc : arc.c 

Log message:
	2005-09-06  Saurabh Verma  <saurabh.verma@codito.com>
	
	PR target/8973
	* config/arc/arc.c (arc_output_function_epilogue): Update flags while
	returning from an interrupt handler.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9909&r2=2.9910
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arc/arc.c.diff?cvsroot=gcc&r1=1.74&r2=1.75