This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [gfortran] patch for pr 21130 - 38822 lines of Fortran 90 takes more than 10 minutes to compile on a dual 3GHz P4 Linux box with lots of RAM


paul,

excellent.  i attempted to do exactly what you did,
but was a little flumoxed by the recursive nature of
the beast....thus my use of the additional 'count'
variable.

let me spend a day or two looking at it, then i will
submit a revised patch.

--bud


--- Paul Thomas <paulthomas2@wanadoo.fr> wrote:

> Bud,
> 
> Upon further reflection, the attached patch, which
> is a simplified 
> version of yours, achieves the same result.  There
> is no need to count 
> the remaining symbols but the premature returns
> should be stopped.  
> Thus, taking an or of the result does the business.
> 
> Regards
> 
> Paul
> > Index: gcc/fortran/module.c
>
===================================================================
> *** gcc/fortran/module.c	(revision 112441)
> --- gcc/fortran/module.c	(working copy)
> *************** load_needed (pointer_info * p)
> *** 3061,3076 ****
>     gfc_namespace *ns;
>     pointer_info *q;
>     gfc_symbol *sym;
>   
>     if (p == NULL)
> !     return 0;
> !   if (load_needed (p->left))
> !     return 1;
> !   if (load_needed (p->right))
> !     return 1;
>   
>     if (p->type != P_SYMBOL || p->u.rsym.state !=
> NEEDED)
> !     return 0;
>   
>     p->u.rsym.state = USED;
>   
> --- 3061,3077 ----
>     gfc_namespace *ns;
>     pointer_info *q;
>     gfc_symbol *sym;
> +   int rv;
>   
> +   rv = 0;
>     if (p == NULL)
> !     return rv;
> ! 
> !   rv |= load_needed (p->left);
> !   rv |= load_needed (p->right);
>   
>     if (p->type != P_SYMBOL || p->u.rsym.state !=
> NEEDED)
> !     return rv;
>   
>     p->u.rsym.state = USED;
>   
> 


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