[Bug rtl-optimization/14319] incorrect optimization of union of structs with common initial sequences

jameskuyper at verizon dot net gcc-bugzilla@gcc.gnu.org
Thu Apr 19 03:09:00 GMT 2018


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

James Kuyper Jr. <jameskuyper at verizon dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jameskuyper at verizon dot net

--- Comment #11 from James Kuyper Jr. <jameskuyper at verizon dot net> ---
(In reply to Tim Rentsch from comment #10)
...
> Four:  Despite the last observation, the "one special guarantee" clause
> (and hence also DR 257) is clearly not germane to this problem.  The
> reason for this is that the "one special guarantee" clause is concerned
> with read access ("inspect" is the word used in the Standard), but the
> example code has no read accesses, only write accesses.  That paragraph
> of the Standard is not relevant here.

The example code includes the statement
    return xp->x;

Which does in fact inspect (read) the value currently stored in a variable that
is part of the common initial sequence. The fact that if fails to read the
value most recently written to that location is the defect that's being
reported.


More information about the Gcc-bugs mailing list