]> gcc.gnu.org Git - gcc.git/commitdiff
ada: Make use of Cannot_Be_Superflat flag on N_Range nodes
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 18 Jan 2023 23:37:18 +0000 (00:37 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 30 May 2023 07:12:17 +0000 (09:12 +0200)
gcc/ada/

* gcc-interface/decl.cc (range_cannot_be_superflat): Return true
immediately if Cannot_Be_Superflat is set.
* gcc-interface/misc.cc (gnat_post_options): Do not override the
-Wstringop-overflow setting.

gcc/ada/gcc-interface/decl.cc
gcc/ada/gcc-interface/misc.cc

index ec61593a65b8d296e3d0c1e18cb7d865341de704..53a112435903f5033d0d1c3077e7994b1b1955a9 100644 (file)
@@ -6673,6 +6673,10 @@ range_cannot_be_superflat (Node_Id gnat_range)
   Node_Id gnat_scalar_range;
   tree gnu_lb, gnu_hb, gnu_lb_minus_one;
 
+  /* This is the easy case.  */
+  if (Cannot_Be_Superflat (gnat_range))
+    return true;
+
   /* If the low bound is not constant, take the worst case by finding an upper
      bound for its type, repeatedly if need be.  */
   while (Nkind (gnat_lb) != N_Integer_Literal
index b18ca8c7d8844845b5b8f0b49cbee84d22da03f3..56c7bb9b53348263fb4dcf7d5cc4110b89fa2e38 100644 (file)
@@ -267,9 +267,6 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
   /* No return type warnings for Ada.  */
   warn_return_type = 0;
 
-  /* No string overflow warnings for Ada.  */
-  warn_stringop_overflow = 0;
-
   /* No caret by default for Ada.  */
   if (!OPTION_SET_P (flag_diagnostics_show_caret))
     global_dc->show_caret = false;
This page took 0.086663 seconds and 5 git commands to generate.