Commit eb12d0ae by Richard Guenther Committed by Richard Biener

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
parent b172360d
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> 2010-04-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* doc/invoke.texi (Optimize Options): Document that LTO * doc/invoke.texi (Optimize Options): Document that LTO
......
...@@ -9576,7 +9576,9 @@ fold_comparison (location_t loc, enum tree_code code, tree type, ...@@ -9576,7 +9576,9 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
tree variable1 = TREE_OPERAND (arg0, 0); tree variable1 = TREE_OPERAND (arg0, 0);
enum tree_code cmp_code = code; 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 " fold_overflow_warning (("assuming signed overflow does not occur when "
"eliminating multiplication in comparison " "eliminating multiplication in comparison "
......
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> 2010-04-06 Jakub Jelinek <jakub@redhat.com>
* gcc.target/s390/stackcheck1.c: Add dg-warning. * gcc.target/s390/stackcheck1.c: Add dg-warning.
......
int
func (int x)
{
return 0 ? (unsigned short) (0 ? : 1 * (signed char) (x ^ x) >= 0) : 1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment