Patchwork One forgotten sanity check in gimple.h

login
register
mail settings
Submitter Jan Hubicka
Date June 22, 2010, 5:08 p.m.
Message ID <20100622170822.GD15547@kam.mff.cuni.cz>
Download mbox | patch
Permalink /patch/56536/
State New
Headers show

Comments

Jan Hubicka - June 22, 2010, 5:08 p.m.
Hi,
in gimple.h I missed one sanity check that is rather common.  It is because it is done
using gcc_unreachable.  Fixed by the following patch comitted as obvious.

Honza

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 161205)
+++ ChangeLog	(working copy)
@@ -1,5 +1,9 @@ 
 2010-06-22  Jan Hubicka  <jh@suse.cz>
 
+	* gimple.h (gimple_expr_code): Do checking on when gimple checking is enabled.
+
+2010-06-22  Jan Hubicka  <jh@suse.cz>
+
 	* df-problems.c (df_rd_confluence_n, df_lr_confluence_n, df_live_confluence_n,
 	df_byte_lr_confluence_n, df_md_confluence_n): Return true if something changed.
 	* df.h (df_confluence_function_n): Return bool.
Index: gimple.h
===================================================================
--- gimple.h	(revision 161189)
+++ gimple.h	(working copy)
@@ -1464,10 +1464,11 @@  gimple_expr_code (const_gimple stmt)
   enum gimple_code code = gimple_code (stmt);
   if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
     return (enum tree_code) stmt->gsbase.subcode;
-  else if (code == GIMPLE_CALL)
-    return CALL_EXPR;
   else
-    gcc_unreachable ();
+    {
+      gcc_gimple_checking_assert (code == GIMPLE_CALL);
+      return CALL_EXPR;
+    }
 }