/* Convert tree expression to rtl instructions, for GNU compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
void
init_expr (void)
{
- cfun->expr = ggc_alloc_cleared (sizeof (struct expr_status));
+ memset (&crtl->expr, 0, sizeof (crtl->expr));
}
\f
/* Copy data from FROM to TO, where the machine modes are not the same.
{
if (reg_overlap_mentioned_p (to, from))
from = force_reg (from_mode, from);
- emit_insn (gen_rtx_CLOBBER (VOIDmode, to));
+ emit_clobber (to);
}
convert_move (word_to, from, unsignedp);
emit_unop_insn (code, to, word_to, equiv_code);
insns = get_insns ();
end_sequence ();
- emit_no_conflict_block (insns, to, from, NULL_RTX,
- gen_rtx_fmt_e (equiv_code, to_mode, copy_rtx (from)));
+ emit_insn (insns);
return;
}
static bool
block_move_libcall_safe_for_call_parm (void)
{
+#if defined (REG_PARM_STACK_SPACE)
+ tree fn;
+#endif
+
/* If arguments are pushed on the stack, then they're safe. */
if (PUSH_ARGS)
return true;
/* If registers go on the stack anyway, any argument is sure to clobber
an outgoing argument. */
#if defined (REG_PARM_STACK_SPACE)
- if (OUTGOING_REG_PARM_STACK_SPACE)
- {
- tree fn;
- fn = emit_block_move_libcall_fn (false);
- if (REG_PARM_STACK_SPACE (fn) != 0)
- return false;
- }
+ fn = emit_block_move_libcall_fn (false);
+ if (OUTGOING_REG_PARM_STACK_SPACE ((!fn ? NULL_TREE : TREE_TYPE (fn)))
+ && REG_PARM_STACK_SPACE (fn) != 0)
+ return false;
#endif
/* If any argument goes in memory, then it might clobber an outgoing
pat = GEN_FCN ((int) code) (x, y, op2, opalign);
else
pat = GEN_FCN ((int) code) (x, y, op2, opalign,
- GEN_INT (expected_align),
+ GEN_INT (expected_align
+ / BITS_PER_UNIT),
GEN_INT (expected_size));
if (pat)
{
gcc_assert (GET_CODE (orig) == PARALLEL);
length = XVECLEN (orig, 0);
- tmps = alloca (sizeof (rtx) * length);
+ tmps = XALLOCAVEC (rtx, length);
/* Skip a NULL entry in first slot. */
i = XEXP (XVECEXP (orig, 0, 0), 0) ? 0 : 1;
rtx *tmps;
int i;
- tmps = alloca (sizeof (rtx) * XVECLEN (dst, 0));
+ tmps = XALLOCAVEC (rtx, XVECLEN (dst, 0));
emit_group_load_1 (tmps, dst, src, type, ssize);
/* Copy the extracted pieces into the proper (probable) hard regs. */
start = 1;
finish = XVECLEN (src, 0);
- tmps = alloca (sizeof (rtx) * finish);
+ tmps = XALLOCAVEC (rtx, finish);
/* Copy the (probable) hard regs into pseudos. */
for (i = start; i < finish; i++)
}
else
{
- gcc_assert (bytepos == 0 && XVECLEN (src, 0));
- dest = assign_stack_temp (GET_MODE (dest),
- GET_MODE_SIZE (GET_MODE (dest)), 0);
- emit_move_insn (adjust_address (dest, GET_MODE (tmps[i]), bytepos),
- tmps[i]);
- dst = dest;
+ enum machine_mode dest_mode = GET_MODE (dest);
+ enum machine_mode tmp_mode = GET_MODE (tmps[i]);
+ int dest_size = GET_MODE_SIZE (dest_mode);
+ int tmp_size = GET_MODE_SIZE (tmp_mode);
+
+ gcc_assert (bytepos == 0
+ && XVECLEN (src, 0)
+ && dest_size == tmp_size);
+
+ if (GET_MODE_ALIGNMENT (dest_mode)
+ >= GET_MODE_ALIGNMENT (tmp_mode))
+ {
+ dest = assign_stack_temp (dest_mode, dest_size, 0);
+ emit_move_insn (adjust_address (dest,
+ tmp_mode,
+ bytepos),
+ tmps[i]);
+ dst = dest;
+ }
+ else
+ {
+ dest = assign_stack_temp (tmp_mode, tmp_size, 0);
+ emit_move_insn (dest, tmps[i]);
+ dst = adjust_address (dest, dest_mode, bytepos);
+ }
break;
}
}
pat = GEN_FCN ((int) code) (object, opsize, opchar, opalign);
else
pat = GEN_FCN ((int) code) (object, opsize, opchar, opalign,
- GEN_INT (expected_align),
+ GEN_INT (expected_align
+ / BITS_PER_UNIT),
GEN_INT (expected_size));
if (pat)
{
hard regs shouldn't appear here except as return values. */
if (!reload_completed && !reload_in_progress
&& REG_P (x) && !reg_overlap_mentioned_p (x, y))
- emit_insn (gen_rtx_CLOBBER (VOIDmode, x));
+ emit_clobber (x);
write_complex_part (x, read_complex_part (y, false), false);
write_complex_part (x, read_complex_part (y, true), true);
if (x != y
&& ! (reload_in_progress || reload_completed)
&& need_clobber != 0)
- emit_insn (gen_rtx_CLOBBER (VOIDmode, x));
+ emit_clobber (x);
emit_insn (seq);
needs to be done. Handling this in the normal way is safe because no
computation is done before the call. */
if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from, from)
+ && COMPLETE_TYPE_P (TREE_TYPE (from))
&& TREE_CODE (TYPE_SIZE (TREE_TYPE (from))) == INTEGER_CST
&& ! ((TREE_CODE (to) == VAR_DECL || TREE_CODE (to) == PARM_DECL)
&& REG_P (DECL_RTL (to))))
the place the value is being stored, use a safe function when copying
a value through a pointer into a structure value return block. */
if (TREE_CODE (to) == RESULT_DECL && TREE_CODE (from) == INDIRECT_REF
- && current_function_returns_struct
- && !current_function_returns_pcc_struct)
+ && cfun->returns_struct
+ && !cfun->returns_pcc_struct)
{
rtx from_rtx, size;
}
str_copy_len = MIN (str_copy_len, exp_len);
if (!can_store_by_pieces (str_copy_len, builtin_strncpy_read_str,
- (void *) TREE_STRING_POINTER (exp),
+ CONST_CAST(char *, TREE_STRING_POINTER (exp)),
MEM_ALIGN (target), false))
goto normal_expr;
dest_mem = store_by_pieces (dest_mem,
str_copy_len, builtin_strncpy_read_str,
- (void *) TREE_STRING_POINTER (exp),
+ CONST_CAST(char *, TREE_STRING_POINTER (exp)),
MEM_ALIGN (target), false,
exp_len > str_copy_len ? 1 : 0);
if (exp_len > str_copy_len)
}
if (REG_P (target) && !cleared)
- emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
+ emit_clobber (target);
/* Store each element of the constructor into the
corresponding field of TARGET. */
if (!cleared && REG_P (target))
/* Inform later passes that the old value is dead. */
- emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
+ emit_clobber (target);
/* Store each element of the constructor into the
corresponding element of TARGET, determined by counting the
&& mode != TYPE_MODE (TREE_TYPE (exp)))
temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1);
- /* If the modes of TARGET and TEMP are both BLKmode, both
+ /* If the modes of TEMP and TARGET are both BLKmode, both
must be in memory and BITPOS must be aligned on a byte
- boundary. If so, we simply do a block copy. */
- if (GET_MODE (target) == BLKmode && GET_MODE (temp) == BLKmode)
+ boundary. If so, we simply do a block copy. Likewise
+ for a BLKmode-like TARGET. */
+ if (GET_MODE (temp) == BLKmode
+ && (GET_MODE (target) == BLKmode
+ || (MEM_P (target)
+ && GET_MODE_CLASS (GET_MODE (target)) == MODE_INT
+ && (bitpos % BITS_PER_UNIT) == 0
+ && (bitsize % BITS_PER_UNIT) == 0)))
{
gcc_assert (MEM_P (target) && MEM_P (temp)
- && !(bitpos % BITS_PER_UNIT));
+ && (bitpos % BITS_PER_UNIT) == 0);
target = adjust_address (target, VOIDmode, bitpos / BITS_PER_UNIT);
emit_block_move (target, temp,
If any of the extraction expressions is volatile,
we store 1 in *PVOLATILEP. Otherwise we don't change that.
- If the field is a bit-field, *PMODE is set to VOIDmode. Otherwise, it
- is a mode that can be used to access the field. In that case, *PBITSIZE
- is redundant.
+ If the field is a non-BLKmode bit-field, *PMODE is set to VOIDmode.
+ Otherwise, it is a mode that can be used to access the field.
If the field describes a variable-sized object, *PMODE is set to
- VOIDmode and *PBITSIZE is set to -1. An access cannot be made in
+ BLKmode and *PBITSIZE is set to -1. An access cannot be made in
this case, but the address of the object can be found.
If KEEP_ALIGNING is true and the target is STRICT_ALIGNMENT, we don't
{
tree size_tree = 0;
enum machine_mode mode = VOIDmode;
+ bool blkmode_bitfield = false;
tree offset = size_zero_node;
tree bit_offset = bitsize_zero_node;
outermost expression. */
if (TREE_CODE (exp) == COMPONENT_REF)
{
- size_tree = DECL_SIZE (TREE_OPERAND (exp, 1));
- if (! DECL_BIT_FIELD (TREE_OPERAND (exp, 1)))
- mode = DECL_MODE (TREE_OPERAND (exp, 1));
+ tree field = TREE_OPERAND (exp, 1);
+ size_tree = DECL_SIZE (field);
+ if (!DECL_BIT_FIELD (field))
+ mode = DECL_MODE (field);
+ else if (DECL_MODE (field) == BLKmode)
+ blkmode_bitfield = true;
- *punsignedp = DECL_UNSIGNED (TREE_OPERAND (exp, 1));
+ *punsignedp = DECL_UNSIGNED (field);
}
else if (TREE_CODE (exp) == BIT_FIELD_REF)
{
*pbitsize = tree_low_cst (size_tree, 1);
}
- *pmode = mode;
-
/* Compute cumulative bit-offset for nested component-refs and array-refs,
and find the ultimate containing object. */
while (1)
if (double_int_fits_in_shwi_p (tem))
{
*pbitpos = double_int_to_shwi (tem);
- *poffset = NULL_TREE;
- return exp;
+ *poffset = offset = NULL_TREE;
}
}
/* Otherwise, split it up. */
- *pbitpos = tree_low_cst (bit_offset, 0);
- *poffset = offset;
+ if (offset)
+ {
+ *pbitpos = tree_low_cst (bit_offset, 0);
+ *poffset = offset;
+ }
+
+ /* We can use BLKmode for a byte-aligned BLKmode bitfield. */
+ if (mode == VOIDmode
+ && blkmode_bitfield
+ && (*pbitpos % BITS_PER_UNIT) == 0
+ && (*pbitsize % BITS_PER_UNIT) == 0)
+ *pmode = BLKmode;
+ else
+ *pmode = mode;
return exp;
}
case tcc_type:
/* Should never get a type here. */
gcc_unreachable ();
-
- case tcc_gimple_stmt:
- gcc_unreachable ();
}
/* If we have an rtl, find any enclosed object. Then see if we conflict
}
break;
- case NON_LVALUE_EXPR: case NOP_EXPR: case CONVERT_EXPR:
+ case BIT_AND_EXPR:
+ /* The highest power of two of a bit-and expression is the maximum of
+ that of its operands. We typically get here for a complex LHS and
+ a constant negative power of two on the RHS to force an explicit
+ alignment, so don't bother looking at the LHS. */
+ return highest_pow2_factor (TREE_OPERAND (exp, 1));
+
+ CASE_CONVERT:
case SAVE_EXPR:
return highest_pow2_factor (TREE_OPERAND (exp, 0));
return fold_convert (build_pointer_type (TREE_TYPE (var)), call);
}
\f
-/* Expands variable VAR. */
-
-void
-expand_var (tree var)
-{
- if (DECL_EXTERNAL (var))
- return;
-
- if (TREE_STATIC (var))
- /* If this is an inlined copy of a static local variable,
- look up the original decl. */
- var = DECL_ORIGIN (var);
-
- if (TREE_STATIC (var)
- ? !TREE_ASM_WRITTEN (var)
- : !DECL_RTL_SET_P (var))
- {
- if (TREE_CODE (var) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (var))
- /* Should be ignored. */;
- else if (lang_hooks.expand_decl (var))
- /* OK. */;
- else if (TREE_CODE (var) == VAR_DECL && !TREE_STATIC (var))
- expand_decl (var);
- else if (TREE_CODE (var) == VAR_DECL && TREE_STATIC (var))
- rest_of_decl_compilation (var, 0, 0);
- else
- /* No expansion needed. */
- gcc_assert (TREE_CODE (var) == TYPE_DECL
- || TREE_CODE (var) == CONST_DECL
- || TREE_CODE (var) == FUNCTION_DECL
- || TREE_CODE (var) == LABEL_DECL);
- }
-}
/* Subroutine of expand_expr. Expand the two operands of a binary
expression EXP0 and EXP1 placing the results in OP0 and OP1.
/* Handle ERROR_MARK before anybody tries to access its type. */
if (TREE_CODE (exp) == ERROR_MARK
- || TREE_CODE (exp) == PREDICT_EXPR
- || (!GIMPLE_TUPLE_P (exp) && TREE_CODE (TREE_TYPE (exp)) == ERROR_MARK))
+ || (TREE_CODE (TREE_TYPE (exp)) == ERROR_MARK))
{
ret = CONST0_RTX (tmode);
return ret ? ret : const0_rtx;
if (flag_non_call_exceptions)
{
- rn = lookup_stmt_eh_region (exp);
+ rn = lookup_expr_eh_region (exp);
+
/* If rn < 0, then either (1) tree-ssa not used or (2) doesn't throw. */
if (rn >= 0)
last = get_last_insn ();
&& GET_CODE (PATTERN (insn)) != CLOBBER
&& GET_CODE (PATTERN (insn)) != USE
&& (CALL_P (insn) || may_trap_p (PATTERN (insn))))
- {
- REG_NOTES (insn) = alloc_EXPR_LIST (REG_EH_REGION, GEN_INT (rn),
- REG_NOTES (insn));
- }
+ add_reg_note (insn, REG_EH_REGION, GEN_INT (rn));
}
}
type) \
: (expr))
- if (GIMPLE_STMT_P (exp))
- {
- type = void_type_node;
- mode = VOIDmode;
- unsignedp = 0;
- }
- else
- {
- type = TREE_TYPE (exp);
- mode = TYPE_MODE (type);
- unsignedp = TYPE_UNSIGNED (type);
- }
+ type = TREE_TYPE (exp);
+ mode = TYPE_MODE (type);
+ unsignedp = TYPE_UNSIGNED (type);
ignore = (target == const0_rtx
- || ((code == NON_LVALUE_EXPR || code == NOP_EXPR
- || code == CONVERT_EXPR || code == COND_EXPR
- || code == VIEW_CONVERT_EXPR)
+ || ((code == NOP_EXPR || code == CONVERT_EXPR
+ || code == COND_EXPR || code == VIEW_CONVERT_EXPR)
&& TREE_CODE (type) == VOID_TYPE));
/* An operation in what may be a bit-field type needs the
/* If this is a constant, put it into a register if it is a legitimate
constant, OFFSET is 0, and we won't try to extract outside the
register (in case we were passed a partially uninitialized object
- or a view_conversion to a larger size). Force the constant to
- memory otherwise. */
+ or a view_conversion to a larger size) or a BLKmode piece of it
+ (e.g. if it is unchecked-converted to a record type in Ada). Force
+ the constant to memory otherwise. */
if (CONSTANT_P (op0))
{
enum machine_mode mode = TYPE_MODE (TREE_TYPE (tem));
if (mode != BLKmode && LEGITIMATE_CONSTANT_P (op0)
&& offset == 0
+ && mode1 != BLKmode
&& bitpos + bitsize <= GET_MODE_BITSIZE (mode))
op0 = force_reg (mode, op0);
else
for an ARRAY_RANGE_REF whose type is BLKmode. */
else if (!MEM_P (op0)
&& (offset != 0
- || (bitpos + bitsize > GET_MODE_BITSIZE (GET_MODE (op0)))
- || (code == ARRAY_RANGE_REF && mode == BLKmode)))
+ || mode1 == BLKmode
+ || (bitpos + bitsize
+ > GET_MODE_BITSIZE (GET_MODE (op0)))))
{
tree nt = build_qualified_type (TREE_TYPE (tem),
(TYPE_QUALS (TREE_TYPE (tem))
if (mode == BLKmode)
{
HOST_WIDE_INT size = GET_MODE_BITSIZE (ext_mode);
- rtx new;
+ rtx new_rtx;
/* If the reference doesn't use the alias set of its type,
we cannot create the temporary using that type. */
if (component_uses_parent_alias_set (exp))
{
- new = assign_stack_local (ext_mode, size, 0);
- set_mem_alias_set (new, get_alias_set (exp));
+ new_rtx = assign_stack_local (ext_mode, size, 0);
+ set_mem_alias_set (new_rtx, get_alias_set (exp));
}
else
- new = assign_stack_temp_for_type (ext_mode, size, 0, type);
+ new_rtx = assign_stack_temp_for_type (ext_mode, size, 0, type);
- emit_move_insn (new, op0);
- op0 = copy_rtx (new);
+ emit_move_insn (new_rtx, op0);
+ op0 = copy_rtx (new_rtx);
PUT_MODE (op0, BLKmode);
set_mem_attributes (op0, exp, 1);
}
return expand_call (exp, target, ignore);
case PAREN_EXPR:
- case NON_LVALUE_EXPR:
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
if (TREE_OPERAND (exp, 0) == error_mark_node)
return const0_rtx;
HOST_WIDE_INT temp_size
= MAX (int_size_in_bytes (inner_type),
(HOST_WIDE_INT) GET_MODE_SIZE (TYPE_MODE (type)));
- rtx new = assign_stack_temp_for_type (TYPE_MODE (type),
- temp_size, 0, type);
- rtx new_with_op0_mode = adjust_address (new, GET_MODE (op0), 0);
+ rtx new_rtx = assign_stack_temp_for_type (TYPE_MODE (type),
+ temp_size, 0, type);
+ rtx new_with_op0_mode = adjust_address (new_rtx, GET_MODE (op0), 0);
gcc_assert (!TREE_ADDRESSABLE (exp));
else
emit_move_insn (new_with_op0_mode, op0);
- op0 = new;
+ op0 = new_rtx;
}
op0 = adjust_address (op0, TYPE_MODE (type), 0);
if (modifier == EXPAND_STACK_PARM)
target = 0;
temp = expand_unop (mode,
- optab_for_tree_code (NEGATE_EXPR, type),
+ optab_for_tree_code (NEGATE_EXPR, type,
+ optab_default),
op0, target, 0);
gcc_assert (temp);
return REDUCE_BIT_FIELD (temp);
/* First try to do it with a special MIN or MAX instruction.
If that does not win, use a conditional jump to select the proper
value. */
- this_optab = optab_for_tree_code (code, type);
+ this_optab = optab_for_tree_code (code, type, optab_default);
temp = expand_binop (mode, this_optab, op0, op1, target, unsignedp,
OPTAB_WIDEN);
if (temp != 0)
case LROTATE_EXPR:
case RROTATE_EXPR:
- /* The expansion code only handles expansion of mode precision
- rotates. */
- gcc_assert (GET_MODE_PRECISION (TYPE_MODE (type))
- == TYPE_PRECISION (type));
+ gcc_assert (VECTOR_MODE_P (TYPE_MODE (type))
+ || (GET_MODE_PRECISION (TYPE_MODE (type))
+ == TYPE_PRECISION (type)));
+ /* fall through */
- /* Falltrough. */
case LSHIFT_EXPR:
case RSHIFT_EXPR:
/* If this is a fixed-point operation, then we cannot use the code
/* If no set-flag instruction, must generate a conditional store
into a temporary variable. Drop through and handle this
like && and ||. */
-
+ /* Although TRUTH_{AND,OR}IF_EXPR aren't present in GIMPLE, they
+ are occassionally created by folding during expansion. */
+ case TRUTH_ANDIF_EXPR:
+ case TRUTH_ORIF_EXPR:
if (! ignore
&& (target == 0
|| modifier == EXPAND_STACK_PARM
tree lhs = TREE_OPERAND (exp, 0);
tree rhs = TREE_OPERAND (exp, 1);
gcc_assert (ignore);
- expand_assignment (lhs, rhs, false);
- return const0_rtx;
- }
-
- case GIMPLE_MODIFY_STMT:
- {
- tree lhs = GIMPLE_STMT_OPERAND (exp, 0);
- tree rhs = GIMPLE_STMT_OPERAND (exp, 1);
-
- gcc_assert (ignore);
/* Check for |= or &= of a bitfield of size one into another bitfield
of size 1. In this case, (unless we need the result of the
case POSTDECREMENT_EXPR:
case LOOP_EXPR:
case EXIT_EXPR:
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
/* Lowered by gimplify.c. */
gcc_unreachable ();
return const0_rtx;
case EXC_PTR_EXPR:
- return get_exception_pointer (cfun);
+ return get_exception_pointer ();
case FILTER_EXPR:
- return get_exception_filter (cfun);
+ return get_exception_filter ();
case FDESC_EXPR:
/* Function descriptors are not valid except for as
tree oprnd2 = TREE_OPERAND (exp, 2);
rtx op2;
- this_optab = optab_for_tree_code (code, type);
+ this_optab = optab_for_tree_code (code, type, optab_default);
expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL);
op2 = expand_normal (oprnd2);
temp = expand_ternary_op (mode, this_optab, op0, op1, op2,
case REDUC_PLUS_EXPR:
{
op0 = expand_normal (TREE_OPERAND (exp, 0));
- this_optab = optab_for_tree_code (code, type);
+ this_optab = optab_for_tree_code (code, type, optab_default);
temp = expand_unop (mode, this_optab, op0, target, unsignedp);
gcc_assert (temp);
return temp;
{
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
NULL_RTX, &op0, &op1, 0);
- this_optab = optab_for_tree_code (code, type);
+ this_optab = optab_for_tree_code (code, type, optab_default);
temp = expand_binop (mode, this_optab, op0, op1, target, unsignedp,
OPTAB_WIDEN);
gcc_assert (temp);
{
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
NULL_RTX, &op0, &op1, 0);
- this_optab = optab_for_tree_code (code, type);
+ this_optab = optab_for_tree_code (code, type, optab_default);
temp = expand_binop (mode, this_optab, op0, op1, target, unsignedp,
OPTAB_WIDEN);
gcc_assert (temp);
case VEC_UNPACK_LO_EXPR:
{
op0 = expand_normal (TREE_OPERAND (exp, 0));
- this_optab = optab_for_tree_code (code, type);
+ this_optab = optab_for_tree_code (code, type, optab_default);
temp = expand_widen_pattern_expr (exp, op0, NULL_RTX, NULL_RTX,
target, unsignedp);
gcc_assert (temp);
op0 = expand_normal (TREE_OPERAND (exp, 0));
/* The signedness is determined from input operand. */
this_optab = optab_for_tree_code (code,
- TREE_TYPE (TREE_OPERAND (exp, 0)));
+ TREE_TYPE (TREE_OPERAND (exp, 0)),
+ optab_default);
temp = expand_widen_pattern_expr
(exp, op0, NULL_RTX, NULL_RTX,
target, TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
case VEC_PACK_TRUNC_EXPR:
case VEC_PACK_SAT_EXPR:
case VEC_PACK_FIX_TRUNC_EXPR:
- {
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- goto binop;
- }
-
- case OMP_ATOMIC_LOAD:
- case OMP_ATOMIC_STORE:
- /* OMP expansion is not run when there were errors, so these codes
- can get here. */
- gcc_assert (errorcount != 0);
- return NULL_RTX;
+ mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
+ goto binop;
default:
return lang_hooks.expand_expr (exp, original_target, tmode,
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1),
subtarget, &op0, &op1, 0);
binop2:
- this_optab = optab_for_tree_code (code, type);
+ this_optab = optab_for_tree_code (code, type, optab_default);
binop3:
if (modifier == EXPAND_STACK_PARM)
target = 0;
is_aligning_offset (const_tree offset, const_tree exp)
{
/* Strip off any conversions. */
- while (TREE_CODE (offset) == NON_LVALUE_EXPR
- || TREE_CODE (offset) == NOP_EXPR
- || TREE_CODE (offset) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (offset))
offset = TREE_OPERAND (offset, 0);
/* We must now have a BIT_AND_EXPR with a constant that is one less than
/* Look at the first operand of BIT_AND_EXPR and strip any conversion.
It must be NEGATE_EXPR. Then strip any more conversions. */
offset = TREE_OPERAND (offset, 0);
- while (TREE_CODE (offset) == NON_LVALUE_EXPR
- || TREE_CODE (offset) == NOP_EXPR
- || TREE_CODE (offset) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (offset))
offset = TREE_OPERAND (offset, 0);
if (TREE_CODE (offset) != NEGATE_EXPR)
return 0;
offset = TREE_OPERAND (offset, 0);
- while (TREE_CODE (offset) == NON_LVALUE_EXPR
- || TREE_CODE (offset) == NOP_EXPR
- || TREE_CODE (offset) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (offset))
offset = TREE_OPERAND (offset, 0);
/* This must now be the address of EXP. */
0 otherwise (i.e. if there is no casesi instruction). */
int
try_casesi (tree index_type, tree index_expr, tree minval, tree range,
- rtx table_label ATTRIBUTE_UNUSED, rtx default_label)
+ rtx table_label ATTRIBUTE_UNUSED, rtx default_label,
+ rtx fallback_label ATTRIBUTE_UNUSED)
{
enum machine_mode index_mode = SImode;
int index_bits = GET_MODE_BITSIZE (index_mode);
index_expr, minval);
minval = integer_zero_node;
index = expand_normal (index_expr);
- emit_cmp_and_jump_insns (rangertx, index, LTU, NULL_RTX,
- omode, 1, default_label);
+ if (default_label)
+ emit_cmp_and_jump_insns (rangertx, index, LTU, NULL_RTX,
+ omode, 1, default_label);
/* Now we can safely truncate. */
index = convert_to_mode (index_mode, index, 0);
}
op2 = copy_to_mode_reg (op_mode, op2);
emit_jump_insn (gen_casesi (index, op1, op2,
- table_label, default_label));
+ table_label, !default_label
+ ? fallback_label : default_label));
return 1;
}
{
rtx temp, vector;
- if (INTVAL (range) > cfun->max_jumptable_ents)
- cfun->max_jumptable_ents = INTVAL (range);
+ if (INTVAL (range) > cfun->cfg->max_jumptable_ents)
+ cfun->cfg->max_jumptable_ents = INTVAL (range);
/* Do an unsigned comparison (in the proper mode) between the index
expression and the value which represents the length of the range.
or equal to the minimum value of the range and less than or equal to
the maximum value of the range. */
- emit_cmp_and_jump_insns (index, range, GTU, NULL_RTX, mode, 1,
- default_label);
+ if (default_label)
+ emit_cmp_and_jump_insns (index, range, GTU, NULL_RTX, mode, 1,
+ default_label);
/* If index is in range, it must fit in Pmode.
Convert to Pmode so we can index with it. */
int
vector_mode_valid_p (enum machine_mode mode)
{
- enum mode_class class = GET_MODE_CLASS (mode);
+ enum mode_class mclass = GET_MODE_CLASS (mode);
enum machine_mode innermode;
/* Doh! What's going on? */
- if (class != MODE_VECTOR_INT
- && class != MODE_VECTOR_FLOAT
- && class != MODE_VECTOR_FRACT
- && class != MODE_VECTOR_UFRACT
- && class != MODE_VECTOR_ACCUM
- && class != MODE_VECTOR_UACCUM)
+ if (mclass != MODE_VECTOR_INT
+ && mclass != MODE_VECTOR_FLOAT
+ && mclass != MODE_VECTOR_FRACT
+ && mclass != MODE_VECTOR_UFRACT
+ && mclass != MODE_VECTOR_ACCUM
+ && mclass != MODE_VECTOR_UACCUM)
return 0;
/* Hardware support. Woo hoo! */