[middle-end,trivial?] Use error_operand_p in gimplify_expr

Message ID 8a954162-20ad-925b-e0cd-6a14eca3b210@oracle.com
State New
Headers show
Series
  • [middle-end,trivial?] Use error_operand_p in gimplify_expr
Related show

Commit Message

Paolo Carlini Dec. 19, 2017, 10:36 a.m.
Hi,

was working on a couple of bugs and noticed what looks like a case of 
error_operand_p with a redundant check that TREE_TYPE is non-null. 
Barring objections I'm going to commit the below.

Thanks, Paolo.

///////////////////////
2017-19-12  Paolo Carlini  <paolo.carlini@oracle.com>

	* gimplify.c (gimplify_expr): Use error_operand_p.

Comments

Richard Biener Dec. 19, 2017, 10:39 a.m. | #1
On Tue, 19 Dec 2017, Paolo Carlini wrote:

> Hi,

> 

> was working on a couple of bugs and noticed what looks like a case of

> error_operand_p with a redundant check that TREE_TYPE is non-null. Barring

> objections I'm going to commit the below.


LGTM.

> Thanks, Paolo.

> 

> ///////////////////////

> 

> 


-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

Patch

Index: gimplify.c
===================================================================
--- gimplify.c	(revision 255811)
+++ gimplify.c	(working copy)
@@ -11334,9 +11334,7 @@  gimplify_expr (tree *expr_p, gimple_seq *pre_p, gi
       save_expr = *expr_p;
 
       /* Die, die, die, my darling.  */
-      if (save_expr == error_mark_node
-	  || (TREE_TYPE (save_expr)
-	      && TREE_TYPE (save_expr) == error_mark_node))
+      if (error_operand_p (save_expr))
 	{
 	  ret = GS_ERROR;
 	  break;