Commit ec666d23 by Jan Hubicka Committed by Jan Hubicka

cse.c (fold_rtx): Avoid building of (CONST (MINUS (CONST_INT) (SYMBOL_REF)))

	* cse.c (fold_rtx):  Avoid building of
	(CONST (MINUS (CONST_INT) (SYMBOL_REF)))

From-SVN: r87156
parent c4817ba6
2004-09-07 Jan Hubicka <jh@suse.cz> 2004-09-07 Jan Hubicka <jh@suse.cz>
* cse.c (fold_rtx): Avoid building of
(CONST (MINUS (CONST_INT) (SYMBOL_REF)))
* tree-ssa-pre.c (grand_bitmap_obstack): New. * tree-ssa-pre.c (grand_bitmap_obstack): New.
(value_insert_into_set_bitmap, bitmap_set_new): Use the obstack. (value_insert_into_set_bitmap, bitmap_set_new): Use the obstack.
(init_pre): Initialize obstack. (init_pre): Initialize obstack.
......
...@@ -3787,7 +3787,16 @@ fold_rtx (rtx x, rtx insn) ...@@ -3787,7 +3787,16 @@ fold_rtx (rtx x, rtx insn)
new = simplify_unary_operation (code, mode, new = simplify_unary_operation (code, mode,
const_arg0 ? const_arg0 : folded_arg0, const_arg0 ? const_arg0 : folded_arg0,
mode_arg0); mode_arg0);
if (new != 0 && is_const) /* NEG of PLUS could be converted into MINUS, but that causes
expressions of the form
(CONST (MINUS (CONST_INT) (SYMBOL_REF)))
which many ports mistakenly treat as LEGITIMATE_CONSTANT_P.
FIXME: those ports should be fixed. */
if (new != 0 && is_const
&& GET_CODE (new) == PLUS
&& (GET_CODE (XEXP (new, 0)) == SYMBOL_REF
|| GET_CODE (XEXP (new, 0)) == LABEL_REF)
&& GET_CODE (XEXP (new, 1)) == CONST_INT)
new = gen_rtx_CONST (mode, new); new = gen_rtx_CONST (mode, new);
} }
break; break;
......
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