[fortran-dev] constructor work, part I; updated

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Sun Dec 27 16:02:00 GMT 2009


Hi,

I had a cursory look through your patch for potentially changed 
semantics that may lead to your problems, and I found this:

On 2009-12-24 03:23, Daniel Franke wrote:
>   	for (n = 0; n<  (int)mpz_get_si (size); n++)
> -		{
> -		  if (array->value.constructor == NULL)
> -		    {
> -		      array->value.constructor = c = gfc_get_constructor ();
> -		      c->expr = init;
> -		    }
> -		  else
> -		    {
> -		      c->next = gfc_get_constructor ();
> -		      c = c->next;
> -		      c->expr = gfc_copy_expr (init);
> -		    }
> -		}
> +		gfc_constructor_append_expr (&array->value.constructor,
> +					     gfc_copy_expr (init),
> +					&init->where);
>

Note that the original code didn't copy the expression the first time. 
I don't see how this could lead to the large numbers of NULs being 
emitted, but it's probably not a change you'd want anyway.

Cheers,
- Tobi



More information about the Fortran mailing list