From patchwork Wed Jul 13 08:28:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 104491 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 93CDDB6F7A for ; Wed, 13 Jul 2011 18:28:50 +1000 (EST) Received: (qmail 13033 invoked by alias); 13 Jul 2011 08:28:49 -0000 Received: (qmail 13025 invoked by uid 22791); 13 Jul 2011 08:28:48 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL, BAYES_00, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jul 2011 08:28:16 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id EE78A8BB22; Wed, 13 Jul 2011 10:28:14 +0200 (CEST) Date: Wed, 13 Jul 2011 10:28:14 +0200 (CEST) From: Richard Guenther To: Ulrich Weigand Cc: Michael Matz , gcc-patches@gcc.gnu.org Subject: Re: Build failure (Re: [PATCH] Make VRP optimize useless conversions) In-Reply-To: <201107121741.p6CHfi8H029280@d06av02.portsmouth.uk.ibm.com> Message-ID: References: <201107121741.p6CHfi8H029280@d06av02.portsmouth.uk.ibm.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 On Tue, 12 Jul 2011, Ulrich Weigand wrote: > Richard Guenther wrote: > > > 2011-07-11 Richard Guenther > > > > * tree-vrp.c (simplify_conversion_using_ranges): Manually > > translate the source value-range through the conversion chain. > > This causes a build failure in cachemgr.c on spu-elf. A slightly > modified simplified test case also fails on i386-linux: > > void * > test (unsigned long long x, unsigned long long y) > { > return (void *) (unsigned int) (x / y); > } > > compiled with -O2 results in: > > test.i: In function 'test': > test.i:3:1: error: invalid types in nop conversion > void * > long long unsigned int > D.1962_5 = (void *) D.1963_3; > > test.i:3:1: internal compiler error: verify_gimple failed > > Any thoughts? Fix in testing. Richard. 2011-07-13 Richard Guenther * tree-vrp.c (simplify_conversion_using_ranges): Make sure the final type is integral. * gcc.dg/torture/20110713-1.c: New testcase. Index: gcc/tree-vrp.c =================================================================== --- gcc/tree-vrp.c (revision 176224) +++ gcc/tree-vrp.c (working copy) @@ -7353,6 +7353,8 @@ simplify_conversion_using_ranges (gimple double_int innermin, innermax, middlemin, middlemax; finaltype = TREE_TYPE (gimple_assign_lhs (stmt)); + if (!INTEGRAL_TYPE_P (finaltype)) + return false; middleop = gimple_assign_rhs1 (stmt); def_stmt = SSA_NAME_DEF_STMT (middleop); if (!is_gimple_assign (def_stmt) Index: gcc/testsuite/gcc.dg/torture/20110713-1.c =================================================================== --- gcc/testsuite/gcc.dg/torture/20110713-1.c (revision 0) +++ gcc/testsuite/gcc.dg/torture/20110713-1.c (revision 0) @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ilp32 } */ + +void * +test (unsigned long long x, unsigned long long y) +{ + return (void *) (unsigned int) (x / y); +}