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

adruab at voria dot com gcc-bugzilla@gcc.gnu.org
Sun Jun 6 06:38:00 GMT 2004


------- Additional Comments From adruab at voria dot com  2004-06-06 06:38 -------
Hmmmmm, ok, so I changed a bunch of the functions to use p = (pointer)((char*)p
+ stride); and it seems to have fixed the mis-optimization.  (it could just be
because the current function has to recurse another level, but I'm willing to
bet that it just doesn't get confused).

So my question now is why does gcc even allow the cast to (char*&)?  If it will
get so confused shouldn't it tell me?

It's worth noting that the & part of the cast was a quick fix to get around
compiler errors that I was getting about aliasing... it seemed to work at the
time :P.

So I'll certainly keep that in mind when I'm designing future stuff (I didn't
write this really in the first place... so you know :P).

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15837



More information about the Gcc-bugs mailing list