This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to expand_expr
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to expand_expr
- From: Jason Merrill <jason at cygnus dot com>
- Date: Tue, 27 Jul 1999 03:20:50 -0700
If we get a PLUS_EXPR of two INTEGER_CSTs, op1 will be a CONST_INT, which
has VOIDmode. Passing VOIDmode to immed_double_const causes it to return a
CONST_DOUBLE, which is not what we want, so get the mode from the tree node
instead.
Tue Jul 27 03:15:33 1999 Jason Merrill <jason@yorick.cygnus.com>
* expr.c (expand_expr, case PLUS_EXPR): Get the mode from the
tree for op1, not the rtl.
Index: expr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expr.c,v
retrieving revision 1.156
diff -c -p -r1.156 expr.c
*** expr.c 1999/07/26 01:21:03 1.156
--- expr.c 1999/07/27 10:17:09
*************** expand_expr (exp, target, tmode, modifie
*** 6955,6961 ****
constant_part
= immed_double_const (TREE_INT_CST_LOW (TREE_OPERAND (exp, 0)),
(HOST_WIDE_INT) 0,
! GET_MODE (op1));
op1 = plus_constant (op1, INTVAL (constant_part));
if (modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
op1 = force_operand (op1, target);
--- 6955,6961 ----
constant_part
= immed_double_const (TREE_INT_CST_LOW (TREE_OPERAND (exp, 0)),
(HOST_WIDE_INT) 0,
! TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 1))));
op1 = plus_constant (op1, INTVAL (constant_part));
if (modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
op1 = force_operand (op1, target);