From patchwork Wed Feb 8 17:11:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 140183 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 4FB3FB71AE for ; Thu, 9 Feb 2012 04:11:59 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1329325919; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=Io8TDMb/PObf8HFNmV6NjogDt5w=; b=nAsSkj+50bETb3I s+cRPapkB3D8QPNvOJ/xmzVoRxUg3BcVOz3GiaF1+N+jMZHTL6oOwffmb/3zkOqK WFQBG9X6L9sw6et9V1CHuwhD1uzKWEupC90YY5FmXLnBSQH0JQjWT08OeqsHycS6 IdEWsGAOiO52yZS38GSQk0z4zKQM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=rFklHgn7BNaQ+6p3mAupBO8b6jru+5pWi/odKzSKp9RNwl/h+CJpmtzOuOY+zN dDnOLHdMRTz8BcS2n0zXmzbOXXMewDKPbHd5vn/4xKmZhJkwWgdNTwPwAEVIUrma jz578ttmKSdWze5kP82zExNKwpn74dYbM0DBiuoMycZDA=; Received: (qmail 14949 invoked by alias); 8 Feb 2012 17:11:51 -0000 Received: (qmail 14931 invoked by uid 22791); 8 Feb 2012 17:11:47 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Feb 2012 17:11:26 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id 38437400007; Wed, 8 Feb 2012 12:11:26 -0500 (EST) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id q18HBOUY003630; Wed, 8 Feb 2012 12:11:24 -0500 Date: Wed, 8 Feb 2012 12:11:23 -0500 From: Jack Howarth To: gcc-patches@gcc.gnu.org Cc: rguenther@suse.de, baldrick@free.fr Subject: [PATCH} backport r175475 to gcc-4_6-branch Message-ID: <20120208171123.GA3628@bromo.med.uc.edu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 Currently PR49536 still exists in gcc-4_6-branch. The following patch backports r175475 for the gcc 4.6.3 release. This will be helpful to dragonegg users (http://llvm.org/bugs/show_bug.cgi?id=10042) as dragonegg currently doesn't build against FSF gcc trunk yet. Regression tested on x86_64-apple-darwin11... http://gcc.gnu.org/ml/gcc-testresults/2012-02/msg00599.html Okay for gcc-4_6-branch and thus gcc 4.6.3? Jack 2012-02-08 Jack Howarth Backport from mainline 2011-06-27 Richard Guenther PR tree-optimization/49536 * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): For non-scalar inner types use a scalar type according to the scalar inner mode. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 183938) +++ gcc/tree-vect-stmts.c (working copy) @@ -5117,6 +5117,15 @@ get_vectype_for_scalar_type_and_size (tr && GET_MODE_CLASS (inner_mode) != MODE_FLOAT) return NULL_TREE; + /* We shouldn't end up building VECTOR_TYPEs of non-scalar components. + When the component mode passes the above test simply use a type + corresponding to that mode. The theory is that any use that + would cause problems with this will disable vectorization anyway. */ + if (!SCALAR_FLOAT_TYPE_P (scalar_type) + && !INTEGRAL_TYPE_P (scalar_type) + && !POINTER_TYPE_P (scalar_type)) + scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1); + /* If no size was supplied use the mode the target prefers. Otherwise lookup a vector mode of the specified size. */ if (size == 0)