/* Expands front end tree to back end RTL for GCC
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
insn is volatile; don't optimize it. */
static void
-expand_asm (tree string, int vol)
+expand_asm_loc (tree string, int vol, location_t locus)
{
rtx body;
if (TREE_CODE (string) == ADDR_EXPR)
string = TREE_OPERAND (string, 0);
- body = gen_rtx_ASM_INPUT (VOIDmode,
- ggc_strdup (TREE_STRING_POINTER (string)));
+ body = gen_rtx_ASM_INPUT_loc (VOIDmode,
+ ggc_strdup (TREE_STRING_POINTER (string)),
+ locus);
MEM_VOLATILE_P (body) = vol;
&& REGNO (DECL_RTL (decl)) < FIRST_PSEUDO_REGISTER)
{
rtx reg = DECL_RTL (decl);
- unsigned int regno;
-
- for (regno = REGNO (reg);
- regno < (REGNO (reg)
- + hard_regno_nregs[REGNO (reg)][GET_MODE (reg)]);
- regno++)
- if (TEST_HARD_REG_BIT (*regs, regno))
- return decl;
+
+ if (overlaps_hard_reg_set_p (*regs, GET_MODE (reg), REGNO (reg)))
+ return decl;
}
walk_subtrees = 0;
}
val = TREE_VALUE (tail);
type = TREE_TYPE (val);
+ /* EXPAND_INITIALIZER will not generate code for valid initializer
+ constants, but will still generate code for other types of operand.
+ This is the behavior we want for constant constraints. */
op = expand_expr (val, NULL_RTX, VOIDmode,
- (allows_mem && !allows_reg
- ? EXPAND_MEMORY : EXPAND_NORMAL));
+ allows_reg ? EXPAND_NORMAL
+ : allows_mem ? EXPAND_MEMORY
+ : EXPAND_INITIALIZER);
/* Never pass a CONCAT to an ASM. */
if (GET_CODE (op) == CONCAT)
if (ASM_INPUT_P (exp))
{
- expand_asm (ASM_STRING (exp), ASM_VOLATILE_P (exp));
+ expand_asm_loc (ASM_STRING (exp), ASM_VOLATILE_P (exp), input_location);
return;
}
rtx value;
tree type;
- value = expand_expr (exp, const0_rtx, VOIDmode, 0);
+ value = expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
+ if (GIMPLE_TUPLE_P (exp))
+ type = void_type_node;
+ else
type = TREE_TYPE (exp);
/* If all we do is reference a volatile value in memory,
case PREDECREMENT_EXPR:
case POSTDECREMENT_EXPR:
case MODIFY_EXPR:
+ case GIMPLE_MODIFY_STMT:
case INIT_EXPR:
case TARGET_EXPR:
case CALL_EXPR:
case TRY_CATCH_EXPR:
case WITH_CLEANUP_EXPR:
case EXIT_EXPR:
+ case VA_ARG_EXPR:
return 0;
case BIND_EXPR:
/* If this is an expression which has no operands, there is no value
to be unused. There are no such language-independent codes,
but front ends may define such. */
- if (EXPRESSION_CLASS_P (exp) && TREE_CODE_LENGTH (TREE_CODE (exp)) == 0)
+ if (EXPRESSION_CLASS_P (exp) && TREE_OPERAND_LENGTH (exp) == 0)
return 0;
warn:
expand_null_return ();
return;
}
- else if ((TREE_CODE (retval) == MODIFY_EXPR
+ else if ((TREE_CODE (retval) == GIMPLE_MODIFY_STMT
|| TREE_CODE (retval) == INIT_EXPR)
- && TREE_CODE (TREE_OPERAND (retval, 0)) == RESULT_DECL)
- retval_rhs = TREE_OPERAND (retval, 1);
+ && TREE_CODE (GENERIC_TREE_OPERAND (retval, 0)) == RESULT_DECL)
+ retval_rhs = GENERIC_TREE_OPERAND (retval, 1);
else
retval_rhs = retval;
(and in expand_call). */
else if (retval_rhs != 0
- && TYPE_MODE (TREE_TYPE (retval_rhs)) == BLKmode
+ && TYPE_MODE (GENERIC_TREE_TYPE (retval_rhs)) == BLKmode
&& REG_P (result_rtl))
{
int i;
tree nt = build_qualified_type (ot, TYPE_QUALS (ot) | TYPE_QUAL_CONST);
val = assign_temp (nt, 0, 0, 1);
- val = expand_expr (retval_rhs, val, GET_MODE (val), 0);
+ val = expand_expr (retval_rhs, val, GET_MODE (val), EXPAND_NORMAL);
val = force_not_mem (val);
/* Return the calculated value. */
expand_value_return (val);
else
{
/* No hard reg used; calculate value into hard return reg. */
- expand_expr (retval, const0_rtx, VOIDmode, 0);
+ expand_expr (retval, const0_rtx, VOIDmode, EXPAND_NORMAL);
expand_value_return (result_rtl);
}
}
rtx table_label;
int ncases;
rtx *labelvec;
- int i, fail;
+ int i;
rtx before_case, end, lab;
tree vec = SWITCH_LABELS (exp);
before_case = NEXT_INSN (before_case);
end = get_last_insn ();
- fail = squeeze_notes (&before_case, &end);
- gcc_assert (!fail);
reorder_insns (before_case, end, start);
}