This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/33259] limited range of remainder operation can prove loop runs at most once
- 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: 27 Dec 2008 07:18:40 -0000
- Subject: [Bug tree-optimization/33259] limited range of remainder operation can prove loop runs at most once
- References: <bug-33259-11337@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2008-12-27 07:18 -------
Confirmed, simple testcase for this really:
int f(int a)
{
int b = a % 3;
return b > 4 || b < -4;
}
This should always return false as b can be proved to be in between -2 and 2.
for unsigned mod, the range is [0, C].
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC build triplet|i686-pc-linux-gnu |
GCC host triplet|i686-pc-linux-gnu |
GCC target triplet|i686-pc-linux-gnu |
Keywords| |missed-optimization
Last reconfirmed|0000-00-00 00:00:00 |2008-12-27 07:18:40
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33259