PATCH for Re: optimization/7557: gcc-3.1.1 (debian/i386): wrong codewith -O2 / bitfields / pointer aliasing
Gerald Pfeifer
pfeifer@dbai.tuwien.ac.at
Wed Aug 14 01:14:00 GMT 2002
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
More information about the Gcc
mailing list