From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4895 invoked by alias); 19 Aug 2002 07:26:08 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 4875 invoked by uid 71); 19 Aug 2002 07:26:07 -0000 Resent-Date: 19 Aug 2002 07:26:07 -0000 Resent-Message-ID: <20020819072607.4874.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, jbuhler@cs.wustl.edu Received: (qmail 4551 invoked from network); 19 Aug 2002 07:23:41 -0000 Received: from unknown (HELO guanyin.localdomain) (66.137.206.225) by sources.redhat.com with SMTP; 19 Aug 2002 07:23:41 -0000 Received: (qmail 19672 invoked by uid 501); 19 Aug 2002 07:23:40 -0000 Message-Id: <20020819072340.19671.qmail@guanyin.localdomain> Date: Mon, 19 Aug 2002 02:16:00 -0000 From: jbuhler@cs.wustl.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: optimization/7630: ICE's compiling Mozilla 1.0 with -march=pentium4 X-SW-Source: 2002-08/txt/msg00371.txt.bz2 List-Id: >Number: 7630 >Category: optimization >Synopsis: gcc 3.2 breaks on Mozilla 1.0's JS sources with -march=pentium4 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Mon Aug 19 00:26:06 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Jeremy Buhler >Release: 3.2 >Organization: Washington University in St. Louis >Environment: System: Linux guanyin 2.4.19 #2 Fri Aug 2 21:50:19 CDT 2002 i686 unknown Architecture: i686 (Pentium 4) host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc-3.2/configure --prefix=/usr/local/gcc-3.2 --enable-languages=c,c++,f77 --enable-__cxa_atexit >Description: I attempted to compile Mozilla 1.0 with gcc 3.2 using the options '-O -march=pentium4'. The compile crashes with ICE's on multiple files in the js/src directory (the Javascript implementation). Compiling with -march=pentium3 does not exhibit the problem, nor does compiling without optimization. The ICE's are of the form "unable to find a register to spill in class GENERAL_REGS" and appear to be related to the use of the Pentium 4's SSE instructions. See next section for a specific, cut-down example. >How-To-Repeat: Build the following code "foo.cc" with options gcc -c -fPIC -O -march=pentium4 foo.c (both -O and -fPIC are required to trigger the ICE). This code is cut down from Mozilla 1.0's src/js/jsparse.c. It's got an uninitialized variable, though I don't believe the original source had one (initializing 'd' removes the ICE). Other ICE's happen in jsinterp.c and jsdtoa.c, but these files contain really huge functions that are much harder to trace. typedef union { double value; struct { unsigned int lsw; unsigned int msw; } parts; } js_ieee_double_shape_type; #define JSDOUBLE_HI32(x) ({js_ieee_double_shape_type sh_u; \ sh_u.value = (x); \ sh_u.parts.msw; }) enum JSOp {JSOP_URSH, JSOP_DIV}; struct JSParseNode { enum JSOp pn_op; double dval; }; int js_FoldConstants(struct JSParseNode *pn) { double d; switch (pn->pn_op) { case JSOP_URSH: d = 0; case JSOP_DIV: if (JSDOUBLE_HI32(d) ^ JSDOUBLE_HI32(d)) d = 0; break; default:; } pn->dval = d; return 0; } >Fix: Compile without optimization, or with -march=pentium3 instead of -march=pentium4 >Release-Note: >Audit-Trail: >Unformatted: