This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15837] Optimization (of templatized functions?)


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]