[gfortran,committed] Fix PR31781: side effect in a gcc_assert() argument

François-Xavier Coudert fxcoudert@gmail.com
Fri May 4 09:29:00 GMT 2007


Hi all,

I committed the attached patch to fix PR31781, a breakage for
--disable-checking builds following my reworking of the REPEAT
simplification: I put a function call with side effect in the argument
of gcc_assert(), and the code was evaluated for non-checking
compilers. Committed as obvious after bootstrapping and regtesting on
i686-linux.

FX


2007-05-04  Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>

        PR fortran/31781
        * simplify.c (gfc_simplify_repeat): Don't put function call with
        side effect in a gcc_assert().



Index: simplify.c
===================================================================
--- simplify.c  (revision 124411)
+++ simplify.c  (working copy)
@@ -2919,7 +2919,10 @@ gfc_simplify_repeat (gfc_expr *e, gfc_ex
     return NULL;

   if (mpz_sgn (e->ts.cl->length->value.integer) != 0)
-    gcc_assert (gfc_extract_int (n, &ncop) == NULL);
+    {
+      const char *res = gfc_extract_int (n, &ncop);
+      gcc_assert (res == NULL);
+    }
   else
     ncop = 0;



More information about the Fortran mailing list