[COMMITTED] ada: Make use of Cannot_Be_Superflat flag on N_Range nodes
Checks
Commit Message
From: Eric Botcazou <ebotcazou@adacore.com>
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.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/gcc-interface/decl.cc | 4 ++++
gcc/ada/gcc-interface/misc.cc | 3 ---
2 files changed, 4 insertions(+), 3 deletions(-)
@@ -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
@@ -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;