Commit 13393c8a by Jim Wilson Committed by Jim Wilson

Fix for ia64-linux misoptimization.

	* fold-const.c (extract_muldiv, case MAX_EXPR): Don't allow signedness
	change.

From-SVN: r33643
parent 8ae71501
Wed May 3 12:55:46 2000 Jim Wilson <wilson@cygnus.com>
* fold-const.c (extract_muldiv, case MAX_EXPR): Don't allow signedness
change.
2000-05-03 Greg McGary <gkm@gnu.org> 2000-05-03 Greg McGary <gkm@gnu.org>
* tree.h (tree_common): Add bounded_flag member. Remove * tree.h (tree_common): Add bounded_flag member. Remove
......
...@@ -4402,6 +4402,11 @@ extract_muldiv (t, c, code, wide_type) ...@@ -4402,6 +4402,11 @@ extract_muldiv (t, c, code, wide_type)
break; break;
case MIN_EXPR: case MAX_EXPR: case MIN_EXPR: case MAX_EXPR:
/* If widening the type changes the signedness, then we can't perform
this optimization as that changes the result. */
if (ctype != type && TREE_UNSIGNED (ctype) != TREE_UNSIGNED (type))
break;
/* MIN (a, b) / 5 -> MIN (a / 5, b / 5) */ /* MIN (a, b) / 5 -> MIN (a / 5, b / 5) */
if ((t1 = extract_muldiv (op0, c, code, wide_type)) != 0 if ((t1 = extract_muldiv (op0, c, code, wide_type)) != 0
&& (t2 = extract_muldiv (op1, c, code, wide_type)) != 0) && (t2 = extract_muldiv (op1, c, code, wide_type)) != 0)
......
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