#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include "machmode.h"
#include "rtl.h"
-#include "hash-set.h"
-#include "vec.h"
-#include "double-int.h"
-#include "input.h"
#include "alias.h"
#include "symtab.h"
-#include "wide-int.h"
-#include "inchash.h"
#include "tree.h"
#include "fold-const.h"
#include "stringpool.h"
#include "function.h"
#include "insn-config.h"
#include "insn-attr.h"
-#include "hashtab.h"
-#include "statistics.h"
-#include "real.h"
-#include "fixed-value.h"
#include "expmed.h"
#include "dojump.h"
#include "explow.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
#include "gimple-expr.h"
-#include "is-a.h"
#include "gimple.h"
#include "gimple-ssa.h"
-#include "hash-map.h"
-#include "plugin-api.h"
-#include "ipa-ref.h"
#include "cgraph.h"
#include "tree-ssanames.h"
#include "target.h"
return exp;
}
-/* Return a tree of sizetype representing the size, in bytes, of the element
- of EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
-
-tree
-array_ref_element_size (tree exp)
-{
- tree aligned_size = TREE_OPERAND (exp, 3);
- tree elmt_type = TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- location_t loc = EXPR_LOCATION (exp);
-
- /* If a size was specified in the ARRAY_REF, it's the size measured
- in alignment units of the element type. So multiply by that value. */
- if (aligned_size)
- {
- /* ??? tree_ssa_useless_type_conversion will eliminate casts to
- sizetype from another type of the same width and signedness. */
- if (TREE_TYPE (aligned_size) != sizetype)
- aligned_size = fold_convert_loc (loc, sizetype, aligned_size);
- return size_binop_loc (loc, MULT_EXPR, aligned_size,
- size_int (TYPE_ALIGN_UNIT (elmt_type)));
- }
-
- /* Otherwise, take the size from that of the element type. Substitute
- any PLACEHOLDER_EXPR that we have. */
- else
- return SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_SIZE_UNIT (elmt_type), exp);
-}
-
-/* Return a tree representing the lower bound of the array mentioned in
- EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
-
-tree
-array_ref_low_bound (tree exp)
-{
- tree domain_type = TYPE_DOMAIN (TREE_TYPE (TREE_OPERAND (exp, 0)));
-
- /* If a lower bound is specified in EXP, use it. */
- if (TREE_OPERAND (exp, 2))
- return TREE_OPERAND (exp, 2);
-
- /* Otherwise, if there is a domain type and it has a lower bound, use it,
- substituting for a PLACEHOLDER_EXPR as needed. */
- if (domain_type && TYPE_MIN_VALUE (domain_type))
- return SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_MIN_VALUE (domain_type), exp);
-
- /* Otherwise, return a zero of the appropriate type. */
- return build_int_cst (TREE_TYPE (TREE_OPERAND (exp, 1)), 0);
-}
-
-/* Returns true if REF is an array reference to an array at the end of
- a structure. If this is the case, the array may be allocated larger
- than its upper bound implies. */
-
-bool
-array_at_struct_end_p (tree ref)
-{
- if (TREE_CODE (ref) != ARRAY_REF
- && TREE_CODE (ref) != ARRAY_RANGE_REF)
- return false;
-
- while (handled_component_p (ref))
- {
- /* If the reference chain contains a component reference to a
- non-union type and there follows another field the reference
- is not at the end of a structure. */
- if (TREE_CODE (ref) == COMPONENT_REF
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (ref, 0))) == RECORD_TYPE)
- {
- tree nextf = DECL_CHAIN (TREE_OPERAND (ref, 1));
- while (nextf && TREE_CODE (nextf) != FIELD_DECL)
- nextf = DECL_CHAIN (nextf);
- if (nextf)
- return false;
- }
-
- ref = TREE_OPERAND (ref, 0);
- }
-
- /* If the reference is based on a declared entity, the size of the array
- is constrained by its given domain. */
- if (DECL_P (ref))
- return false;
-
- return true;
-}
-
-/* Return a tree representing the upper bound of the array mentioned in
- EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
-
-tree
-array_ref_up_bound (tree exp)
-{
- tree domain_type = TYPE_DOMAIN (TREE_TYPE (TREE_OPERAND (exp, 0)));
-
- /* If there is a domain type and it has an upper bound, use it, substituting
- for a PLACEHOLDER_EXPR as needed. */
- if (domain_type && TYPE_MAX_VALUE (domain_type))
- return SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_MAX_VALUE (domain_type), exp);
-
- /* Otherwise fail. */
- return NULL_TREE;
-}
-
-/* Return a tree representing the offset, in bytes, of the field referenced
- by EXP. This does not include any offset in DECL_FIELD_BIT_OFFSET. */
-
-tree
-component_ref_field_offset (tree exp)
-{
- tree aligned_offset = TREE_OPERAND (exp, 2);
- tree field = TREE_OPERAND (exp, 1);
- location_t loc = EXPR_LOCATION (exp);
-
- /* If an offset was specified in the COMPONENT_REF, it's the offset measured
- in units of DECL_OFFSET_ALIGN / BITS_PER_UNIT. So multiply by that
- value. */
- if (aligned_offset)
- {
- /* ??? tree_ssa_useless_type_conversion will eliminate casts to
- sizetype from another type of the same width and signedness. */
- if (TREE_TYPE (aligned_offset) != sizetype)
- aligned_offset = fold_convert_loc (loc, sizetype, aligned_offset);
- return size_binop_loc (loc, MULT_EXPR, aligned_offset,
- size_int (DECL_OFFSET_ALIGN (field)
- / BITS_PER_UNIT));
- }
-
- /* Otherwise, take the offset from that of the field. Substitute
- any PLACEHOLDER_EXPR that we have. */
- else
- return SUBSTITUTE_PLACEHOLDER_IN_EXPR (DECL_FIELD_OFFSET (field), exp);
-}
-
/* Alignment in bits the TARGET of an assignment may be assumed to have. */
static unsigned HOST_WIDE_INT
Thus the following special case checks need only
check the second operand. */
if (TREE_CODE (treeop0) == INTEGER_CST)
- {
- tree t1 = treeop0;
- treeop0 = treeop1;
- treeop1 = t1;
- }
+ std::swap (treeop0, treeop1);
/* First, check if we have a multiplication of one signed and one
unsigned operand. */
def0 = get_def_for_expr (treeop1, NEGATE_EXPR);
/* Swap operands if the 2nd operand is fed by a negate. */
if (def0)
- {
- tree tem = treeop0;
- treeop0 = treeop1;
- treeop1 = tem;
- }
+ std::swap (treeop0, treeop1);
}
def2 = get_def_for_expr (treeop2, NEGATE_EXPR);
Thus the following special case checks need only
check the second operand. */
if (TREE_CODE (treeop0) == INTEGER_CST)
- {
- tree t1 = treeop0;
- treeop0 = treeop1;
- treeop1 = t1;
- }
+ std::swap (treeop0, treeop1);
/* Attempt to return something suitable for generating an
indexed address, for machines that support that. */
if ((icode = optab_handler (movmisalign_optab, mode))
!= CODE_FOR_nothing)
{
- rtx reg, insn;
+ rtx reg;
op0 = adjust_address (op0, mode, 0);
/* We've already validated the memory, and we're creating a
reg = gen_reg_rtx (mode);
/* Nor can the insn generator. */
- insn = GEN_FCN (icode) (reg, op0);
+ rtx_insn *insn = GEN_FCN (icode) (reg, op0);
emit_insn (insn);
return reg;
}
{
enum rtx_code code;
tree arg0, arg1, type;
- tree tem;
machine_mode operand_mode;
int unsignedp;
rtx op0, op1;
if (TREE_CODE (arg0) == REAL_CST || TREE_CODE (arg0) == INTEGER_CST
|| TREE_CODE (arg0) == FIXED_CST)
{
- tem = arg0; arg0 = arg1; arg1 = tem;
+ std::swap (arg0, arg1);
code = swap_condition (code);
}