From patchwork Mon Jan 14 20:52:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 211896 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 65CEE2C00A3 for ; Tue, 15 Jan 2013 07:52:44 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1358801565; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=ysQKstvCbTn1ZmSQMkf/ 6m48YYo=; b=JgkiXT5bjMl/4+5WgTm/vRuVG+YG5B2C0eK3qxuMVDHEAmowDV0x 0CYxWdtDAvPufawMYAx4RhpUTcxIkjL0G8Z8eJPHKYjBGbbYGVEUQil4MxP0PYGG Bpfn5+qqiRj6Glx4GzGAR2OUJvaPgBh7F79Paobeh+KU0WVi3gHQhJA= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Xc2GWIiblfqVjxpmdHAu5mo17BKabDHM35DAxu8D4echNKS3dxieBk4HR1U9K4 5ci59smpc5jmZr6vvFIbQ1JGmTWkm7tRin2zDjncl35FA8UksmSpsMTVZ2nAcA4H bk32RPNTX/MabyFjGbaseByIOxLX5+L+pjeeT4kDRQv18=; Received: (qmail 27884 invoked by alias); 14 Jan 2013 20:52:31 -0000 Received: (qmail 27874 invoked by uid 22791); 14 Jan 2013 20:52:30 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Jan 2013 20:52:24 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0EKqMKB009368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Jan 2013 15:52:22 -0500 Received: from zalov.redhat.com (vpn1-5-87.ams2.redhat.com [10.36.5.87]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0EKqJxw008613 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jan 2013 15:52:21 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id r0EKqJJb030914; Mon, 14 Jan 2013 21:52:19 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r0EKqIw0030913; Mon, 14 Jan 2013 21:52:18 +0100 Date: Mon, 14 Jan 2013 21:52:18 +0100 From: Jakub Jelinek To: "Joseph S. Myers" Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Handle -fwrapv -ftrapv (PR tree-optimization/48766) Message-ID: <20130114205218.GS7269@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Hi! With this patch, -fno-[wt]rapv cancels corresponding -f[wt]rapv if any as before, and later -f[wt]rapv disables -f[tw]rapv, which is IMHO better behavior than if we use Negative(f[tw]rapv) on f[wt]rapv in common.opt. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2013-01-14 Jakub Jelinek PR tree-optimization/48766 * opts.c (common_handle_option): For -fwrapv disable -ftrapv, for -ftrapv disable -fwrapv. Jakub --- gcc/opts.c.jj 2013-01-11 09:02:48.000000000 +0100 +++ gcc/opts.c 2013-01-14 15:06:54.822968095 +0100 @@ -1755,6 +1755,16 @@ common_handle_option (struct gcc_options /* No-op. Used by the driver and passed to us because it starts with f.*/ break; + case OPT_fwrapv: + if (value) + opts->x_flag_trapv = 0; + break; + + case OPT_ftrapv: + if (value) + opts->x_flag_wrapv = 0; + break; + default: /* If the flag was handled in a standard way, assume the lack of processing here is intentional. */