diff mbox

[committed] Fix {and,or}_comparisons_1 (PR bootstrap/49086)

Message ID 20110520182629.GT17079@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek May 20, 2011, 6:26 p.m. UTC
Hi!

My patch apparently broke darwin bootstrap as well as Mozilla LTO build.
SSA_NAME_IS_DEFAULT_DEF has NULL gimple_bb, so dominated_by_p would
crash.  As {and,or}_var_with_comparison return NULL immediately for
SSA_NAME_IS_DEFAULT_DEF (empty stmt is not is_gimple_assign), we can return
NULL right away instead of bypassing the dominance check and then returning
NULL.

Committed as obvious to trunk/4.6.

2011-05-20  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/49086
	* gimple-fold.c (and_comparisons_1, or_comparisons_1): Return NULL
	for PHI args that are SSA_NAME_IS_DEFAULT_DEF.


	Jakub
diff mbox

Patch

--- gcc/gimple-fold.c.jj	2011-05-20 11:05:11.000000000 +0200
+++ gcc/gimple-fold.c	2011-05-20 20:04:52.000000000 +0200
@@ -2276,7 +2276,8 @@  and_comparisons_1 (enum tree_code code1,
 							code2, op2a, op2b))
 			return NULL_TREE;
 		    }
-		  else if (TREE_CODE (arg) == SSA_NAME)
+		  else if (TREE_CODE (arg) == SSA_NAME
+			   && !SSA_NAME_IS_DEFAULT_DEF (arg))
 		    {
 		      tree temp;
 		      gimple def_stmt = SSA_NAME_DEF_STMT (arg);
@@ -2737,7 +2738,8 @@  or_comparisons_1 (enum tree_code code1, 
 							code2, op2a, op2b))
 			return NULL_TREE;
 		    }
-		  else if (TREE_CODE (arg) == SSA_NAME)
+		  else if (TREE_CODE (arg) == SSA_NAME
+			   && !SSA_NAME_IS_DEFAULT_DEF (arg))
 		    {
 		      tree temp;
 		      gimple def_stmt = SSA_NAME_DEF_STMT (arg);