This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]