* [COMMITTED] ada: Make use of Cannot_Be_Superflat flag on N_Range nodes
@ 2023-05-30 7:21 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-05-30 7:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Eric Botcazou
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(-)
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index ec61593a65b..53a11243590 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -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
diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc
index b18ca8c7d88..56c7bb9b533 100644
--- a/gcc/ada/gcc-interface/misc.cc
+++ b/gcc/ada/gcc-interface/misc.cc
@@ -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;
--
2.40.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-30 7:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 7:21 [COMMITTED] ada: Make use of Cannot_Be_Superflat flag on N_Range nodes Marc Poulhiès
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).