This code: $ cat s_fmax.i double __fmax (double x, double y) { return (__builtin_isgreaterequal(x, y) || (sizeof (y) == sizeof (float) ? __isnanf (y) : __isnan (y))) ? x : y; } crashes an arm-linux compiler when invoked as: $ ./cc1 -O2 ~/s_fmax.i __fmax Analyzing compilation unit Performing intraprocedural optimizations Assembling functions: __fmax /home/pblundel/s_fmax.i: In function `__fmax': /home/pblundel/s_fmax.i:5: internal compiler error: in elim_reg_cond, at flow.c:3257 Please submit a full bug report, with preprocessed source if appropriate. Send email to arm-gcc@codesourcery.com for instructions.
This bug exists in the 3.3 branch (and the trunk) as well as the 3.4 branch.
Confirmed (on 3.4 branch).
*** Bug 15297 has been marked as a duplicate of this bug. ***
I have had the same problem with GCC 3.2.3 (as well as 3.3.3 and 3.4.0), building a native arm compiler. I don't know anything substantial about GCC internals, so please excuse if this comment is totally worthless...but: In a cursory look at elim_reg_cond, it looked to me as though the function was encountering an unexpected rtx code. So I checked, and found that when the ICE is encountered it's because elim_reg_cond is called with an rtx with code 0 (UNKNOWN). So in an effort to work around the problem, I modified elim_reg_cond so that instead of calling abort() it simply returns the original rtx, and as far as I can tell that does seem to work. (At least, when I ran the test suites for the glibc I built with this workaround, the tests for the relevant functions all passed.)
Subject: Re: ICE in elim_reg_cond On Wed, 2004-07-21 at 02:38, random at rnd dot cx wrote: > So in an effort to work around the problem, I modified elim_reg_cond so that > instead of calling abort() it simply returns the original rtx, and as far as I > can tell that does seem to work. No, that's incorrect. R.
Subject: Bug 15068 CVSROOT: /cvs/gcc Module name: gcc Changes by: pbrook@gcc.gnu.org 2004-08-02 13:19:41 Modified files: gcc : ChangeLog flow.c Log message: PR rtl-optimization/15068 * flow.c (init_propagate_block_info): Check condition is reversible. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4763&r2=2.4764 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&r1=1.593&r2=1.594
Subject: Bug 15068 CVSROOT: /cvs/gcc Module name: gcc Branch: csl-arm-branch Changes by: pbrook@gcc.gnu.org 2004-08-02 13:57:06 Modified files: gcc : ChangeLog flow.c Log message: PR rtl-optimization/15068 * flow.c (init_propagate_block_info): Check condition is reversible. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=2.1568.2.81&r2=2.1568.2.82 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.563.4.2&r2=1.563.4.3
Fixed in 3.5.0.
*** Bug 20129 has been marked as a duplicate of this bug. ***
*** Bug 21710 has been marked as a duplicate of this bug. ***
(In reply to comment #10) > *** Bug 21710 has been marked as a duplicate of this bug. *** Is there any patch of it for gcc-3.3.6.
Subject: Re: ICE in elim_reg_cond On Wed, 2005-06-15 at 15:59, xuguangyi at ee dot buaa dot edu dot cn wrote: > ------- Additional Comments From xuguangyi at ee dot buaa dot edu dot cn 2005-06-15 14:59 ------- > (In reply to comment #10) > > *** Bug 21710 has been marked as a duplicate of this bug. *** > > > Is there any patch of it for gcc-3.3.6. > No. The code that was fixed was not in gcc-3.3. R.
Any patch for gcc-3.4.6?
(In reply to comment #13) > Any patch for gcc-3.4.6? No, just use 4.1.0 or 4.0.2 instead.
(In reply to comment #13) > Any patch for gcc-3.4.6? > Yes, use the patch shown earlier in this thread, or the equivalent one provided by crosstool.