[#6018] gcc-4.3 ICEs with {interrupt,exception,nmi}_handler function attributes in copyprop_hardreg_forward_1, at regrename.c:1787
Submitted By: Mike Frysinger
Open Date
2010-05-05 02:17:11 Close Date
2010-07-29 11:20:59
Priority:
Medium High Assignee:
Vivi Li
Steve Kilbane
Board:
N/A Silicon Revision:
Resolution:
Fixed Fixed In Release:
N/A
Processor:
ALL
Host Operating System:
toolchain rev.:
kernel rev.:
State:
Closed Found In Release:
2009R1.1_RC2
Is this bug repeatable?:
yes
Summary: gcc-4.3 ICEs with {interrupt,exception,nmi}_handler function attributes in copyprop_hardreg_forward_1, at regrename.c:1787
Details:
gcc-4.1.2 compiles this code just fine. replacing "nmi" with "interrupt" or "exception" results in same thing.
$ cat test.c
__attribute__((nmi_handler)) void evt_nmi(void) {}
$ bfin-uclinux-gcc test.c -c
test.c: In function ‘evt_nmi’:
test.c:1: error: insn does not satisfy its constraints:
(insn 18 17 19 2 test.c:3 (set (reg:BI 34 CC)
(const_int 1 [0x1])) 12 {movbi} (nil))
test.c:1: internal compiler error: in extract_constrain_insn_cached, at recog.c:1918
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://blackfin.uclinux.org/gf/project/toolchain/tracker> for instructions.
Follow-ups
--- Steve Kilbane 2010-05-28 10:57:24
I believe I have a fix for this. I'll run some tests over the weekend.
Patch:
Index: bfin.md
===================================================================
--- bfin.md (revision 4603)
+++ bfin.md (working copy)
@@ -540,7 +540,7 @@
})
(define_insn "movbi"
- [(set (match_operand:BI 0 "nonimmediate_operand"
"=x,x,d,md,C,d,C,P1")
+ [(set (match_operand:BI 0 "nonimmediate_operand"
"=x,x,d,md,C,d,C,C")
(match_operand:BI 1 "general_operand"
"x,xKs3,md,d,d,C,P0,P1"))]
""
--- Robin Getz 2010-06-05 20:41:13
Works for me.
rgetz@curly:~/tmp$ cat foo.c
__attribute__((nmi_handler)) void evt_nmi(void) {}
__attribute__((interrupt_handler)) void evt_interrupt(void) {}
__attribute__((exception_handler)) void evt_exception(void) {}
rgetz@curly:~/tmp$ ~/blackfin/trunk/gcc-elf/bin/bfin-elf-gcc -mcpu=bf537-0.3
-O2 -g foo.c -c -o foo.o
00000000 <_evt_nmi>:
__attribute__((nmi_handler)) void evt_nmi(void) {}
0: 66 01 [--SP] = ASTAT;
2: 00 e8 00 00 LINK 0x0; /* (0) */
6: 01 e8 00 00 UNLINK;
a: 26 01 ASTAT = [SP++];
c: 13 00 RTN;
...
00000010 <_evt_interrupt>:
__attribute__((interrupt_handler)) void evt_interrupt(void) {}
10: 66 01 [--SP] = ASTAT;
12: 00 e8 00 00 LINK 0x0; /* (0) */
16: 01 e8 00 00 UNLINK;
1a: 26 01 ASTAT = [SP++];
1c: 11 00 RTI;
...
00000020 <_evt_exception>:
__attribute__((exception_handler)) void evt_exception(void) {}
20: a6 6f SP += -0xc; /* (-12) */
22: 66 01 [--SP] = ASTAT;
24: 00 e8 00 00 LINK 0x0; /* (0) */
28: 01 e8 00 00 UNLINK;
2c: 26 01 ASTAT = [SP++];
2e: 66 6c SP += 0xc; /* ( 12) */
30: 12 00 RTX;
Marking as fixed.
Steve: -- you should be able to add something to
gcc-4.3/gcc/testsuite/gcc.target/bfin
to test with the elf compiler:
which has something like:
/* { dg-do compile { target bfin-elf-* } } */
/* { dg-options "-O0" "-O1" "-O2" "-O3"
} */
/* { dg-final { scan-assembler "RTI" } } */
/* { dg-final { scan-assembler "RTE" } } */
/* { dg-final { scan-assembler "RTX" } } */
I think that should to the trick to make sure we notice this if it breaks
again.
Feel free to close things when you add the testcase.
-Robin
--- Sonic Zhang 2010-06-07 04:24:03
Hi Steven,
Can you add a new test case for this bug to test suite under gcc?
--- Steve Kilbane 2010-07-29 04:11:54
Added tests a while back:
hdlr_except-1.c
hdlr_intr-1.c
hdlr_intr-2.c
hdlr_nmi-1.c
--- Mike Frysinger 2010-07-29 11:20:59
sounds good ... thanks !
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found