public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Handle -fwrapv -ftrapv (PR tree-optimization/48766)
@ 2013-01-14 20:52 Jakub Jelinek
  2013-01-14 22:24 ` Joseph S. Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2013-01-14 20:52 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc-patches

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  <jakub@redhat.com>

	PR tree-optimization/48766
	* opts.c (common_handle_option): For -fwrapv disable -ftrapv, for
	-ftrapv disable -fwrapv.

--- 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.  */

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Handle -fwrapv -ftrapv (PR tree-optimization/48766)
  2013-01-14 20:52 [PATCH] Handle -fwrapv -ftrapv (PR tree-optimization/48766) Jakub Jelinek
@ 2013-01-14 22:24 ` Joseph S. Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph S. Myers @ 2013-01-14 22:24 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Mon, 14 Jan 2013, Jakub Jelinek wrote:

> 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  <jakub@redhat.com>
> 
> 	PR tree-optimization/48766
> 	* opts.c (common_handle_option): For -fwrapv disable -ftrapv, for
> 	-ftrapv disable -fwrapv.

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-14 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14 20:52 [PATCH] Handle -fwrapv -ftrapv (PR tree-optimization/48766) Jakub Jelinek
2013-01-14 22:24 ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).