gcc3 vs 176.gcc

Joseph S. Myers jsm28@cam.ac.uk
Wed Jan 9 12:08:00 GMT 2002


On Wed, 9 Jan 2002, Hartmut Schirmer wrote:

> GCC should behave a little more predictable here.

Undefined behaviour often means it isn't reasonable to expect well-defined 
or predictable semantics from an implementation.

We can (and should) have testcases in the testsuite that alias analysis
does work - that the compiler knows that one access does not conflict with
another.  If we decide the override type-based alias analysis (with a
warning, of course) when accesses "obviously" conflict, we should add some
specific testcases where accesses "obviously" conflict, type-based alias
analysis says they don't, and the compiler is meant to ignore the
type-based alias analysis.  Then we'll know if those testcases break in
future.  But documenting specific cases of undefined code to work - or
indeed documenting certain optimisations to work and optimise out code
(and the Linux kernel has been known to rely on optimisations working in
some cases) - seems less desirable.

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc mailing list