[patch, wrong-code, 4.2/4.3/4.4 regression] Patch for PR38615

Joseph S. Myers joseph@codesourcery.com
Wed Jan 21 13:26:00 GMT 2009


On Wed, 21 Jan 2009, Richard Guenther wrote:

> Ah, indeed.  It seems to cover this case already.  Quoting:
> 
> "This option implies @option{-fmerge-constants}.  In addition to
> @option{-fmerge-constants} this considers e.g.@: even constant initialized
> arrays or initialized constant variables with integral or floating point
> types.  Languages like C or C++ require each non-automatic variable to
> have distinct location, so using this option will result in non-conforming
> behavior."
> 
> In the testcase the array is non-automatic (as you have its address
> taken).

The array has automatic storage duration (being declared inside a function 
without extern or static) whether or not its address is taken.

The issue with the documentation (if the option is extended to cover this 
case) is that it should then say something like "each variable including 
multiple instances of the same variable in recursive calls to the same 
function" instead of "each non-automatic variable".

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list