From d03efd2a58a0a2eda9f8ffbfd0cea59aecdffd29 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Mon, 29 Sep 2014 16:40:10 +0000 Subject: [PATCH] Fix ICE. Fix ICE. Need use VOID instead of SI, or when real VOIDmode comes, it does not match SImode, so cause issue. 2014-09-25 Chen Gang gcc: * config/microblaze/microblaze.md (call_internal1): Use VOID instead of SI to fix "((void (*)(void)) 0)()" issue gcc/testsuite: * gcc.c-torture/compile/calls-void.c: New test. From-SVN: r215684 --- gcc/ChangeLog | 5 ++++ gcc/config/microblaze/microblaze.md | 2 +- gcc/testsuite/ChangeLog | 4 ++++ .../gcc.c-torture/compile/calls-void.c | 23 +++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/calls-void.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c820e942af..acc3688ce66 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-09-29 Chen Gang + + * config/microblaze/microblaze.md (call_internal1): Use VOID + instead of SI to fix "((void (*)(void)) 0)()" issue + 2014-09-29 Nick Clifton * config/msp430/msp430.c (msp430_expand_prologue): Return a diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md index b971737118a..3b4faf48388 100644 --- a/gcc/config/microblaze/microblaze.md +++ b/gcc/config/microblaze/microblaze.md @@ -2062,7 +2062,7 @@ (set_attr "length" "4")]) (define_insn "call_internal1" - [(call (mem (match_operand:SI 0 "call_insn_simple_operand" "ri")) + [(call (mem (match_operand:VOID 0 "call_insn_simple_operand" "ri")) (match_operand:SI 1 "" "i")) (clobber (reg:SI R_SR))] "" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 925adf80205..9b709f58cb0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-09-29 Chen Gang + + * gcc.c-torture/compile/calls-void.c: New test. + 2014-09-29 Paolo Carlini PR c++/51385 diff --git a/gcc/testsuite/gcc.c-torture/compile/calls-void.c b/gcc/testsuite/gcc.c-torture/compile/calls-void.c new file mode 100644 index 00000000000..a8dacd79704 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/calls-void.c @@ -0,0 +1,23 @@ +/* { dg-require-effective-target ptr32plus } */ +typedef void (*T)(void); +f1 () +{ + ((T) 0)(); +} +f2 () +{ + ((T) 1000)(); +} +f3 () +{ + ((T) 10000000)(); +} +f4 (r) +{ + ((T) r)(); +} +f5 () +{ + int (*r)() = f3; + ((T) r)(); +} -- 2.30.2