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 tree-optimization/19917] [4.0 regression] Weak const function mishandled inside loop


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-12 00:53 -------
This is related to PR 19828 but note constant functions are are required not to read memory.  We are 
getting to a point where we have to defined what it means to be both const and weak which seems like 
a werid combination.  Really const means that I can pull the function out of the loop but weak means 
that it might not be defined, now what is this function. Really in my mind this is undefined and glibc 
should be fixed in that way as __pthread_internal_tsd_address is not really const because it reads 
memory.

Note at -O3 we get it "right" because we unswitch the loop.

Now using pure instead of const gets us into PR 19828.

-- 


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


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