[Bug tree-optimization/88854] redundant store after load that would makes aliasing UB

kretz at kde dot org gcc-bugzilla@gcc.gnu.org
Tue Jan 15 15:02:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88854

--- Comment #7 from Matthias Kretz <kretz at kde dot org> ---
(In reply to rguenther@suse.de from comment #5)
> Yeah, we do not perform this kind of "flow-sensitive" TBAA.  So
> when trying to DSE *a = x; we only look at
> 
>      int x = *a;
>      *b = 1;
>      *a = x;
> 
> and do not consider the earlier load from *b at all because it is
> not on the path from the load making the store possibly redundant.

However, if I annotate a and/or b as __restrict__ GCC does the DSE. I don't
think I want another DSE special case but a general case of inducing aliasing
knowledge, which may affect decisions throughout the whole program where the
pointers are used.


More information about the Gcc-bugs mailing list