[PATCH][RFC] Replace assignment in gcc_assert with comparison

Dirk Mueller dmueller@suse.de
Sat Jun 9 09:08:00 GMT 2007


On Friday, 8. June 2007, Mark Mitchell wrote:
> > 	* tree-flow-inline.h (var_ann): Replaced erroneous '=' assignment
> > 	in gcc_assert() with '==' comparison.
> Good catch; this is OK.

There are some more cases like that: 

2007-06-07  Dirk Mueller  <dmueller@suse.de>

        * trans-stmt.c (gfc_trans_call): fix gcc_assert to
        a comparison, not an assignment.

        * optabls.c (debug_optab_libfuncs): fix gcc_assert to
        a comparison, not an assignment.

--- fortran/trans-stmt.c
+++ fortran/trans-stmt.c
@@ -387,8 +387,8 @@ gfc_trans_call (gfc_code * code, bool de
 	{
 	  gfc_symbol *sym;
 	  sym = code->resolved_sym;
-	  gcc_assert (sym->formal->sym->attr.intent = INTENT_OUT);
-	  gcc_assert (sym->formal->next->sym->attr.intent = INTENT_IN);
+	  gcc_assert (sym->formal->sym->attr.intent == INTENT_OUT);
+	  gcc_assert (sym->formal->next->sym->attr.intent == INTENT_IN);
 	  gfc_conv_elemental_dependencies (&se, &loopse, sym,
 					   code->ext.actual);
 	}
--- optabs.c
+++ optabs.c
@@ -5817,7 +5817,7 @@ debug_optab_libfuncs (void)
 	h = &o->handlers[j];
 	if (h->libfunc)
 	  {
-	    gcc_assert (GET_CODE (h->libfunc) = SYMBOL_REF);
+	    gcc_assert (GET_CODE (h->libfunc) == SYMBOL_REF);
 	    fprintf (stderr, "%s\t%s:\t%s\n",
 		     GET_RTX_NAME (o->code),
 		     GET_MODE_NAME (j),
@@ -5837,7 +5837,7 @@ debug_optab_libfuncs (void)
 	  h = &o->handlers[j][k];
 	  if (h->libfunc)
 	    {
-	      gcc_assert (GET_CODE (h->libfunc) = SYMBOL_REF);
+	      gcc_assert (GET_CODE (h->libfunc) == SYMBOL_REF);
 	      fprintf (stderr, "%s\t%s\t%s:\t%s\n",
 		       GET_RTX_NAME (o->code),
 		       GET_MODE_NAME (j),




-- 



More information about the Gcc-patches mailing list