This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/15460] wrong code with -O2 -fno-tree-dominator-opts


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]