User account creation filtered due to spam.

Bug 21169 - [4.0 regression] ICE in reload_cse_simplify_operands with -fnon-call-exceptions -fPIC -O2
Summary: [4.0 regression] ICE in reload_cse_simplify_operands with -fnon-call-exceptio...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, ssemmx
Depends on:
Blocks:
 
Reported: 2005-04-23 01:32 UTC by nick
Modified: 2007-01-21 21:57 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-*-linux-gnu
Build:
Known to work: 4.1.0 4.1.1 4.1.2 3.4.3
Known to fail: 4.0.0
Last reconfirmed: 2005-12-27 00:35:45


Attachments
proposed patch (5.77 KB, patch)
2006-02-06 16:51 UTC, Dinar Temirbulatov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nick 2005-04-23 01:32:22 UTC
The following code compiles successfully under gcc-3.4.3 on amd64:

> cat bug.C 
float foo();

int _numTransitions;
int _offset;

void
bar(int &base)
{
    float tmp = foo();
    tmp -= (float)_offset;
    if (tmp < 0.0) tmp = 0.0;
    if (tmp > (float)(_numTransitions-1))
        tmp = (float)(_numTransitions-1);
    base = (int) tmp;
}


> /dept/rnd/vendor/gcc-4.0.0-amd64/bin/g++ -fnon-call-exceptions -fPIC -O2 -c
bug.C -o /dev/null
bug.C: In function 'void bar(int&)':
bug.C:15: error: insn does not satisfy its constraints:
(insn 67 35 36 0 (set (reg:SF 24 xmm3)
        (lt:SF (reg/v:SF 22 xmm1 [orig:60 tmp ] [60])
            (reg:SF 23 xmm2 [65]))) 487 {*sse_setccsf} (nil)
    (nil))
bug.C:15: internal compiler error: in reload_cse_simplify_operands, at
postreload.c:391
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


> /dept/rnd/vendor/gcc-4.0.0-amd64/bin/g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.0.0/configure
--prefix=/dept/rnd/vendor/gcc-4.0.0-amd64 --enable-threads --enable-languages=c,c++
Thread model: posix
gcc version 4.0.0
Comment 1 Andrew Pinski 2005-04-23 14:35:36 UTC
Confirmed.
Comment 2 Andrew Pinski 2005-06-26 17:39:25 UTC
Fixed at least on the mainline.
Comment 3 Mark Mitchell 2005-07-06 17:02:50 UTC
Postponed until 4.0.2.
Comment 4 Paolo Bonzini 2005-08-29 14:55:57 UTC
Can anybody do a regression hunt on mainline?
Comment 5 Dinar Temirbulatov 2006-02-01 11:01:39 UTC
no such regression on mainline 

$ ./gcc-exec/bin/x86_64-unknown-linux-gnu-g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-20051026/configure --target=x86_64-unknown-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/home/dinar/work/fsfbugz/21169/gcc-exec/ --disable-multilib --with-sysroot=/home/dinar/work/gnu/tools/gcc-4.0.2-20060112-glibc-2.3.5/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sys-root --with-local-prefix=/home/dinar/work/gnu/tools/gcc-4.0.2-20060112-glibc-2.3.5/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.1.0 20051026 (experimental)
Comment 6 Dinar Temirbulatov 2006-02-06 16:51:05 UTC
Created attachment 10787 [details]
proposed patch

>Can anybody do a regression hunt on mainline?
I found original fix on the mainline. it is 

2005-04-12  Richard Henderson  <rth@redhat.com>

       * config/i386/i386.c (ix86_prepare_sse_fp_compare_args): Split ...
       (ix86_expand_sse_fp_minmax): ... from ... 
       (ix86_expand_fp_movcc): ... here.
       (ix86_expand_sse_movcc): Rewrite from ix86_split_sse_movcc.
       * config/i386/i386-protos.h: Update.
       * config/i386/i386.md (UNSPEC_IEEE_MIN, UNSPEC_IEEE_MAX): New.
       (sse_setccsf, sse_setccdf): Allow before reload.
       (movsfcc_1_sse_min, movsfcc_1_sse_max, movsfcc_1_sse): Remove.
       (movdfcc_1_sse_min, movdfcc_1_sse_max, movdfcc_1_sse): Remove.
       (ieee_sminsf3, ieee_smaxsf3, ieee_smindf3, ieee_smaxdf3): New.
       * config/i386/sse.md (andsf3, nandsf3, iorsf3, xorsf3): New.
       (anddf3, nanddf3, iordf3, xordf3): New.

Attached patch was tested for i686-pc-linux-gnu and  x86_64-unknown-linux-gnu 
including make check-gcc.
Comment 7 Dinar Temirbulatov 2006-02-14 11:46:51 UTC
Comment on attachment 10787 [details]
proposed patch

I have noticed a few regressions with that patch on x86_86.
Comment 8 Dinar Temirbulatov 2006-03-10 02:25:40 UTC
>I have noticed a few regressions with that patch on x86_86.
those regressions were due to a linux kernel problem, retested on x86_86 target and no regressions observed
Comment 9 Dinar Temirbulatov 2006-03-10 02:31:27 UTC
s/retested on x86_86/retested on another x86_86
Comment 10 Gabriel Dos Reis 2007-01-18 03:46:42 UTC
won't fix for GCC-4.0.x.
Comment 11 Andrew Pinski 2007-01-21 21:57:25 UTC
Fixed.