From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104785 invoked by alias); 3 Jun 2016 15:32:43 -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 104768 invoked by uid 89); 3 Jun 2016 15:32:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 03 Jun 2016 15:32:41 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 40F5AD6D24; Fri, 3 Jun 2016 15:32:40 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u53FWcDt030924 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jun 2016 11:32:39 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u53FWaqU001777; Fri, 3 Jun 2016 17:32:37 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u53FWZXU001776; Fri, 3 Jun 2016 17:32:35 +0200 Date: Fri, 03 Jun 2016 15:32:00 -0000 From: Jakub Jelinek To: Martin Sebor Cc: Gcc Patch List , Jason Merrill , "Joseph S. Myers" Subject: Re: [PATCH] integer overflow checking builtins in constant expressions Message-ID: <20160603153235.GK7387@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20160531215025.GK28550@tucnak.redhat.com> <574E13DD.9040401@gmail.com> <20160601075212.GL28550@tucnak.redhat.com> <574EFC8F.2040400@gmail.com> <574FA3BC.8090603@gmail.com> <20160602072316.GY28550@tucnak.redhat.com> <5750BF82.5030203@gmail.com> <5750CF25.1080801@gmail.com> <20160603070637.GA7387@tucnak.redhat.com> <5751A26C.1060201@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5751A26C.1060201@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00287.txt.bz2 On Fri, Jun 03, 2016 at 09:29:48AM -0600, Martin Sebor wrote: > >>+ { > >>+ tree type = TREE_TYPE (TREE_TYPE (t)); > >>+ tree vflow = arith_overflowed_p (opcode, type, arg0, arg1) > >>+ ? integer_one_node : integer_zero_node; > > > >This looks incorrect, the return type is TREE_TYPE (t), some complex integer > >type, therefore vflow needs to be > > tree vflow = build_int_cst (TREE_TYPE (TREE_TYPE (t)), > > arith_overflowed_p (opcode, type, arg0, arg1) > > ? 1 : 0); > >no? > > I guess it didn't think it mattered since the complex type specifies > the types of the two members. I don't mind changing it if it does Sure, it does. But if there are any differences between the lhs and rhs type (or e.g. in COMPLEX_EXPR args etc. in GENERIC), then it is invalid IL, or for GIMPLE if the two types aren't compatible according to the GIMPLE rules (useless conversion). Jakub