This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: PR fortran/33276: [4.3 Regression] 465.tonto in SPEC CPU 2006 fails to compile
- From: "H.J. Lu" <hjl at lucon dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org
- Date: Sat, 1 Sep 2007 16:10:45 -0700
- Subject: PATCH: PR fortran/33276: [4.3 Regression] 465.tonto in SPEC CPU 2006 fails to compile
frame.prev in expand_iterator may be uninitialized. In expand_iterator,
there are
cleanup:
gfc_free_expr (start);
gfc_free_expr (end);
gfc_free_expr (step);
mpz_clear (trip);
mpz_clear (frame.value);
iter_stack = frame.prev;
return t;
}
But frame.prev may be uninitialized when one of goto cleanup is called.
This patch initializes frame.prev. Shouldn't gcc warn about this?
H.J.
---
2007-09-01 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/33276
* array.c (expand_iterator): Initialize frame.prev.
--- gcc/fortran/array.c.foo 2007-08-01 17:14:30.000000000 -0700
+++ gcc/fortran/array.c 2007-09-01 15:57:03.000000000 -0700
@@ -1281,6 +1281,7 @@ expand_iterator (gfc_constructor *c)
mpz_init (trip);
mpz_init (frame.value);
+ frame.prev = NULL;
start = gfc_copy_expr (c->iterator->start);
if (gfc_simplify_expr (start, 1) == FAILURE)