From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48878 invoked by alias); 6 Jun 2016 19:44:17 -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 48864 invoked by uid 89); 6 Jun 2016 19:44:16 -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; Mon, 06 Jun 2016 19:44:15 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 95DD0B9AA9; Mon, 6 Jun 2016 19:44:13 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u56JiBAS020027 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 6 Jun 2016 15:44:12 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u56JiA4a005437; Mon, 6 Jun 2016 21:44:10 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u56Ji8OY005436; Mon, 6 Jun 2016 21:44:08 +0200 Date: Mon, 06 Jun 2016 19:44:00 -0000 From: Jakub Jelinek To: Jason Merrill , "Joseph S. Myers" , Marek Polacek , Martin Sebor Cc: Gcc Patch List Subject: Re: [PATCH] integer overflow checking builtins in constant expressions Message-ID: <20160606194408.GG7387@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <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> <20160603153235.GK7387@tucnak.redhat.com> <5751E408.1010707@gmail.com> <20160606123617.GW7387@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160606123617.GW7387@tucnak.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00424.txt.bz2 Hi! On Mon, Jun 06, 2016 at 02:36:17PM +0200, Jakub Jelinek wrote: > 2016-06-06 Martin Sebor > Jakub Jelinek > > PR c++/70507 > PR c/68120 > * builtins.def (BUILT_IN_ADD_OVERFLOW_P, BUILT_IN_SUB_OVERFLOW_P, > BUILT_IN_MUL_OVERFLOW_P): New builtins. > * builtins.c: Include gimple-fold.h. > (fold_builtin_arith_overflow): Handle > BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P. > (fold_builtin_3): Likewise. > * doc/extend.texi (Integer Overflow Builtins): Document > __builtin_{add,sub,mul}_overflow_p. > gcc/c/ > * c-typeck.c (convert_arguments): Don't promote last argument > of BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P. > gcc/cp/ > * constexpr.c: Include gimple-fold.h. > (cxx_eval_internal_function): New function. > (cxx_eval_call_expression): Call it. > (potential_constant_expression_1): Handle integer arithmetic > overflow built-ins. > * tree.c (builtin_valid_in_constant_expr_p): Likewise. > gcc/c-family/ > * c-common.c (check_builtin_function_arguments): Handle > BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P. > gcc/testsuite/ > * c-c++-common/builtin-arith-overflow-1.c: Add test cases. > * c-c++-common/builtin-arith-overflow-2.c: New test. > * g++.dg/cpp0x/constexpr-arith-overflow.C: New test. > * g++.dg/cpp1y/constexpr-arith-overflow.C: New test. Now successfully bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? Jakub