This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19828] [4.0 Regression] LIM is pulling out a pure function even though there is something which can modify global memory
- From: "rakdver at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Feb 2005 16:16:23 -0000
- Subject: [Bug tree-optimization/19828] [4.0 Regression] LIM is pulling out a pure function even though there is something which can modify global memory
- References: <20050208190328.19828.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rakdver at gcc dot gnu dot org 2005-02-18 16:16 -------
OK, I agree that definition of ``pure'' needs to be changed in order to be
useful (and to match the expectations); obviously, any function that is not
total does not match the current definition.
What I find somewhat troublesome is that the "upgraded" definition of pure puts
some of obligation on user of the function, rather than function itself. The
definition matching the expected semantics would need to be something like
"Pure function is guaranteed to be always called in such a way that it has no
side effects."
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19828