Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-15 Thread Janne Blomqvist
On Sat, Nov 15, 2014 at 8:01 AM, Janne Blomqvist wrote: > On Fri, Nov 14, 2014 at 11:02 PM, Tobias Burnus wrote: >> I think instead of doing a run-time check I'd prefer something like the >> following, keeping the compile-time assert. >> >> --- a/libgfortran/intrinsics/random.c >> +++ b/libgfortr

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-14 Thread Cesar Philippidis
On 11/14/2014 10:01 PM, Janne Blomqvist wrote: > On Fri, Nov 14, 2014 at 11:02 PM, Tobias Burnus wrote: >> Cesar Philippidis wrote: >>> >>> On 11/13/2014 02:32 AM, Janne Blomqvist wrote: >>> I hit an error when building intrinsics/random.c: >>>error: expression in static assertion is not const

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-14 Thread Janne Blomqvist
On Fri, Nov 14, 2014 at 11:02 PM, Tobias Burnus wrote: > Cesar Philippidis wrote: >> >> On 11/13/2014 02:32 AM, Janne Blomqvist wrote: >> I hit an error when building intrinsics/random.c: >>error: expression in static assertion is not constant >> Joseph told me that static const variables cann

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-14 Thread Tobias Burnus
Cesar Philippidis wrote: On 11/13/2014 02:32 AM, Janne Blomqvist wrote: I hit an error when building intrinsics/random.c: error: expression in static assertion is not constant Joseph told me that static const variables cannot be used in constant expressions in C, so I've replaced the _Static_a

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-14 Thread Cesar Philippidis
On 11/13/2014 02:32 AM, Janne Blomqvist wrote: > in the spirit of PR 60324 and 61035, here's a patch that gets rid of > the remaining potentially unbounded stack allocations in libgfortran. > All uses of __builtin_alloca() and VLA's are replaced either straight > with heap allocated memory, or wit

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-13 Thread Marek Polacek
On Thu, Nov 13, 2014 at 04:59:09PM +0100, Jakub Jelinek wrote: > On Thu, Nov 13, 2014 at 04:57:08PM +0100, Marek Polacek wrote: > > On Thu, Nov 13, 2014 at 02:05:52PM +0200, Janne Blomqvist wrote: > > > Thanks for the quick review, committed as r217480. > > > > This broke bootstrap because of impl

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-13 Thread Jakub Jelinek
On Thu, Nov 13, 2014 at 04:57:08PM +0100, Marek Polacek wrote: > On Thu, Nov 13, 2014 at 02:05:52PM +0200, Janne Blomqvist wrote: > > Thanks for the quick review, committed as r217480. > > This broke bootstrap because of implicit declaration of free. > > The following (untested) should fix it, ok

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-13 Thread Marek Polacek
On Thu, Nov 13, 2014 at 02:05:52PM +0200, Janne Blomqvist wrote: > Thanks for the quick review, committed as r217480. This broke bootstrap because of implicit declaration of free. The following (untested) should fix it, ok for trunk? 2014-11-13 Marek Polacek * intrinsics/access.c: In

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-13 Thread Janne Blomqvist
On Thu, Nov 13, 2014 at 1:31 PM, FX wrote: >> Regtested on x86_64-unknown-linux-gnu, Ok for trunk? > > OK two me, with three comments: > >>* intrinsics/chmod.c (chmod_internal): New function, move logic >>here. >>(chmod_func): Call chmod_internal. > > Not sure what’s the need / benefit

Re: [PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-13 Thread FX
> Regtested on x86_64-unknown-linux-gnu, Ok for trunk? OK two me, with three comments: >* intrinsics/chmod.c (chmod_internal): New function, move logic >here. >(chmod_func): Call chmod_internal. Not sure what’s the need / benefit from this, given the function is only called once. >

[PATCH, libgfortran] PR 60324 Unbounded stack allocations in libgfortran

2014-11-13 Thread Janne Blomqvist
Hi, in the spirit of PR 60324 and 61035, here's a patch that gets rid of the remaining potentially unbounded stack allocations in libgfortran. All uses of __builtin_alloca() and VLA's are replaced either straight with heap allocated memory, or with a fixed size stack buffer, potentially switching