public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-9813] tree-optimization/105232 - handle overly large sizes in component_ref_size
@ 2022-04-12 10:49 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-04-12 10:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:008d568ac7eba4057172c52d306e09d174041c59

commit r11-9813-g008d568ac7eba4057172c52d306e09d174041c59
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Apr 12 09:54:32 2022 +0200

    tree-optimization/105232 - handle overly large sizes in component_ref_size
    
    The following properly checks tree_fits_poly_int64_p before converting
    a size to a poly_int64.
    
    2022-04-12  Richard Biener  <rguenther@suse.de>
    
            PR tree-optimization/105232
            * tree.c (component_ref_size): Bail out for too large
            or non-constant sizes.
    
    (cherry picked from commit 1bd96873cf73c4f59de48e9bc0d17a498f1ede04)

Diff:
---
 gcc/tree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/tree.c b/gcc/tree.c
index 0f318430c77..5f87455c68f 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -13951,6 +13951,8 @@ component_ref_size (tree ref, special_array_member *sam /* = NULL */)
      to struct types with flexible array members.  */
   if (memsize)
     {
+      if (!tree_fits_poly_int64_p (memsize))
+	return NULL_TREE;
       poly_int64 memsz64 = memsize ? tree_to_poly_int64 (memsize) : 0;
       if (known_lt (baseoff, memsz64))
 	{


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

only message in thread, other threads:[~2022-04-12 10:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 10:49 [gcc r11-9813] tree-optimization/105232 - handle overly large sizes in component_ref_size Richard Biener

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).