ANSI alias rules checker in GCC, other optimizing compilers
- From: andreybokhanko@xxxxxxxxx
- Date: 16 Jan 2007 12:45:05 -0500
Dear comp.compilers,
Could you, please, suggest me what GCC does under "-Wstrict-aliasing"
and "-Wstrict-aliasing=2"? What interests me is information from
"compiler developer / power user" point of view -- that is, as much
"under the hood" details as possible.
GCC manual says only this:
"-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."
Also, what methods other optimizing compilers use to check conformity
of user code with ANSI aliasing rules? Is there an "industry-wide" set
of options / conventions?
Yours,
Andrey
[I presume you know that the issue is that C doesn't let you have pointers
of different types pointing at the same place, but I don't know the details
of GCC's checks, either. -John]
.
- Follow-Ups:
- Re: ANSI alias rules checker in GCC, other optimizing compilers
- From: Silvius Rus
- Re: ANSI alias rules checker in GCC, other optimizing compilers
- From: Ian Lance Taylor
- Re: ANSI alias rules checker in GCC, other optimizing compilers
- From: Ian Lance Taylor
- Re: ANSI alias rules checker in GCC, other optimizing compilers
- Prev by Date: Re: The development tendency of compilation tech?
- Next by Date: Re: The development tendency of compilation tech?
- Previous by thread: The development tendency of compilation tech?
- Next by thread: Re: ANSI alias rules checker in GCC, other optimizing compilers
- Index(es):