re PR c/43661 (ice in fold_comparison, at fold-const.c:9579)

2010-04-06  Richard Guenther  <rguenther@suse.de>

	PR middle-end/43661
	* fold-const.c (fold_comparison): Handle X * 0 CMP 0.

	* gcc.c-torture/compile/pr43661.c: New testcase.

From-SVN: r157984
This commit is contained in:
Richard Guenther 2010-04-06 10:36:57 +00:00 committed by Richard Biener
parent b172360dd4
commit eb12d0ae3e
4 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2010-04-06 Richard Guenther <rguenther@suse.de>
PR middle-end/43661
* fold-const.c (fold_comparison): Handle X * 0 CMP 0.
2010-04-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* doc/invoke.texi (Optimize Options): Document that LTO

View file

@ -9576,7 +9576,9 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
tree variable1 = TREE_OPERAND (arg0, 0);
enum tree_code cmp_code = code;
gcc_assert (!integer_zerop (const1));
/* Handle unfolded multiplication by zero. */
if (integer_zerop (const1))
return fold_build2_loc (loc, cmp_code, type, const1, const2);
fold_overflow_warning (("assuming signed overflow does not occur when "
"eliminating multiplication in comparison "

View file

@ -1,3 +1,8 @@
2010-04-06 Richard Guenther <rguenther@suse.de>
PR middle-end/43661
* gcc.c-torture/compile/pr43661.c: New testcase.
2010-04-06 Jakub Jelinek <jakub@redhat.com>
* gcc.target/s390/stackcheck1.c: Add dg-warning.

View file

@ -0,0 +1,5 @@
int
func (int x)
{
return 0 ? (unsigned short) (0 ? : 1 * (signed char) (x ^ x) >= 0) : 1;
}