This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15837] Optimization (of templatized functions?)
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jun 2004 18:35:35 -0000
- Subject: [Bug c++/15837] Optimization (of templatized functions?)
- References: <20040605201151.15837.adruab@voria.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-06-06 18:35 -------
In some cases, gcc has to make assumptions (base on what the standard
allows it to) for aggressive optimizations. Some of these assumptions
can be checked, in which case the compiler will give you an error or
warning message. In some other cases, checking whether your code allows
to make such assumptions is just out of the picture, for example if
the compiler would have to check where exactly each pointer was initialized
and how you casted it around -- aliasing refers to the question whether you
access each object only through pointers to this object's type, or if, for
example, you access a double via pointers to integers. The latter is not
allowed by the standard, but the compiler can't prove in some cases that
you don't.
If your code violates aliasing assumptions, there is a -Wstrict-aliasing
switch (or similar) that can warn about some, though not all, invalid
constructs in codes.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15837