ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn.
[gcc.git] / gcc / opts.c
index 4df7389fc78af06d75982b2ac8dca57093a857e0..a83345b91e21fd5a02dd69252385695dedbc9a1a 100644 (file)
@@ -904,6 +904,19 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
 
   if (opts->x_flag_sanitize_recover & SANITIZE_LEAK)
     error_at (loc, "-fsanitize-recover=leak is not supported");
+
+  /* When instrumenting the pointers, we don't want to remove
+     the null pointer checks.  */
+  if (opts->x_flag_sanitize & (SANITIZE_NULL | SANITIZE_NONNULL_ATTRIBUTE
+                               | SANITIZE_RETURNS_NONNULL_ATTRIBUTE))
+    opts->x_flag_delete_null_pointer_checks = 0;
+
+  /* Aggressive compiler optimizations may cause false negatives.  */
+  if (opts->x_flag_sanitize)
+    {
+      opts->x_flag_aggressive_loop_optimizations = 0;
+      opts->x_flag_strict_overflow = 0;
+    }
 }
 
 #define LEFT_COLUMN    27
@@ -1622,12 +1635,6 @@ common_handle_option (struct gcc_options *opts,
        if (code != OPT_fsanitize_)
          break;
 
-       /* When instrumenting the pointers, we don't want to remove
-          the null pointer checks.  */
-       if (opts->x_flag_sanitize & (SANITIZE_NULL | SANITIZE_NONNULL_ATTRIBUTE
-                                    | SANITIZE_RETURNS_NONNULL_ATTRIBUTE))
-         opts->x_flag_delete_null_pointer_checks = 0;
-
        /* Kernel ASan implies normal ASan but does not yet support
           all features.  */
        if (opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS)
@@ -1807,6 +1814,17 @@ common_handle_option (struct gcc_options *opts,
       /* Deferred.  */
       break;
 
+    case OPT_foffload_:
+      /* Deferred.  */
+      break;
+
+#ifndef ACCEL_COMPILER
+    case OPT_foffload_abi_:
+      error_at (loc, "-foffload-abi option can be specified only for "
+               "offload compiler");
+      break;
+#endif
+
     case OPT_fpack_struct_:
       if (value <= 0 || (value & (value - 1)) || value > 16)
        error_at (loc,