Aliasing brokenness (Was: Re: [patch RFC] SH: Use FRAME_GROWS_DOWNWARD)

Joseph S. Myers joseph@codesourcery.com
Tue Jul 19 16:36:00 GMT 2005


On Tue, 19 Jul 2005, Daniel Berlin wrote:

> > Look at execute/20000603-1.c .  There is a union of struct s1 and struct s2,
> > but nonoverlapping_component_refs_p still comes to the wrong conclusions.
> >    
> 
> This case is questionable, and the current committee proposal seems to
> be "this is not allowed".

There is no "current committee proposal".  There are lots of individual 
suggestions and nothing approaching consensus since the DR was submitted 
five years ago.  Furthermore, most of the discussions are looking at the 
simple case of a union of int and double where the intent not to allow 
aliasing when int and double pointers are used is clear - not the case of 
common initial subsequences (which may serve as some sort of exception to 
the type-based aliasing rules) where the best indication of committee 
intent we have is the second example in example 3 in 6.5.2.3 saying "The 
following is not a valid fragment (because the union type is not visible 
within function f):" and thereby suggesting without explicitly saying that 
if the type were visible in f the code would be valid.  No doubt if a 
consensus is reached about the simple cases then the committee will work 
out what should be done with common initial subsequences and whether that 
example needs changing.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)



More information about the Gcc-patches mailing list