]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-sra.c (create_access_replacement): Only rename the replacement if we can rewrite...
authorRichard Guenther <rguenther@suse.de>
Mon, 12 Mar 2012 10:43:17 +0000 (10:43 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 12 Mar 2012 10:43:17 +0000 (10:43 +0000)
2012-03-12  Richard Guenther  <rguenther@suse.de>

        * tree-sra.c (create_access_replacement): Only rename the
        replacement if we can rewrite it into SSA form.  Properly
        mark register typed replacements that we cannot rewrite
        with TREE_ADDRESSABLE.
* tree-cfg.c (verify_expr): Fix BIT_FIELD_REF verification
for aggregate or BLKmode results.

From-SVN: r185221

gcc/ChangeLog
gcc/tree-cfg.c
gcc/tree-sra.c

index da514e8a93533ca234d39f8fdfd5f0528670b017..b35706a8faccf2974d6ea755ba38e8355e1dc8ed 100644 (file)
@@ -1,3 +1,12 @@
+2012-03-12  Richard Guenther  <rguenther@suse.de>
+
+        * tree-sra.c (create_access_replacement): Only rename the
+        replacement if we can rewrite it into SSA form.  Properly
+        mark register typed replacements that we cannot rewrite
+        with TREE_ADDRESSABLE.
+       * tree-cfg.c (verify_expr): Fix BIT_FIELD_REF verification
+       for aggregate or BLKmode results.
+
 2012-03-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/52533
index 9f75650d7a798bb516dcc7e35c5d8fc4424278fb..eb7b62a72c504999d208dba4f94062daf61eef6a 100644 (file)
@@ -2790,17 +2790,19 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
                  error ("invalid position or size operand to BIT_FIELD_REF");
                  return t;
                }
-             else if (INTEGRAL_TYPE_P (TREE_TYPE (t))
-                      && (TYPE_PRECISION (TREE_TYPE (t))
-                          != TREE_INT_CST_LOW (TREE_OPERAND (t, 1))))
+             if (INTEGRAL_TYPE_P (TREE_TYPE (t))
+                 && (TYPE_PRECISION (TREE_TYPE (t))
+                     != TREE_INT_CST_LOW (TREE_OPERAND (t, 1))))
                {
                  error ("integral result type precision does not match "
                         "field size of BIT_FIELD_REF");
                  return t;
                }
-             if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
-                 && (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (t)))
-                     != TREE_INT_CST_LOW (TREE_OPERAND (t, 1))))
+             else if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
+                      && !AGGREGATE_TYPE_P (TREE_TYPE (t))
+                      && TYPE_MODE (TREE_TYPE (t)) != BLKmode
+                      && (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (t)))
+                          != TREE_INT_CST_LOW (TREE_OPERAND (t, 1))))
                {
                  error ("mode precision of non-integral result does not "
                         "match field size of BIT_FIELD_REF");
index 710f24eeba6bb13cf7a63f75dd3acbbc64441d21..65267a92f831d5a795808b37b4b532518543e8de 100644 (file)
@@ -1924,13 +1924,19 @@ create_access_replacement (struct access *access, bool rename)
 
   repl = create_tmp_var (access->type, "SR");
   add_referenced_var (repl);
-  if (rename)
+  if (!access->grp_partial_lhs
+      && rename)
     mark_sym_for_renaming (repl);
 
-  if (!access->grp_partial_lhs
-      && (TREE_CODE (access->type) == COMPLEX_TYPE
-         || TREE_CODE (access->type) == VECTOR_TYPE))
-    DECL_GIMPLE_REG_P (repl) = 1;
+  if (TREE_CODE (access->type) == COMPLEX_TYPE
+      || TREE_CODE (access->type) == VECTOR_TYPE)
+    {
+      if (!access->grp_partial_lhs)
+       DECL_GIMPLE_REG_P (repl) = 1;
+    }
+  else if (access->grp_partial_lhs
+          && is_gimple_reg_type (access->type))
+    TREE_ADDRESSABLE (repl) = 1;
 
   DECL_SOURCE_LOCATION (repl) = DECL_SOURCE_LOCATION (access->base);
   DECL_ARTIFICIAL (repl) = 1;