This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran] Patch for PR 17590: Tagging intrinsics with standard version
- From: Paul Brook <paul at codesourcery dot com>
- To: Janne Blomqvist <jblomqvi at cc dot hut dot fi>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, fortran at gcc dot gnu dot org,gcc-patches at gcc dot gnu dot org
- Date: Sun, 31 Oct 2004 19:46:56 +0000
- Subject: Re: [gfortran] Patch for PR 17590: Tagging intrinsics with standard version
- Organization: CodeSourcery
- References: <20040922194430.GA12720@vipunen.hut.fi> <9729166E-2B50-11D9-A2F5-000A95D692F4@physics.uc.edu> <20041031191802.GA21362@vipunen.hut.fi>
On Sunday 31 October 2004 19:18, Janne Blomqvist wrote:
> On Sun, Oct 31, 2004 at 10:21:51AM -0500, Andrew Pinski wrote:
> > On Oct 31, 2004, at 10:18 AM, Janne Blomqvist wrote:
> > >ChangeLog:
> > >
> > > PR fortran/17590
> > >
> > > * intrinsic.c (check_intrinsic_standard): Use __builtin_alloca to
> > > allocate message string on the stack.
> >
> > Can you just use alloca instead of __builtin_alloca? Inside the
> > compiler, alloca does the right thing.
>
> I don't know. I remember __builtin_alloca from some discussion where
> it was claimed that alloca was buggy on some platforms and that
> __builtin_alloca would get around that. But that discussion was
> related to the library, so I guess you're right..
That was for the runtime library.
For target library code (ie. libgfortran) we know the compiler is gcc, so can
use __builtin_alloca. This is also built for a wider range of targets than
the compiler itself.
For the compiler itself we have more extensive/well tested configure support,
so alloca should always work. Because fortran isn't a stage1 boostrap
language we technically only need to be compiled by gcc 2.95 or later (when
cross-compiling). Use of gcc extensions tends to be discouraged though, and
the source should be compilable by a C89 compiler unless there is a good
reason.
Paul