From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23896 invoked by alias); 22 Apr 2003 14:46:01 -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 23874 invoked by uid 71); 22 Apr 2003 14:46:00 -0000 Resent-Date: 22 Apr 2003 14:46:00 -0000 Resent-Message-ID: <20030422144600.23873.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, ak03@gte.com Received: (qmail 20005 invoked from network); 22 Apr 2003 14:39:10 -0000 Received: from unknown (HELO h132-197-179-51.gte.com) (132.197.179.51) by sources.redhat.com with SMTP; 22 Apr 2003 14:39:10 -0000 Received: from ork.gte.com (tesb35zoer6yktjq@localhost [127.0.0.1]) by h132-197-179-51.gte.com (8.12.8/8.12.8) with ESMTP id h3MEd2Cb055959; Tue, 22 Apr 2003 10:39:02 -0400 (EDT) (envelope-from ak03@ork.gte.com) Received: (from ak03@localhost) by ork.gte.com (8.12.8/8.12.8/Submit) id h3MEd2la055958; Tue, 22 Apr 2003 10:39:02 -0400 (EDT) Message-Id: <200304221439.h3MEd2la055958@ork.gte.com> Date: Tue, 22 Apr 2003 14:46:00 -0000 From: ak03@gte.com To: gcc-gnats@gcc.gnu.org Cc: pfeifer@dbai.tuwien.ac.at, rittle@latour.rsch.comm.mot.com, obrien@FreeBSD.ORG X-Send-Pr-Version: 3.113 Subject: bootstrap/10453: Regression on FreeBSD/sparc64 X-SW-Source: 2003-04/txt/msg00924.txt.bz2 List-Id: >Number: 10453 >Category: bootstrap >Synopsis: Critical regression on FreeBSD/sparc64, compiler not usable >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Tue Apr 22 14:46:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Alexander N. Kabaev >Release: 3.3 20030421 (prerelease) >Organization: FreeBSD Project >Environment: System: FreeBSD ork.gte.com 4.8-RC FreeBSD 4.8-RC #2: Mon Mar 24 11:00:40 EST 2003 ak03@ork.gte.com:/usr/src/sys/compile/KAN i386 FreeBSD kanpc.gte.com 5.0-CURRENT FreeBSD 5.0-CURRENT #4: Wed Apr 16 18:23:28 EDT 2003 ak03@kanpc.gte.com:/usr/src/sys/i386/compile/KANPC i386 host: i386-portbld-freebsd4.8 build: i386-portbld-freebsd4.8 target: i386-portbld-freebsd4.8 configured with: ./..//gcc-20030421/configure --disable-nls --with-gnu-as --with-gnu-ld --with-gxx-include-dir=/usr/local/lib/gcc-lib/i386-portbld-freebsd4.8/3.3/include/g++-v3 --with-system-zlib --disable-shared --prefix=/usr/local i386-portbld-freebsd4.8 >Description: GCC 3.3 fails to bootstrap on FreeBSD and dies with ICE in expr.c:9408. The reason for failure is quite convoluted: 1) sparc.md file defines mulsidi3 insn expansion which unconditionally calls gen_const_mulsidi3_sp32 insn on non-V8PLUS targets. 2) const_mulsidi3_sp32 INSN has a TARGET_HARD_MUL32 condition. 3) TARGET_HARD_MUL32 condition is a compile time constant on FreeBSD: #define TARGET_HARD_MUL32 \ ((TARGET_V8 || TARGET_SPARCLITE \ || TARGET_SPARCLET || TARGET_DEPRECATED_V8_INSNS) \ && ! TARGET_V8PLUS && TARGET_ARCH32) FreeBSD supports only 64-bit targets, so TARGET_ARCH32 is a compile time constant 0 and '&&' makes the value of the TARGET_HARD_MUL32 constant known at compile time too. 4) Since the value for TARGET_HARD_MUL32 is known at compile time and is 0, the newly added insn-conditions.c file will mark it as not-needed and it will be raplaced with a stub, returning NULL. 5) Unconditional invocation in 1) will return NULL and GCC will die ICE. >How-To-Repeat: Bootstrap the compiler on FreeBSD/sparc64. >Fix: Only call gen_const_mulsidi3_sp32 if TARGET_ARCH32 is true. For 64-bit targets, call gen_const_mulsidi3_sp64 instead. Index: sparc.md =================================================================== RCS file: /usr/ncvs2/src/contrib/gcc/config/sparc/sparc.md,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 sparc.md --- sparc.md 3 Apr 2003 01:53:52 -0000 1.1.1.9 +++ sparc.md 22 Apr 2003 14:20:09 -0000 @@ -5289,9 +5289,12 @@ if (TARGET_V8PLUS) emit_insn (gen_const_mulsidi3_v8plus (operands[0], operands[1], operands[2])); - else + else if (TARGET_ARCH32) emit_insn (gen_const_mulsidi3_sp32 (operands[0], operands[1], operands[2])); + else + emit_insn (gen_const_mulsidi3_sp64 (operands[0], operands[1], + operands[2])); DONE; } if (TARGET_V8PLUS) @@ -5495,8 +5498,11 @@ if (TARGET_V8PLUS) emit_insn (gen_const_umulsidi3_v8plus (operands[0], operands[1], operands[2])); - else + else if (TARGET_ARCH32) emit_insn (gen_const_umulsidi3_sp32 (operands[0], operands[1], + operands[2])); + else + emit_insn (gen_const_umulsidi3_sp64 (operands[0], operands[1], operands[2])); DONE; } >Release-Note: >Audit-Trail: >Unformatted: