public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1875] middle-end/106457 - improve array_at_struct_end_p for array objects
@ 2022-07-28 12:35 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-07-28 12:35 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:ff26f0ba68fe6e870f315d0601b596f889b89680
commit r13-1875-gff26f0ba68fe6e870f315d0601b596f889b89680
Author: Richard Biener <rguenther@suse.de>
Date: Thu Jul 28 10:07:32 2022 +0200
middle-end/106457 - improve array_at_struct_end_p for array objects
Array references to array objects are never at struct end.
PR middle-end/106457
* tree.cc (array_at_struct_end_p): Handle array objects
specially.
Diff:
---
gcc/tree.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gcc/tree.cc b/gcc/tree.cc
index 84000dd8b69..fed1434d141 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -12778,6 +12778,10 @@ array_at_struct_end_p (tree ref)
&& DECL_SIZE_UNIT (ref)
&& TREE_CODE (DECL_SIZE_UNIT (ref)) == INTEGER_CST)
{
+ /* If the object itself is the array it is not at struct end. */
+ if (DECL_P (ref_to_array))
+ return false;
+
/* Check whether the array domain covers all of the available
padding. */
poly_int64 offset;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-28 12:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28 12:35 [gcc r13-1875] middle-end/106457 - improve array_at_struct_end_p for array objects 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).