From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54783 invoked by alias); 8 Jan 2019 13:08:42 -0000 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 Received: (qmail 54772 invoked by uid 89); 8 Jan 2019 13:08:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=proven X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Jan 2019 13:08:41 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF608369A0; Tue, 8 Jan 2019 13:08:39 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 618B81057068; Tue, 8 Jan 2019 13:08:39 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x08D8bq6021850; Tue, 8 Jan 2019 14:08:37 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x08D8ZPp021849; Tue, 8 Jan 2019 14:08:35 +0100 Date: Tue, 08 Jan 2019 13:08:00 -0000 From: Jakub Jelinek To: Martin =?utf-8?B?TGnFoWth?= Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Use proper type in linear transformation in tree-switch-conversion (PR tree-optimization/88753). Message-ID: <20190108130835.GB30353@tucnak> Reply-To: Jakub Jelinek References: <1b7be4a1-525c-101d-d897-76b637fd14b1@suse.cz> <20190108125235.GA30353@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190108125235.GA30353@tucnak> User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00392.txt.bz2 On Tue, Jan 08, 2019 at 01:52:35PM +0100, Jakub Jelinek wrote: > > 2019-01-08 Martin Liska > > > > PR tree-optimization/88753 > > * tree-switch-conversion.c (switch_conversion::build_one_array): > > Come up with local variable constructor. Convert first to > > type of constructor values. > > Why is the testcase missing? Oh, one more thing. What happens if the index is wider (higher precision) than the type of the constructor elts? At least for the two_value_replacement optimization in phiopt, I'm using the wider of the two types for the arithmetics (conditionally unsigned if not proven not to overflow). Shouldn't that be the case in this optimization too? With using just the constructor elt type, do you count on the analysis to fail if starting with casting the index to the elt type (or unsigned variant thereof) affects the computation? Jakub