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  <ja...@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

Reply via email to