https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91512

--- Comment #17 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Simply passing on a huge number of arguments is not enough to trigger this.

Here's a perl script to generate test cases:

while ($n=shift)
{
    open FOO, ">foo-$n.f90";

    print FOO <<EOF;
module foo
  implicit none
contains
EOF

    print FOO "subroutine foo_proc";
    for ($i=0; $i<$n; $i++)
    {
        push (@var, "a" . sprintf("%3.3d", $i));
    }

    @call = ();
    push (@call, "(");

    for ($i=0; $i<$n-1; $i++)
    {
        push (@call, "&\n  ") if ($i%10 == 0);
        push (@call, $var[$i] . ", ");
    }
    push (@call, $var[$n-1],")\n");
    print FOO @call;

    for ($i=0; $i<$n; $i++)
    {
        print FOO "  real, dimension(:,:) :: $var[$i]\n";
    }

    print FOO "  call bar";
    print FOO @call;
    print FOO "  end subroutine\n";
    print FOO "end module\n";
}

Running this script with

for a in 50 100 200 500 1000; do perl gener.pl $a; echo -n "$a "; /usr/bin/time
-f "%e %M" gfortran -c -O2 foo-$a.f90; done

gave me

50 3.21 272668
100 8.44 581860
200 20.15 1046780
500 52.32 1208684
1000 167.43 3493456

so the CPU time does not come close to what is reported here.
Memory use is quite high, though.

What is the memory footprint of the compilation? Is your machine possibly
starting to swap?

Reply via email to