This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23414] pure function is not dectected for functions with non infinite loops
- 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: 16 Aug 2005 01:23:40 -0000
- Subject: [Bug tree-optimization/23414] pure function is not dectected for functions with non infinite loops
- References: <20050816005828.23414.tkho@ucla.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-16 01:23 -------
The issue here is more complex. We are not dected the function with the loop as constant so we don't
mark it as the function a as not having side effects.
The most ovbvious way to fix this would do the ipa optimizations on the ssa level where we can get the
loop information and check to see if the loops are finite.
A simple example is even without -funsafe-loop-optimization:
void a(int start, int finish) {
for (; start < finish; ++start) {
}
}
int main() {
int x = 0, y = 99;
a(x, y);
}
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |missed-optimization
Last reconfirmed|0000-00-00 00:00:00 |2005-08-16 01:23:37
date| |
Summary|function call not optimized |pure function is not
|away after unsafe-loop- |dectected for functions with
|optimizations |non infinite loops
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23414