public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1386] ada: Make use of Cannot_Be_Superflat flag on N_Range nodes
@ 2023-05-30  7:18 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-05-30  7:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a91b145bd6903aa526de8f5c7b1586045b574e31

commit r14-1386-ga91b145bd6903aa526de8f5c7b1586045b574e31
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu Jan 19 00:37:18 2023 +0100

    ada: Make use of Cannot_Be_Superflat flag on N_Range nodes
    
    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.

Diff:
---
 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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-30  7:18 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:18 [gcc r14-1386] 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).