public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-6481] middle-end/111591 - explain why TBAA doesn't need adjustment
@ 2023-12-13  8:00 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-12-13  8:00 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:97094d2ffd7d00261e6d7cc5d4a62dc7c2c89b64

commit r14-6481-g97094d2ffd7d00261e6d7cc5d4a62dc7c2c89b64
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Dec 13 08:54:49 2023 +0100

    middle-end/111591 - explain why TBAA doesn't need adjustment
    
    While tidying the prototype patch I've done for the reduced testcase
    in PR111591 and in that process trying to produce a testcase that
    is miscompiled by stack slot coalescing and the TBAA info that
    remains un-altered I've realized we do not need to adjust TBAA info.
    
    The following documents this in the place we adjust points-to info
    which we do need to adjust.
    
            PR middle-end/111591
            * cfgexpand.cc (update_alias_info_with_stack_vars): Document
            why not adjusting TBAA info on accesses is OK.

Diff:
---
 gcc/cfgexpand.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc
index b860be8bb77..ec887ef918f 100644
--- a/gcc/cfgexpand.cc
+++ b/gcc/cfgexpand.cc
@@ -786,7 +786,13 @@ add_partitioned_vars_to_ptset (struct pt_solution *pt,
 /* Update points-to sets based on partition info, so we can use them on RTL.
    The bitmaps representing stack partitions will be saved until expand,
    where partitioned decls used as bases in memory expressions will be
-   rewritten.  */
+   rewritten.
+
+   It is not necessary to update TBAA info on accesses to the coalesced
+   storage since our memory model doesn't allow TBAA to be used for
+   WAW or WAR dependences.  For RAW when the write is to an old object
+   the new object would not have been initialized at the point of the
+   read, invoking undefined behavior.  */
 
 static void
 update_alias_info_with_stack_vars (void)

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

only message in thread, other threads:[~2023-12-13  8:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13  8:00 [gcc r14-6481] middle-end/111591 - explain why TBAA doesn't need adjustment 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).