This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
PATCH for Re: optimization/7557: gcc-3.1.1 (debian/i386): wrong codewith -O2 / bitfields / pointer aliasing
- From: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- To: Johannes Stezenbach <js at convergence dot de>
- Cc: Robert Dewar <dewar at gnat dot com>, <gcc-bugs at gcc dot gnu dot org>, <sirl at gcc dot gnu dot org>, <gcc at gcc dot gnu dot org>, <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 14 Aug 2002 10:13:52 +0200 (CEST)
- Subject: PATCH for Re: optimization/7557: gcc-3.1.1 (debian/i386): wrong codewith -O2 / bitfields / pointer aliasing
On Tue, 13 Aug 2002, Johannes Stezenbach wrote:
> I am not against including -fstrict-aliasing in -O2. I like
> good optimization.
> [...]
>
> Please consider adding a note to NEWS and/or
> http://gcc.gnu.org/gcc-3.0/caveats.html or a similar document.
Done.
Gerald
Index: caveats.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-3.0/caveats.html,v
retrieving revision 1.5
diff -u -3 -p -r1.5 caveats.html
--- caveats.html 23 Jan 2002 15:42:27 -0000 1.5
+++ caveats.html 14 Aug 2002 07:48:32 -0000
@@ -8,6 +8,13 @@
<h1>GCC 3.0 Caveats</h1>
<ul>
+ <li><code>-fstrict-aliasing</code> is now part of <code>-O2</code>
+ and higher optimization levels. This allows the compiler to assume
+ the strictest aliasing rules applicable to the language being
+ compiled. For C and C++, this activates optimizations based on the
+ type of expressions. This optimization may thus break old,
+ non-compliant code.
+
<li>Enumerations are now properly promoted to <code>int</code> in
function parameters and function returns. Normally this change is
not visible, but when using <code>-fshort-enums</code> this is an