This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
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
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: Bud Davis <bdavis9659 at sbcglobal dot net>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Wed, 29 Mar 2006 10:59:05 +0200
- Subject: 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
- References: <20060329014607.31223.qmail@web81212.mail.mud.yahoo.com> <442A3121.4070405@wanadoo.fr>
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;