This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] Add _gfortran_error_stop_numeric
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: fortran at gcc dot gnu dot org, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 13 May 2010 22:29:37 -0700
- Subject: Re: [patch, fortran] Add _gfortran_error_stop_numeric
- References: <4BE5C54F.4040608@verizon.net> <4BECC908.7010809@verizon.net>
On Thu, May 13, 2010 at 08:52:40PM -0700, Jerry DeLisle wrote:
> On 05/08/2010 01:10 PM, Jerry DeLisle wrote:
> >Hi all,
> >
> >The attached patch adds this run-time function.
> >
>
> I decided to go ahead and incorporate some additional changes. The
> attached patch uses the NULL expression to signal that the STOP, ERROR
> STOP, or PAUSE statements are empty. I pass a flag to the run-time
> functions to signal the library this condition rather than use the -1 stop
> code. This allows a program to actually use a -1 stop code.
>
> I also pass to the runtime a kind=8 integer for the integer stop code to
> allow -fdefault-integer-8 to work with no problems. I chose to not go
> larger than this since most if not all systems can not use large values
> regardless.
>
> The statements now match constant expressions and I have added checks to
> generate errors if non-integer, non-character, or not constant expressions
> are given. I got rid of the old digit counting matcher. Seemed pointless
> since we now accept expressions.
>
> The empty ERROR STOP issues a 1 exit code. The PAUSE run-time was updated
> since it uses the gfc_match_stopcode function. PAUSE is a "deleted" feature
> and it now takes an expression. (A two for one deal)
>
> Regression tested on x86_64.
>
> OK for trunk?
>
> Jerry
>
> 2010-05-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
>
> PR libgfortran/43851
> * runtime/stop.c (error_stop_numeric): Update comment and add new
> function. (stop_numeric): Modify function to accept a flag to
> indicate
> an empty stop statement. Add missing attribute noreturn.
> * runtime/pause.c (do_pause): Likewise. (pause_numeric): Likewise.
> * gfortran.map: Add new symbol _gfortran_error_stop_numeric to
> run-time library.
> * libgfortran.h: Revise declaration for stop_numeric.
>
I think your patch may break the runtime library ABI. Please
check with Janne on the required symbol version issues. In
particular,
/* A numeric or blank STOP statement. */
-extern void pause_numeric (GFC_INTEGER_4 code);
+extern void pause_numeric (GFC_INTEGER_8 code, GFC_INTEGER_4 flag);
export_proto(pause_numeric);
If GNU follows FreeBSD versioning rules, you can't do
the above because pause_numeric is in the GFORTRAN_1.0
symbol space with the old prototype. You need to create
a new function and add it to whatever is the current
GFORTRAN_1.x namespace.
Of course, I'll defer to Janne.
--
Steve