This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: g77 fails to compile 15000+ line expression, was: tail recursion


Wilhelm B. Kloke wrote:

> I have a 2nd problem not related to this (but also coming from
> machine generated programs). I have a colleague who tries to solve
> large systems of differential equations using a package outputting
> FORTRAN. Some of the modules choke either g77 or gcc (when f2c was
> used) by just having a real long sequence of simple assignments
> to elements of matrices, sometimes even with optimization disabled.
> 
> Here is an example line (FORTRAN):
>       AMAT(495) = SUB(7128)*SUB(333)+SUB(7117)*SUB(354)+SUB(7129)
>      &*SUB(349)+SUB(7130)*SUB(333)+SUB(7116)*SUB(354)+SUB(7131)*SUB(349)
>      &+SUB(7132)*SUB(333)+SUB(7115)*SUB(354)+SUB(7133)*SUB(349)
>      &+SUB(7134)*SUB(333)+SUB(7114)*SUB(354)+SUB(7135)*SUB(349)
>      &+SUB(7136)*SUB(333)+SUB(7113)*SUB(354)+SUB(7137)*SUB(349)
>      &+SUB(7138)*SUB(333)+SUB(7112)*SUB(354)+SUB(7139)*SUB(349)
>      &+SUB(7140)*SUB(333)+SUB(7111)*SUB(354)+SUB(7141)*SUB(349)
>      &+SUB(7142)*SUB(333)+SUB(7110)*SUB(354)+SUB(7143)*SUB(349)
>      &+SUB(7144)*SUB(333)+SUB(7109)*SUB(354)+SUB(7145)*SUB(349)
>      &+SUB(7146)*SUB(333)+SUB(7107)*SUB(354)+SUB(7147)*SUB(349)
>      &+SUB(7148)*SUB(333)+SUB(7108)*SUB(354)+SUB(7149)*SUB(349)
>      &+SUB(7208)
> 
> There seem to be more then 15000 lines of such code.
> 
> Perhaps this bug (LCC does compile the stuff, e.g.) indicates
> a general problem with memory management inside gcc.

That could be a cause.  However, to investigate this, we need an example
that is a complete subprogram (i.e. a complete compilation unit), as
Richard Henderson already indicated.

You could investigate for yourself by trying to compile this generated
code with a recent snapshot of gcc (see
ftp://gcc.gnu.org/pub/gcc/snapshots/index.html), as these use a
completely different memory management paradigm.

Hope this helps,

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://gcc.gnu.org/onlinedocs/g77_news.html


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