Bug 21613 - -fpic only: internal compiler error: in extract_insn, at recog.c:2083 (20010107-1.c:6)
Summary: -fpic only: internal compiler error: in extract_insn, at recog.c:2083 (200101...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.1
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-17 03:02 UTC by Flash Sheridan
Modified: 2005-08-11 23:12 UTC (History)
1 user (show)

See Also:
Host: i686-host_pc-linux-gnu
Target: arm-softfloat-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Pre-processed source (130 bytes, text/plain)
2005-05-17 19:28 UTC, Flash Sheridan
Details
-v -save-temps output (965 bytes, text/plain)
2005-05-17 19:29 UTC, Flash Sheridan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Flash Sheridan 2005-05-17 03:02:53 UTC
The following gives "internal compiler error: in extract_insn, at recog.c:2083", only with -fpic: 

    arm-softfloat-linux-gnu-g++ -fpic   ../c/noerror/GPL/20010107-1.c

20010107-1.c is a C Torture file, containing only the following:

    unsigned long x[4];
    void foo(void)
    {
      ((void (*)())(x+2))();
    }


This sounds similar to 19960 (darwin/m6811-elf) and 19770 (hppa64/hppa64).
I'll attach the preprocessed file (though it's hardly necessary, since there are no #includes), and the -v 
-savetemps output.

Here's the full error message:

../c/noerror/GPL/20010107-1.c: In function `void foo()':
../c/noerror/GPL/20010107-1.c:6: error: unrecognizable insn:
(call_insn 14 13 16 0 (parallel [
            (call (mem:SI (plus:SI (reg/f:SI 68)
                        (const_int 8 [0x8])) [0 S4 A32])
                (const_int 0 [0x0]))
            (use (const_int 0 [0x0]))
            (clobber (reg:SI 14 lr))
        ]) -1 (nil)
    (expr_list:REG_DEAD (reg/f:SI 68)
        (expr_list:REG_UNUSED (reg:SI 14 lr)
            (nil)))
    (nil))
../c/noerror/GPL/20010107-1.c:6: internal compiler error: in extract_insn, at recog.c:2083


---
Flash Sheridan
flash@pobox.com
Quality Lead for Compilers and Debuggers
PalmSource, Inc. Tools Quality Management
Comment 1 Flash Sheridan 2005-05-17 19:28:37 UTC
Created attachment 8914 [details]
Pre-processed source
Comment 2 Flash Sheridan 2005-05-17 19:29:48 UTC
Created attachment 8915 [details]
-v -save-temps output
Comment 3 Flash Sheridan 2005-07-14 23:46:37 UTC
PalmSource bug #104818.
Comment 4 Richard Earnshaw 2005-08-11 23:12:37 UTC
Fixed in mainline by the introduction of tree-ssa.  Creating a fix for 3.4 would
be very difficult and, given the rarity of this problem and the availibility of
a workaround (below), I see no point in trying to fix this.

The work-around is to declare a function variable and assign x+2 to that
variable.  The fuction variable can then be called without problems.  So
test-case can be re-expressed as:

    unsigned long x[4];
    void foo(void)
    {
      void (*f)() = (void(*)())(x + 2);
      f();
    }

which then compiles without error.