From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 869 invoked by alias); 15 Jun 2008 15:49:47 -0000 Received: (qmail 861 invoked by uid 22791); 15 Jun 2008 15:49:47 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 15 Jun 2008 15:49:22 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id m5FFkscX130304 for ; Sun, 15 Jun 2008 15:46:54 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m5FFksOI2969670 for ; Sun, 15 Jun 2008 17:46:54 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m5FFksif018982 for ; Sun, 15 Jun 2008 17:46:54 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m5FFksow018979 for ; Sun, 15 Jun 2008 17:46:54 +0200 Message-Id: <200806151546.m5FFksow018979@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sun, 15 Jun 2008 17:46:54 +0200 Subject: [PATCH] Fix ICE in simplify_immed_subreg on SPU To: gcc-patches@gcc.gnu.org Date: Sun, 15 Jun 2008 15:53:00 -0000 From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg00966.txt.bz2 Hello, the test cases for PR 34856 ICE on SPU because simplify_subreg is called on a CONST_VECTOR RTX of the form: (const_vector:V4SI [ (const:SI (plus:SI (symbol_ref:SI ("g") [flags 0x40] ) (const_int 32 [0x20]))) (const_int 0 [0x0]) (const_int 0 [0x0]) (const_int 0 [0x0]) ]) and everything but CONST_INT, CONST_DOUBLE or CONST_FIXED within a CONST_VECTOR leads to an ICE in simplify_immed_subreg. It seems to me that having an address constant like the above appear within a CONST_VECTOR should be OK -- it just cannot be simplified by simplify_immed_subreg so that function should return NULL_RTX. The patch below implements this. Tested on spu-elf with no regressions, fixing the following test suite FAILs: FAIL: gcc.c-torture/compile/pr34856.c -O2 (internal compiler error) FAIL: gcc.c-torture/compile/pr34856.c -O2 (test for excess errors) FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer (internal compiler error) FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer (test for excess errors) FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer -funroll-loops (internal compiler error) FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer -funroll-loops (test for excess errors) FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions (internal compiler error) FAIL: gcc.c-torture/compile/pr34856.c -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions (test for excess errors) FAIL: gcc.c-torture/compile/pr34856.c -O3 -g (internal compiler error) FAIL: gcc.c-torture/compile/pr34856.c -O3 -g (test for excess errors) FAIL: gcc.c-torture/compile/pr34856.c -Os (internal compiler error) FAIL: gcc.c-torture/compile/pr34856.c -Os (test for excess errors) FAIL: gcc.dg/pr34856.c (internal compiler error) FAIL: gcc.dg/pr34856.c (test for excess errors) OK for mainline and 4.3 branch? Bye, Ulrich ChangeLog: * simplify-rtx.c (simplify_immed_subreg): Do not ICE when seeing a CONST_VECTOR with an address constant as element. Index: gcc/simplify-rtx.c =================================================================== *** gcc/simplify-rtx.c (revision 136680) --- gcc/simplify-rtx.c (working copy) *************** simplify_immed_subreg (enum machine_mode *** 4792,4798 **** *vp++ = 0; } break; ! default: gcc_unreachable (); } --- 4792,4804 ---- *vp++ = 0; } break; ! ! case CONST: ! case SYMBOL_REF: ! case LABEL_REF: ! /* We cannot decompose an address constant. */ ! return NULL_RTX; ! default: gcc_unreachable (); } -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com