This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, fortran] Fix PR 50690
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 8 Dec 2011 21:02:18 +0100
- Subject: Re: [patch, fortran] Fix PR 50690
- References: <4EE1148F.8000408@netcologne.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Dec 08, 2011 at 08:48:31PM +0100, Thomas Koenig wrote:
> /* Entry point - run all passes for a namespace. So far, only an
> optimization pass is run. */
>
> @@ -76,12 +83,15 @@ gfc_run_passes (gfc_namespace *ns)
> {
> expr_size = 20;
> expr_array = XNEWVEC(gfc_expr **, expr_size);
> + omp_size = 20;
> + omp_block = XCNEWVEC(gfc_code *, omp_size);
Both of these arrays should be really vec.h vectors, it doesn't
make any sense to handcode the same thing everywhere.
You can then start with NULL vectors and push something using VEC_safe_push
only when needed and let it handle reallocation etc.
Jakub