This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19917] [4.0 regression] Weak const function mishandled inside loop
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Feb 2005 00:53:28 -0000
- Subject: [Bug tree-optimization/19917] [4.0 regression] Weak const function mishandled inside loop
- References: <20050212002429.19917.schwab@suse.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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