]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rtl.texi (MEM_IN_STRUCT_P, [...]): Delete.
authorRichard Sandiford <rdsandiford@googlemail.com>
Tue, 24 Jan 2012 19:06:38 +0000 (19:06 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 24 Jan 2012 19:06:38 +0000 (19:06 +0000)
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.

From-SVN: r183486

13 files changed:
gcc/ChangeLog
gcc/cfgexpand.c
gcc/config/alpha/alpha.c
gcc/config/m32c/m32c.c
gcc/doc/rtl.texi
gcc/emit-rtl.c
gcc/expr.c
gcc/function.c
gcc/ifcvt.c
gcc/reload1.c
gcc/rtl.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/memcpy-4.c

index 78160ad817217c01f3b0fd8fbb31936d9a6dea15..82ba50f9d65d9c5b597f45bdfa4ab0877211474e 100644 (file)
@@ -1,3 +1,21 @@
+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
index 9f0797ce05020433d6fce54a66b3723f42409edd..6d31e90f08623719a9da37bd68f32b9de9232e6d 100644 (file)
@@ -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)
index 2d3b62c753e6e74c1c2e18b34990afe4a02384fb..8e2a5cdf1dd6ed6643c8d916cc7d9b16eef4ffff 100644 (file)
@@ -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;
index d86a618b02828186b0dfccc02821b1302e3ebb84..57586474d9cbf45dbe3a305f94484e1493115bbd 100644 (file)
@@ -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;
 }  
 
index 4cb51eec1aa5bfe050cc57f6a3b056e727cfafeb..7e9e535abb5452a3014538252b13c2ad62eb9552 100644 (file)
@@ -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.
index 452e99a374551bd9b40362f03f80c15bc4d4c002..765dd942ad015fb27bf644d8426b983405566b76 100644 (file)
@@ -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
index df8bceb0f4862c859d6ec13e88663768e39c5ba5..bd2f6b18f7c5a06d32ee1117c0ffedefb8a05386 100644 (file)
@@ -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);
 
index 94e51f401c3c7e693feb93d20dac78410c5e90e1..4508ae22de41af6e17d9f3cac5bb2eb2e569377d 100644 (file)
@@ -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;
index ce60ce27604e550df61edef619979964d150aa16..8d81c8913da48f024c592475d88cada52a2e59e5 100644 (file)
@@ -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,
index 883ddd7b292e5e42d4a711cef029de9774f7211f..f9abf723152d2b9521283e1a522c193e4b5b9269 100644 (file)
@@ -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))
index 858224da74c44d700dba79b433905b9a9087921e..b1b681be568261899cd910c0e695a3181ac23b8b 100644 (file)
--- 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),    \
index b97bf39b3538f10b07d85badafab363f0eb31f35..2fdb6743165185a690bbdf550ce0792111a7d49a 100644 (file)
@@ -1,3 +1,7 @@
+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
index 80a943bdb78813d5c781c0dafe9cf5007a02b8d3..cff477a981e3f1893e508f477fa68310d3aa1f78 100644 (file)
@@ -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" } } */