]> gcc.gnu.org Git - gcc.git/commitdiff
re PR middle-end/56483 (LTO issue with expanding GIMPLE_COND)
authorRichard Biener <rguenther@suse.de>
Mon, 18 Mar 2013 10:29:43 +0000 (10:29 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 18 Mar 2013 10:29:43 +0000 (10:29 +0000)
2013-03-18  Richard Biener  <rguenther@suse.de>

PR middle-end/56483
* cfgexpand.c (expand_gimple_cond): Inline gimple_cond_single_var_p
and implement properly.
* gimple.h (gimple_cond_single_var_p): Remove.

From-SVN: r196776

gcc/ChangeLog
gcc/cfgexpand.c
gcc/gimple.h

index 4d9203f06a489e5c35d102cbe965e5980ae1259f..796eab74b415f93e0852bab7bfa280f66e6e4b25 100644 (file)
@@ -1,3 +1,10 @@
+2013-03-18  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/56483
+       * cfgexpand.c (expand_gimple_cond): Inline gimple_cond_single_var_p
+       and implement properly.
+       * gimple.h (gimple_cond_single_var_p): Remove.
+
 2013-03-18  Richard Biener  <rguenther@suse.de>
 
        * tree-data-ref.h (find_data_references_in_loop): Declare.
index 5acc42d73f544d2c95174c2941220a913b3fbc5e..7242b2107f4da2410559d998fc0267a8df1f48a2 100644 (file)
@@ -1886,9 +1886,14 @@ expand_gimple_cond (basic_block bb, gimple stmt)
      be cleaned up by combine.  But some pattern matchers like if-conversion
      work better when there's only one compare, so make up for this
      here as special exception if TER would have made the same change.  */
-  if (gimple_cond_single_var_p (stmt)
-      && SA.values
+  if (SA.values
       && TREE_CODE (op0) == SSA_NAME
+      && TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE
+      && TREE_CODE (op1) == INTEGER_CST
+      && ((gimple_cond_code (stmt) == NE_EXPR
+          && integer_zerop (op1))
+         || (gimple_cond_code (stmt) == EQ_EXPR
+             && integer_onep (op1)))
       && bitmap_bit_p (SA.values, SSA_NAME_VERSION (op0)))
     {
       gimple second = SSA_NAME_DEF_STMT (op0);
index 1bbd7d76a11ad83e9ef7568069a2e99db5a511e1..475d2ea9ee775907c1b213f6dae48259b133a441 100644 (file)
@@ -2750,23 +2750,6 @@ gimple_cond_false_p (const_gimple gs)
   return false;
 }
 
-/* Check if conditional statement GS is of the form 'if (var != 0)' or
-   'if (var == 1)' */
-
-static inline bool
-gimple_cond_single_var_p (gimple gs)
-{
-  if (gimple_cond_code (gs) == NE_EXPR
-      && gimple_cond_rhs (gs) == boolean_false_node)
-    return true;
-
-  if (gimple_cond_code (gs) == EQ_EXPR
-      && gimple_cond_rhs (gs) == boolean_true_node)
-    return true;
-
-  return false;
-}
-
 /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS.  */
 
 static inline void
This page took 0.075435 seconds and 5 git commands to generate.