This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran,committed] Fix PR31781: side effect in a gcc_assert() argument
- From: "François-Xavier Coudert" <fxcoudert at gmail dot com>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 4 May 2007 11:29:14 +0200
- Subject: [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;