This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Dealing with default recursive procedures in Fortran


On Thu, Apr 12, 2018 at 10:50 PM, Thomas König <tk@tkoenig.net> wrote:
> Hello world,
>
> with Fortran 2018, recursive is becoming the default. This will likely
> have a serious impact on many user codes, which often declare large
> arrays which could then overflow stacks, leading to segfaults without
> further explanation.
>
> What could we do? A few options, not all mutally exclusive.
>
> We could extend -fmax-stack-var-size so it allocates memory
> from the heap in recursive procedures, too, and set this to
> some default value.  Of course, it would also have to free them
> afterwards, but we manage that for allocatable arrays already.
>
> We could warn when large arrays with sizes known at compile time
> are translated.
>
> We could use -fsplit-stack by default. How reliable is that
> option? Can it be used, for example, with -fopenmp?
> Is it available on all (relevant) platforms?

Not available on AArch64 (yet, though there are some patches) and Arm
(no current plans that I know of). Probably works best only on x86_64.
I don't think you can rely on that being available everywhere.
Additionally depending on the implementation IIRC that will have a
dependency on a newer glibc as well,so that would depend on a newer
glibc as well for split-stack to work reliably as  platforms.

Ramana


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