Bug 28132

Summary: [4.1 Regression] ICE instantiate_virtual_regs_in_insn when -fforce-addr -O1 used
Product: gcc Reporter: Mike Frysinger <vapier>
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, jakub, janis, mark, toolchain
Priority: P2 Keywords: ice-on-valid-code
Version: 4.1.1   
Target Milestone: 4.2.0   
Host: i686-linux-gnu Target: i686-linux-gnu
Build: Known to work: 4.0.3 4.2.0
Known to fail: 4.1.0 4.1.1 Last reconfirmed: 2006-10-18 09:49:17
Attachments: jsmath.i

Description Mike Frysinger 2006-06-22 00:07:52 UTC
building spidermonkey-1.5 with -O1 -fforce-addr with gcc-4.1.1 and gcc ICEs:
jsmath.c: In function 'math_round':
jsmath.c:394: error: unrecognizable insn:
(insn 61 93 62 4 (parallel [
            (set (mem/i:DF (reg/f:SI 95) [0 S8 A32])
                (neg:DF (mem/i:DF (reg/f:SI 96) [0 S8 A32])))
            (use (const_int 0 [0x0]))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil)
    (nil))
jsmath.c:394: internal compiler error: in instantiate_virtual_regs_in_insn, at
function.c:1555

this sort of looks like PR23196, but that is fixed in my 4.1.1

verified on Gentoo and Debian
Comment 1 Mike Frysinger 2006-06-22 00:08:25 UTC
Created attachment 11725 [details]
jsmath.i
Comment 2 Richard Biener 2006-06-22 09:26:22 UTC
Confirmed.  Requires -O -fforce-addr -march=i686.

void math_round()
{
        double x;
        foo(x, __builtin_copysign(bar(), x));
}

works on the mainline.
Comment 3 Andrew Pinski 2006-08-09 18:16:03 UTC
*** Bug 28667 has been marked as a duplicate of this bug. ***
Comment 4 Richard Biener 2006-10-18 09:49:17 UTC
I wonder what fixed this on the mainline - janis?
Comment 5 Janis Johnson 2006-10-18 21:20:20 UTC
A regression hunt using the testcase and options from comment #2 with an i686-linux cross compiler identified the following patch which fixed the bug on mainline:

    http://gcc.gnu.org/viewcvs?view=rev&rev=114293

    r114293 | sayle | 2006-06-01 01:37:17 +0000 (Thu, 01 Jun 2006)
Comment 6 Mark Mitchell 2006-11-01 18:11:21 UTC
P2, rather than P1, due to use of relatively obscure command-line option. 
Comment 7 Mark Loeser 2007-12-03 02:49:37 UTC
r125879 | jakub | 2007-06-20 02:50:23 -0400 (Wed, 20 Jun 2007) | 6 lines

        PR middle-end/32285
        * calls.c (precompute_arguments): Also precompute CALL_EXPR arguments
        if ACCUMULATE_OUTGOING_ARGS.

        * gcc.c-torture/execute/20070614-1.c: New test.

on the gcc-4.1 branch made this go away.  unsure if it is a real fix, or not though.
Comment 8 Joseph S. Myers 2008-07-04 15:38:08 UTC
Closing 4.1 branch.  Not updating known-to-fail since logs suggest it might in fact be fixed there.