From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8770 invoked by alias); 12 Jan 2012 10:49:06 -0000 Received: (qmail 8760 invoked by uid 22791); 12 Jan 2012 10:49:05 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Jan 2012 10:48:53 +0000 From: "irar at il dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/51799] [4.7 Regression] Compiler ICE in vect_is_simple_use_1 Date: Thu, 12 Jan 2012 10:49:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: irar at il dot ibm.com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: irar at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: Status CC AssignedTo Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-01/txt/msg01362.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51799 Ira Rosen changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |irar at il dot ibm.com AssignedTo|unassigned at gcc dot |irar at gcc dot gnu.org |gnu.org | --- Comment #4 from Ira Rosen 2012-01-12 10:48:11 UTC --- This is actually the same problem as in pr 51301, and the fix of 51301 looks incomplete: we want an over-promoted sequence to end with type demotion operation, so we need to check that properly: Index: tree-vect-patterns.c =================================================================== --- tree-vect-patterns.c (revision 182840) +++ tree-vect-patterns.c (working copy) @@ -1186,13 +1186,15 @@ { use_lhs = gimple_assign_lhs (use_stmt); use_type = TREE_TYPE (use_lhs); - /* Support only type promotion or signedess change. Check that USE_TYPE - is not bigger than the original type. */ + /* Support only type demotion or signedess change. */ if (!INTEGRAL_TYPE_P (use_type) - || TYPE_PRECISION (new_type) > TYPE_PRECISION (use_type) - || TYPE_PRECISION (type) < TYPE_PRECISION (use_type)) + || TYPE_PRECISION (type) <= TYPE_PRECISION (use_type)) return NULL; + /* Check that NEW_TYPE is not bigger than the conversion result. */ + if (TYPE_PRECISION (new_type) > TYPE_PRECISION (use_type)) + return NULL; + if (TYPE_UNSIGNED (new_type) != TYPE_UNSIGNED (use_type) || TYPE_PRECISION (new_type) != TYPE_PRECISION (use_type)) { I am going to test this patch.