public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Fix {and,or}_comparisons_1 (PR bootstrap/49086)
@ 2011-05-20 22:12 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2011-05-20 22:12 UTC (permalink / raw)
  To: gcc-patches

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.

--- 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);

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-20 18:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20 22:12 [committed] Fix {and,or}_comparisons_1 (PR bootstrap/49086) Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).