This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: middle-end/9725: Invalid dependency determination
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: "Jan Beulich" <JBeulich at novell dot com>
- Cc: bangerth at dealii dot org, velco at fadata dot bg, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Tue, 18 Feb 2003 14:32:07 +0000
- Subject: Re: middle-end/9725: Invalid dependency determination
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> Indeed, I see. I that case (which I never was really aware of), it would
> be very desirable for a compiler to emit a warning on the non-conforming
> access rather than silently generating code that wasn't intended by the
> programmer. I frequently see this sort of constructs used (not so much
> using it myself since over time I came to avoid casts as much as
> possible), and searching existing code for it will be a pain, though I
> will have to do it to prevent further optimizer issues.
>
> Thanks for pointing this out to me, and also thanks for considering
> making the compiler emit a diagnostic for questionable casts to point at
> cases where the optimizer may generate unintended code.
>
We do have such a warning:
-Wstrict-aliasing
Unfortunately, it doesn't seem trigger for your test case. :-(
Now that could be considered to be a bug
R.