[Bug c/60819] dse1 removing not-dead insn (aliasing issue?)

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Apr 11 12:23:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60819

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Btw, eventually better representation:

Index: gcc/c-family/c-common.c
===================================================================
--- gcc/c-family/c-common.c     (revision 209298)
+++ gcc/c-family/c-common.c     (working copy)
@@ -11760,20 +11760,18 @@ convert_vector_to_pointer_for_subscript
 {
   if (TREE_CODE (TREE_TYPE (*vecp)) == VECTOR_TYPE)
     {
-      tree type = TREE_TYPE (*vecp);
-      tree type1;
+      tree vtype = TREE_TYPE (*vecp);
+      tree type;

       if (TREE_CODE (index) == INTEGER_CST)
         if (!tree_fits_uhwi_p (index)
-            || tree_to_uhwi (index) >= TYPE_VECTOR_SUBPARTS (type))
+            || tree_to_uhwi (index) >= TYPE_VECTOR_SUBPARTS (vtype))
           warning_at (loc, OPT_Warray_bounds, "index value is out of bound");

       c_common_mark_addressable_vec (*vecp);
-      type = build_qualified_type (TREE_TYPE (type), TYPE_QUALS (type));
-      type = build_pointer_type (type);
-      type1 = build_pointer_type (TREE_TYPE (*vecp));
-      *vecp = build1 (ADDR_EXPR, type1, *vecp);
-      *vecp = convert (type, *vecp);
+      type = build_qualified_type (TREE_TYPE (vtype), TYPE_QUALS (vtype));
+      type = build_array_type_nelts (type, TYPE_VECTOR_SUBPARTS (vtype));
+      *vecp = build1 (VIEW_CONVERT_EXPR, type, *vecp);
     }
 }

which defers the "issue" to RTL expansion, expanding from

  _3 = VIEW_CONVERT_EXPR<short int[4]>(__A_5(D))[__N_2(D)];
  _4 = (int) _3;
  return _4;



More information about the Gcc-bugs mailing list