Re: ANSI alias rules checker in GCC, other optimizing compilers

andreybokhanko@gmail.com
20 Jan 2007 23:32:05 -0500

          From comp.compilers

Related articles
ANSI alias rules checker in GCC, other optimizing compilers andreybokhanko@gmail.com (2007-01-16)
Re: ANSI alias rules checker in GCC, other optimizing compilers ian@airs.com (Ian Lance Taylor) (2007-01-17)
Re: ANSI alias rules checker in GCC, other optimizing compilers andreybokhanko@gmail.com (Andrey Bokhanko) (2007-01-17)
Re: ANSI alias rules checker in GCC, other optimizing compilers andreybokhanko@gmail.com (Andrey Bokhanko) (2007-01-17)
Re: ANSI alias rules checker in GCC, other optimizing compilers ian@airs.com (Ian Lance Taylor) (2007-01-17)
Re: ANSI alias rules checker in GCC, other optimizing compilers silvius.rus@gmail.com (Silvius Rus) (2007-01-17)
Re: ANSI alias rules checker in GCC, other optimizing compilers ajonospam@andrew.cmu.edu (Arthur J. O'Dwyer) (2007-01-18)
Re: ANSI alias rules checker in GCC, other optimizing compilers andreybokhanko@gmail.com (2007-01-20)
| List of all articles for this month |
From: andreybokhanko@gmail.com
Newsgroups: comp.compilers
Date: 20 Jan 2007 23:32:05 -0500
Organization: Compilers Central
References: 07-01-04707-01-055
Keywords: GCC, analysis
Posted-Date: 20 Jan 2007 23:32:05 EST

Silvius Rus wrote:
> I am about to send in a patch to GCC 4.3 that will address some
> shortcomings. The new implementation performs single function
> (intraprocedural) alias and data flow analysis to rule out false
> negatives and to discover more cases which are not caught by the
> current implementation, such as aliases through malloc-ed memory.


Silvius, do you plan to leave meaning of current options intact? As I
quoted, GCC manual says:


"-Wstrict-aliasing
This option is only active when '-fstrict-aliasing' is active. It warns
about code which might break the strict aliasing rules that the
compiler is using for optimization. The warning does not catch all
cases, but does attempt to catch the more common pitfalls. It is
included in '-Wall'.


-Wstrict-aliasing=2
This option is only active when '-fstrict-aliasing' is active. It warns
about code which might break the strict aliasing rules that the
compiler is using for optimization. This warning catches more cases
than '-Wstrict-aliasing', but it will also give a warning for some
ambiguous cases that are safe."




Let us pay attention to these words: "This warning
[-Wstrict-aliasing=2] catches more cases than '-Wstrict-aliasing', but
it will also give a warning for some ambiguous cases that are safe."
But as Ian suggested, both warning levels produce false positives. The
only difference is that =2 also pays attention to "restrict" qualifier.
So, the current options description is a misguiding one?


Yours,
Andrey


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.