This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15460] wrong code with -O2 -fno-tree-dominator-opts
- From: "belyshev at lubercy dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 May 2004 15:46:11 -0000
- Subject: [Bug tree-optimization/15460] wrong code with -O2 -fno-tree-dominator-opts
- References: <20040515124035.15460.belyshev@lubercy.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From belyshev at lubercy dot com 2004-05-15 15:46 -------
Minimized testcase:
cat > bug.i << EOF
static void do_random_tests(void)
{
unsigned int pos, len;
pos = random ();
len = 4294967294;
if (pos > len) {
len = pos;
// len = 0;
}
printf ("%u\n", pos < len ? pos : len);
printf ("%u\n", pos < len ? pos : len);
}
int main(void)
{
do_random_tests();
return 0;
}
EOF
gcc bug.i -O -funit-at-a-time -fno-tree-dominator-opts
./a.out
1804289383
4294967294
After uncommenting:
4294967294
4294967294
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15460