strict aliasing warning

Silvius Rus rus@google.com
Thu Nov 30 05:09:00 GMT 2006


Joel Sherrill wrote:
> Silvius Rus wrote:
>>
>> I wrote some code (not released yet) that improves the accuracy of 
>> -Wstrict-aliasing using tree-ssa-alias information.  The primary idea 
>> was to tell the programmer "go fix the types of variables x and y at 
>> lines ..." when -fstrict-aliasing breaks their code.
>>
> How reliable is this detection and warning?  Is it ready for testers yet?
The first take is almost ready, but will need to pass peer review before 
releasing it (even to testers), so it will be a few days.
>
> I ask because we have found a case where code in RTEMS breaks when 
> strict-aliasing is enabled.  We are having
> discussions on how to effectively perform an audit on RTEMS for other 
> breakages.  Right now, the best idea is
> Ralf's to diff the assembly generated for each file compiled with and 
> without strict-aliasing.  If there is a difference,
> we will have to review it.  This eliminates a lot of the code base but 
> it is still generating a lot of cases to examine by
> hand.
>
> I'm curious if your patch will ease this process.
The balance (false positives, false negatives) can be controlled by a 
--param option.  You can limit the number of false positives for each 
type pair, originating statement, function, or compilation unit using 
another --param option.


-- 
Silvius



More information about the Gcc mailing list