From 402f6a9e6b225e401135286881427884dad42680 Mon Sep 17 00:00:00 2001 From: rsandifo Date: Tue, 24 Jan 2012 19:06:38 +0000 Subject: [PATCH] gcc/ * 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. gcc/testsuite/ * gcc.dg/memcpy-4.c: Don't expect /s on MEMs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183486 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 18 +++++++++ gcc/cfgexpand.c | 3 +- gcc/config/alpha/alpha.c | 4 -- gcc/config/m32c/m32c.c | 90 ++--------------------------------------- gcc/doc/rtl.texi | 32 --------------- gcc/emit-rtl.c | 20 --------- gcc/expr.c | 2 - gcc/function.c | 9 +---- gcc/ifcvt.c | 4 -- gcc/reload1.c | 5 +-- gcc/rtl.h | 24 +++-------- gcc/testsuite/ChangeLog | 4 ++ gcc/testsuite/gcc.dg/memcpy-4.c | 2 +- 13 files changed, 34 insertions(+), 183 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 78160ad8172..82ba50f9d65 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,23 @@ 2012-01-24 Richard Sandiford + * 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 + * rtl.h (true_dependence, canon_true_dependence): Remove varies parameter. * alias.c (fixed_scalar_and_varying_struct_p): Delete. diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 9f0797ce050..6d31e90f086 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -357,8 +357,7 @@ aggregate_contains_union_type (tree type) 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) diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 2d3b62c753e..8e2a5cdf1dd 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -1489,8 +1489,6 @@ alpha_set_memflags_1 (rtx *xp, void *data) 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); @@ -1520,8 +1518,6 @@ alpha_set_memflags (rtx seq, rtx ref) 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; diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index d86a618b028..57586474d9c 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -3475,95 +3475,11 @@ m32c_mov_ok (rtx * operands, enum machine_mode mode ATTRIBUTE_UNUSED) 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; } diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi index 4cb51eec1aa..7e9e535abb5 100644 --- a/gcc/doc/rtl.texi +++ b/gcc/doc/rtl.texi @@ -669,17 +669,6 @@ In @code{label_ref} and @code{reg_label} expressions, nonzero if this is 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} @@ -689,18 +678,6 @@ mem unchanged when we access a component. Set to 1, for example, when we 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} @@ -944,12 +921,6 @@ In an RTL dump, this flag is represented as @samp{/f}. @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. @@ -986,9 +957,6 @@ machines that pass parameters in registers, the same register number 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. diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 452e99a3745..765dd942ad0 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1572,17 +1572,8 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, 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) @@ -1854,17 +1845,6 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, /* 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 diff --git a/gcc/expr.c b/gcc/expr.c index df8bceb0f48..bd2f6b18f7c 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6429,8 +6429,6 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos, 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); diff --git a/gcc/function.c b/gcc/function.c index 94e51f401c3..4508ae22de4 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -939,14 +939,7 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, /* 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; diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index ce60ce27604..8d81c8913da 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -1667,10 +1667,6 @@ noce_try_cmove_arith (struct noce_if_info *if_info) /* 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, diff --git a/gcc/reload1.c b/gcc/reload1.c index 883ddd7b292..f9abf723152 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -1111,10 +1111,7 @@ reload (rtx first, int global) 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)) diff --git a/gcc/rtl.h b/gcc/rtl.h index 858224da74c..b1b681be568 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -296,10 +296,7 @@ struct GTY((chain_next ("RTX_NEXT (&%h)"), 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 @@ -308,7 +305,10 @@ struct GTY((chain_next ("RTX_NEXT (&%h)"), 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'. @@ -328,7 +328,6 @@ struct GTY((chain_next ("RTX_NEXT (&%h)"), 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. @@ -1335,17 +1334,6 @@ do { \ (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) @@ -1404,8 +1392,6 @@ do { \ /* 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), \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b97bf39b353..2fdb6743165 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2012-01-24 Richard Sandiford + + * gcc.dg/memcpy-4.c: Don't expect /s on MEMs. + 2012-01-24 Jason Merrill PR c++/51812 diff --git a/gcc/testsuite/gcc.dg/memcpy-4.c b/gcc/testsuite/gcc.dg/memcpy-4.c index 80a943bdb78..cff477a981e 100644 --- a/gcc/testsuite/gcc.dg/memcpy-4.c +++ b/gcc/testsuite/gcc.dg/memcpy-4.c @@ -10,5 +10,5 @@ f1 (char *p) __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" } } */ -- 2.11.0