From patchwork Thu Sep 2 21:45:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 63561 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 2EC16B7189 for ; Fri, 3 Sep 2010 07:45:26 +1000 (EST) Received: (qmail 11145 invoked by alias); 2 Sep 2010 21:45:18 -0000 Received: (qmail 10940 invoked by uid 22791); 2 Sep 2010 21:45:16 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Sep 2010 21:45:11 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o82Lj9Yd010547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 Sep 2010 17:45:10 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o82Lj8UW019239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 2 Sep 2010 17:45:09 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id o82LjIrf017617 for ; Thu, 2 Sep 2010 23:45:18 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id o82LjIvB017616 for gcc-patches@gcc.gnu.org; Thu, 2 Sep 2010 23:45:18 +0200 Date: Thu, 2 Sep 2010 23:45:18 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix up ICE in rtl_decl_for_init (PR debug/45500) Message-ID: <20100902214518.GX1269@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! TYPE_MODE of a generic vector isn't necessarily BLKmode, it can be some integer mode too (vector_type_mode /* For integers, try mapping it to a same-sized scalar mode. */ hunk), but expand_expr handles VECTOR_CST with non-VECTOR_MODE_P mode always the same, but forcing the initializer into memory, which rtl_for_decl_init obviously doesn't want and asserts it doesn't happen. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/4.5? 2010-09-02 Jakub Jelinek PR debug/45500 * dwarf2out.c (rtl_for_decl_init): Give up for all generic vectors, not just generic vectors with BLKmode. * gcc.target/i386/pr45500.c: New test. Jakub --- gcc/dwarf2out.c.jj 2010-08-31 15:39:16.000000000 +0200 +++ gcc/dwarf2out.c 2010-09-02 19:20:15.213521284 +0200 @@ -16256,7 +16256,8 @@ rtl_for_decl_init (tree init, tree type) ; /* Vectors only work if their mode is supported by the target. FIXME: generic vectors ought to work too. */ - else if (TREE_CODE (type) == VECTOR_TYPE && TYPE_MODE (type) == BLKmode) + else if (TREE_CODE (type) == VECTOR_TYPE + && !VECTOR_MODE_P (TYPE_MODE (type))) ; /* If the initializer is something that we know will expand into an immediate RTL constant, expand it now. We must be careful not to --- gcc/testsuite/gcc.target/i386/pr45500.c.jj 2010-09-02 19:14:47.746364347 +0200 +++ gcc/testsuite/gcc.target/i386/pr45500.c 2010-09-02 19:14:06.000000000 +0200 @@ -0,0 +1,6 @@ +/* PR debug/45500 */ +/* { dg-do compile } */ +/* { dg-options "-g -msse" } */ + +typedef char V __attribute__ ((__vector_size__ (16))); +static const V s = { '\n', '\r', '?', '\\' };