tree.h (tree_invariant_p): Declare.
authorRichard Biener <rguenther@suse.de>
Wed, 2 Dec 2015 14:50:32 +0000 (14:50 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 2 Dec 2015 14:50:32 +0000 (14:50 +0000)
2015-12-02  Richard Biener  <rguenther@suse.de>

* tree.h (tree_invariant_p): Declare.
* tree.c (tree_invariant_p): Export.
* genmatch.c (dt_simplify::gen_1): For GENERIC code-gen never
create SAVE_EXPRs but reject patterns if we would need to.

From-SVN: r231178

gcc/ChangeLog
gcc/genmatch.c
gcc/tree.c
gcc/tree.h

index 2c30b300006a52b6131482e50148c7e46f8fdaa5..68e4f81fc40d179447adbbc2d86a5b7b85bd36ba 100644 (file)
@@ -1,3 +1,10 @@
+2015-12-02  Richard Biener  <rguenther@suse.de>
+
+       * tree.h (tree_invariant_p): Declare.
+       * tree.c (tree_invariant_p): Export.
+       * genmatch.c (dt_simplify::gen_1): For GENERIC code-gen never
+       create SAVE_EXPRs but reject patterns if we would need to.
+
 2015-12-02  Tom de Vries  <tom@codesourcery.com>
 
        * tree-ssa-structalias.c (find_func_aliases_for_builtin_call)
index 16a4f35a1c3c9201d87030070ee7903354fffc92..ef39cb0f32b2810c07d7a5fa78421eaded55598a 100644 (file)
@@ -3119,8 +3119,8 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result)
                if (cinfo.info[i].result_use_count
                    > cinfo.info[i].match_use_count)
                  fprintf_indent (f, indent,
-                                 "captures[%d] = save_expr (captures[%d]);\n",
-                                 i, i);
+                                 "if (! tree_invariant_p (captures[%d])) "
+                                 "return NULL_TREE;\n", i);
              }
          for (unsigned j = 0; j < e->ops.length (); ++j)
            {
index 4f7ce7e507024e7c9080c00930f9c1f2185373c6..587bd7457df3a7fb3b03dfa378f86f02171aa0ff 100644 (file)
@@ -3231,8 +3231,6 @@ decl_address_ip_invariant_p (const_tree op)
    not handle arithmetic; that's handled in skip_simple_arithmetic and
    tree_invariant_p).  */
 
-static bool tree_invariant_p (tree t);
-
 static bool
 tree_invariant_p_1 (tree t)
 {
@@ -3282,7 +3280,7 @@ tree_invariant_p_1 (tree t)
 
 /* Return true if T is function-invariant.  */
 
-static bool
+bool
 tree_invariant_p (tree t)
 {
   tree inner = skip_simple_arithmetic (t);
index 0c1602ee7def4ad59dfc8164fef3edf4296f432c..a60e9dd31cbd796cdb1c9c8ae59a2b2ef332fe26 100644 (file)
@@ -4320,6 +4320,10 @@ extern tree staticp (tree);
 
 extern tree save_expr (tree);
 
+/* Return true if T is function-invariant.  */
+
+extern bool tree_invariant_p (tree);
+
 /* Look inside EXPR into any simple arithmetic operations.  Return the
    outermost non-arithmetic or non-invariant node.  */