+2012-01-24 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * doc/rtl.texi (MEM_IN_STRUCT_P, MEM_SCALAR_P): Delete.
+ (in_struct, return_val): Remove MEM documentation.
+ * rtl.h (rtx_def): Remove MEM meanings from in_struct and return_val.
+ (MEM_IN_STRUCT_P, MEM_SCALAR_P): Delete.
+ (MEM_COPY_ATTRIBUTES): Remove references to MEM_IN_STRUCT_P
+ and MEM_SCALAR.
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
+ * cfgexpand.c (add_alias_set_conflicts): Likewise.
+ * expr.c (store_field): Likewise.
+ * function.c (assign_stack_temp_for_type): Likewise.
+ * ifcvt.c (noce_try_cmove_arith): Likewise.
+ * reload1.c (reload): Likewise.
+ * config/alpha/alpha.c (alpha_set_memflags_1): Likewise.
+ (alpha_set_memflags): Likewise.
+ * config/m32c/m32c.c (m32c_immd_dbl_mov): Nullify.
+
2012-01-24 Richard Sandiford <rdsandiford@googlemail.com>
* rtl.h (true_dependence, canon_true_dependence): Remove varies
and due to type based aliasing rules decides that for two overlapping
union temporaries { short s; int i; } accesses to the same mem through
different types may not alias and happily reorders stores across
- life-time boundaries of the temporaries (See PR25654).
- We also have to mind MEM_IN_STRUCT_P and MEM_SCALAR_P. */
+ life-time boundaries of the temporaries (See PR25654). */
static void
add_alias_set_conflicts (void)
return 0;
MEM_VOLATILE_P (x) = MEM_VOLATILE_P (orig);
- MEM_IN_STRUCT_P (x) = MEM_IN_STRUCT_P (orig);
- MEM_SCALAR_P (x) = MEM_SCALAR_P (orig);
MEM_NOTRAP_P (x) = MEM_NOTRAP_P (orig);
MEM_READONLY_P (x) = MEM_READONLY_P (orig);
generated from one of the insn patterns. So if everything is
zero, the pattern is already up-to-date. */
if (!MEM_VOLATILE_P (ref)
- && !MEM_IN_STRUCT_P (ref)
- && !MEM_SCALAR_P (ref)
&& !MEM_NOTRAP_P (ref)
&& !MEM_READONLY_P (ref))
return;
for moving an immediate double data to a double data type variable
location, can be combined into single SImode mov instruction. */
bool
-m32c_immd_dbl_mov (rtx * operands,
+m32c_immd_dbl_mov (rtx * operands ATTRIBUTE_UNUSED,
enum machine_mode mode ATTRIBUTE_UNUSED)
{
- int flag = 0, okflag = 0, offset1 = 0, offset2 = 0, offsetsign = 0;
- const char *str1;
- const char *str2;
-
- if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF
- && MEM_SCALAR_P (operands[0])
- && !MEM_IN_STRUCT_P (operands[0])
- && GET_CODE (XEXP (operands[2], 0)) == CONST
- && GET_CODE (XEXP (XEXP (operands[2], 0), 0)) == PLUS
- && GET_CODE (XEXP (XEXP (XEXP (operands[2], 0), 0), 0)) == SYMBOL_REF
- && GET_CODE (XEXP (XEXP (XEXP (operands[2], 0), 0), 1)) == CONST_INT
- && MEM_SCALAR_P (operands[2])
- && !MEM_IN_STRUCT_P (operands[2]))
- flag = 1;
-
- else if (GET_CODE (XEXP (operands[0], 0)) == CONST
- && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == PLUS
- && GET_CODE (XEXP (XEXP (XEXP (operands[0], 0), 0), 0)) == SYMBOL_REF
- && MEM_SCALAR_P (operands[0])
- && !MEM_IN_STRUCT_P (operands[0])
- && !(INTVAL (XEXP (XEXP (XEXP (operands[0], 0), 0), 1)) %4)
- && GET_CODE (XEXP (operands[2], 0)) == CONST
- && GET_CODE (XEXP (XEXP (operands[2], 0), 0)) == PLUS
- && GET_CODE (XEXP (XEXP (XEXP (operands[2], 0), 0), 0)) == SYMBOL_REF
- && MEM_SCALAR_P (operands[2])
- && !MEM_IN_STRUCT_P (operands[2]))
- flag = 2;
-
- else if (GET_CODE (XEXP (operands[0], 0)) == PLUS
- && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
- && REGNO (XEXP (XEXP (operands[0], 0), 0)) == FB_REGNO
- && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT
- && MEM_SCALAR_P (operands[0])
- && !MEM_IN_STRUCT_P (operands[0])
- && !(INTVAL (XEXP (XEXP (operands[0], 0), 1)) %4)
- && REGNO (XEXP (XEXP (operands[2], 0), 0)) == FB_REGNO
- && GET_CODE (XEXP (XEXP (operands[2], 0), 1)) == CONST_INT
- && MEM_SCALAR_P (operands[2])
- && !MEM_IN_STRUCT_P (operands[2]))
- flag = 3;
-
- else
- return false;
-
- switch (flag)
- {
- case 1:
- str1 = XSTR (XEXP (operands[0], 0), 0);
- str2 = XSTR (XEXP (XEXP (XEXP (operands[2], 0), 0), 0), 0);
- if (strcmp (str1, str2) == 0)
- okflag = 1;
- else
- okflag = 0;
- break;
- case 2:
- str1 = XSTR (XEXP (XEXP (XEXP (operands[0], 0), 0), 0), 0);
- str2 = XSTR (XEXP (XEXP (XEXP (operands[2], 0), 0), 0), 0);
- if (strcmp(str1,str2) == 0)
- okflag = 1;
- else
- okflag = 0;
- break;
- case 3:
- offset1 = INTVAL (XEXP (XEXP (operands[0], 0), 1));
- offset2 = INTVAL (XEXP (XEXP (operands[2], 0), 1));
- offsetsign = offset1 >> ((sizeof (offset1) * 8) -1);
- if (((offset2-offset1) == 2) && offsetsign != 0)
- okflag = 1;
- else
- okflag = 0;
- break;
- default:
- okflag = 0;
- }
-
- if (okflag == 1)
- {
- HOST_WIDE_INT val;
- operands[4] = gen_rtx_MEM (SImode, XEXP (operands[0], 0));
-
- val = (INTVAL (operands[3]) << 16) + (INTVAL (operands[1]) & 0xFFFF);
- operands[5] = gen_rtx_CONST_INT (VOIDmode, val);
-
- return true;
- }
-
+ /* ??? This relied on the now-defunct MEM_SCALAR and MEM_IN_STRUCT_P
+ flags. */
return false;
}
a reference to a non-local label.
Stored in the @code{volatil} field and printed as @samp{/v}.
-@findex MEM_IN_STRUCT_P
-@cindex @code{mem} and @samp{/s}
-@cindex @code{in_struct}, in @code{mem}
-@item MEM_IN_STRUCT_P (@var{x})
-In @code{mem} expressions, nonzero for reference to an entire structure,
-union or array, or to a component of one. Zero for references to a
-scalar variable or through a pointer to a scalar. If both this flag and
-@code{MEM_SCALAR_P} are clear, then we don't know whether this @code{mem}
-is in a structure or not. Both flags should never be simultaneously set.
-Stored in the @code{in_struct} field and printed as @samp{/s}.
-
@findex MEM_KEEP_ALIAS_SET_P
@cindex @code{mem} and @samp{/j}
@cindex @code{jump}, in @code{mem}
are already in a non-addressable component of an aggregate.
Stored in the @code{jump} field and printed as @samp{/j}.
-@findex MEM_SCALAR_P
-@cindex @code{mem} and @samp{/i}
-@cindex @code{return_val}, in @code{mem}
-@item MEM_SCALAR_P (@var{x})
-In @code{mem} expressions, nonzero for reference to a scalar known not
-to be a member of a structure, union, or array. Zero for such
-references and for indirections through pointers, even pointers pointing
-to scalar types. If both this flag and @code{MEM_IN_STRUCT_P} are clear,
-then we don't know whether this @code{mem} is in a structure or not.
-Both flags should never be simultaneously set.
-Stored in the @code{return_val} field and printed as @samp{/i}.
-
@findex MEM_VOLATILE_P
@cindex @code{mem} and @samp{/v}
@cindex @code{asm_input} and @samp{/v}
@findex in_struct
@cindex @samp{/s} in RTL dump
@item in_struct
-In @code{mem} expressions, it is 1 if the memory datum referred to is
-all or part of a structure or array; 0 if it is (or might be) a scalar
-variable. A reference through a C pointer has 0 because the pointer
-might point to a scalar variable. This information allows the compiler
-to determine something about possible cases of aliasing.
-
In @code{reg} expressions, it is 1 if the register has its entire life
contained within the test expression of some loop.
may be used for parameters as well, but this flag is not set on such
uses.
-In @code{mem} expressions, 1 means the memory reference is to a scalar
-known not to be a member of a structure, union, or array.
-
In @code{symbol_ref} expressions, 1 means the referenced symbol is weak.
In @code{call} expressions, 1 means the call is pure.
attrs.alias = get_alias_set (t);
MEM_VOLATILE_P (ref) |= TYPE_VOLATILE (type);
- MEM_IN_STRUCT_P (ref)
- = AGGREGATE_TYPE_P (type) || TREE_CODE (type) == COMPLEX_TYPE;
MEM_POINTER (ref) = POINTER_TYPE_P (type);
- /* If we are making an object of this type, or if this is a DECL, we know
- that it is a scalar if the type is not an aggregate. */
- if ((objectp || DECL_P (t))
- && ! AGGREGATE_TYPE_P (type)
- && TREE_CODE (type) != COMPLEX_TYPE)
- MEM_SCALAR_P (ref) = 1;
-
/* Default values from pre-existing memory attributes if present. */
refattrs = MEM_ATTRS (ref);
if (refattrs)
/* Now set the attributes we computed above. */
attrs.addrspace = TYPE_ADDR_SPACE (type);
set_mem_attrs (ref, &attrs);
-
- /* If this is already known to be a scalar or aggregate, we are done. */
- if (MEM_IN_STRUCT_P (ref) || MEM_SCALAR_P (ref))
- return;
-
- /* If it is a reference into an aggregate, this is part of an aggregate.
- Otherwise we don't know. */
- else if (TREE_CODE (t) == COMPONENT_REF || TREE_CODE (t) == ARRAY_REF
- || TREE_CODE (t) == ARRAY_RANGE_REF
- || TREE_CODE (t) == BIT_FIELD_REF)
- MEM_IN_STRUCT_P (ref) = 1;
}
void
if (to_rtx == target)
to_rtx = copy_rtx (to_rtx);
- if (!MEM_SCALAR_P (to_rtx))
- MEM_IN_STRUCT_P (to_rtx) = 1;
if (!MEM_KEEP_ALIAS_SET_P (to_rtx) && MEM_ALIAS_SET (to_rtx) != 0)
set_mem_alias_set (to_rtx, alias_set);
/* If a type is specified, set the relevant flags. */
if (type != 0)
- {
- MEM_VOLATILE_P (slot) = TYPE_VOLATILE (type);
- gcc_checking_assert (!MEM_SCALAR_P (slot) && !MEM_IN_STRUCT_P (slot));
- if (AGGREGATE_TYPE_P (type) || TREE_CODE (type) == COMPLEX_TYPE)
- MEM_IN_STRUCT_P (slot) = 1;
- else
- MEM_SCALAR_P (slot) = 1;
- }
+ MEM_VOLATILE_P (slot) = TYPE_VOLATILE (type);
MEM_NOTRAP_P (slot) = 1;
return slot;
/* Copy over flags as appropriate. */
if (MEM_VOLATILE_P (if_info->a) || MEM_VOLATILE_P (if_info->b))
MEM_VOLATILE_P (tmp) = 1;
- if (MEM_IN_STRUCT_P (if_info->a) && MEM_IN_STRUCT_P (if_info->b))
- MEM_IN_STRUCT_P (tmp) = 1;
- if (MEM_SCALAR_P (if_info->a) && MEM_SCALAR_P (if_info->b))
- MEM_SCALAR_P (tmp) = 1;
if (MEM_ALIAS_SET (if_info->a) == MEM_ALIAS_SET (if_info->b))
set_mem_alias_set (tmp, MEM_ALIAS_SET (if_info->a));
set_mem_align (tmp,
if (reg_equiv_memory_loc (i))
MEM_COPY_ATTRIBUTES (reg, reg_equiv_memory_loc (i));
else
- {
- MEM_IN_STRUCT_P (reg) = MEM_SCALAR_P (reg) = 0;
- MEM_ATTRS (reg) = 0;
- }
+ MEM_ATTRS (reg) = 0;
MEM_NOTRAP_P (reg) = 1;
}
else if (reg_equiv_mem (i))
barrier.
1 in a CONCAT is VAL_NEEDS_RESOLUTION in var-tracking.c. */
unsigned int volatil : 1;
- /* 1 in a MEM referring to a field of an aggregate.
- 0 if the MEM was a variable or the result of a * operator in C;
- 1 if it was the result of a . or -> operator (on a struct) in C.
- 1 in a REG if the register is used only in exit code a loop.
+ /* 1 in a REG if the register is used only in exit code a loop.
1 in a SUBREG expression if was generated from a variable with a
promoted mode.
1 in a CODE_LABEL if the label is used for nonlocal gotos
together with the preceding insn. Valid only within sched.
1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and
from the target of a branch. Valid from reorg until end of compilation;
- cleared before used. */
+ cleared before used.
+
+ The name of the field is historical. It used to be used in MEMs
+ to record whether the MEM accessed part of a structure. */
unsigned int in_struct : 1;
/* At the end of RTL generation, 1 if this rtx is used. This is used for
copying shared structure. See `unshare_all_rtl'.
1 in a VALUE is VALUE_CHANGED in var-tracking.c. */
unsigned frame_related : 1;
/* 1 in a REG or PARALLEL that is the current function's return value.
- 1 in a MEM if it refers to a scalar.
1 in a SYMBOL_REF for a weak symbol.
1 in a CALL_INSN logically equivalent to ECF_PURE and DECL_PURE_P.
1 in a CONCAT is VAL_EXPR_HAS_REVERSE in var-tracking.c.
(RTL_FLAG_CHECK3("MEM_VOLATILE_P", (RTX), MEM, ASM_OPERANDS, \
ASM_INPUT)->volatil)
-/* 1 if RTX is a mem that refers to an aggregate, either to the
- aggregate itself or to a field of the aggregate. If zero, RTX may
- or may not be such a reference. */
-#define MEM_IN_STRUCT_P(RTX) \
- (RTL_FLAG_CHECK1("MEM_IN_STRUCT_P", (RTX), MEM)->in_struct)
-
-/* 1 if RTX is a MEM that refers to a scalar. If zero, RTX may or may
- not refer to a scalar. */
-#define MEM_SCALAR_P(RTX) \
- (RTL_FLAG_CHECK1("MEM_SCALAR_P", (RTX), MEM)->return_val)
-
/* 1 if RTX is a mem that cannot trap. */
#define MEM_NOTRAP_P(RTX) \
(RTL_FLAG_CHECK1("MEM_NOTRAP_P", (RTX), MEM)->call)
/* Copy the attributes that apply to memory locations from RHS to LHS. */
#define MEM_COPY_ATTRIBUTES(LHS, RHS) \
(MEM_VOLATILE_P (LHS) = MEM_VOLATILE_P (RHS), \
- MEM_IN_STRUCT_P (LHS) = MEM_IN_STRUCT_P (RHS), \
- MEM_SCALAR_P (LHS) = MEM_SCALAR_P (RHS), \
MEM_NOTRAP_P (LHS) = MEM_NOTRAP_P (RHS), \
MEM_READONLY_P (LHS) = MEM_READONLY_P (RHS), \
MEM_KEEP_ALIAS_SET_P (LHS) = MEM_KEEP_ALIAS_SET_P (RHS), \
+2012-01-24 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gcc.dg/memcpy-4.c: Don't expect /s on MEMs.
+
2012-01-24 Jason Merrill <jason@redhat.com>
PR c++/51812
__builtin_memcpy (p, "12345", 5);
}
-/* { dg-final { scan-rtl-dump "mem/s/u.*mem/s/u" "expand" { target mips*-*-* } } } */
+/* { dg-final { scan-rtl-dump "mem/u.*mem/u" "expand" { target mips*-*-* } } } */
/* { dg-final { cleanup-rtl-dump "expand" } } */