Commit 8cce3d04 by Roger Sayle Committed by Roger Sayle

re PR target/13889 (Assignment of an int to an int of different size in a struct gives ICE)


	PR target/13889
	* cse.c (fold_rtx): Avoid substituting constants into unary
	convertion operations.

	* gcc.c-torture/compile/pr13889.c: New test case.

From-SVN: r79762
parent 05fe5c67
2004-03-20 Roger Sayle <roger@eyesopen.com>
PR target/13889
* cse.c (fold_rtx): Avoid substituting constants into unary
convertion operations.
2004-03-20 Kazu Hirata <kazu@cs.umass.edu>
* fold-const.c (fold): Replace "expr" with "t".
......
......@@ -3662,6 +3662,23 @@ fold_rtx (rtx x, rtx insn)
|| (new_cost == old_cost && CONSTANT_P (XEXP (x, i))))
break;
/* It's not safe to substitute the operand of a conversion
operator with a constant, as the conversion's identity
depends upon the mode of it's operand. This optimization
is handled by the call to simplify_unary_operation. */
if (GET_RTX_CLASS (code) == RTX_UNARY
&& GET_MODE (replacements[j]) != mode_arg0
&& (code == ZERO_EXTEND
|| code == SIGN_EXTEND
|| code == TRUNCATE
|| code == FLOAT_TRUNCATE
|| code == FLOAT_EXTEND
|| code == FLOAT
|| code == FIX
|| code == UNSIGNED_FLOAT
|| code == UNSIGNED_FIX))
continue;
if (validate_change (insn, &XEXP (x, i), replacements[j], 0))
break;
......
2004-03-20 Roger Sayle <roger@eyesopen.com>
PR target/13889
* gcc.c-torture/compile/pr13889.c: New test case.
2004-03-20 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/14635
......
/* PR target/13889 */
struct { long long a; } *p;
void initNetFlowFunct(void) {
unsigned int b = (unsigned int)-1;
p->a = b;
}
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