[patch, fortran] PR46079 ABI for empty stop statement broken

Mikael Morin mikael.morin@sfr.fr
Tue Oct 19 20:48:00 GMT 2010


On Tuesday 19 October 2010 04:45:05 Jerry DeLisle wrote:
> Hi,
> 
> I discovered this minor bug while testing for the revamp of the type
> enumerators.
> 
> I think the ChangeLog is clear enough.
> 
> Regression tested on x86-64-linux-gnu. No new test case needed.
> 
> OK for trunk?
> 
> Jerry
> 
> 2010-10-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
> 
> 	PR fortran/46079
> 	* trans_stmt.c (gfc_trans_stop): If the STOP statement is empty,
> 	build a call to the new function stop_empty.  If integer, build a call
> 	to stop_string or error_stop_string with a NULL pointer and the
> 	integer value as the length.
> 	* trans.h: Add declaration for gfor_fndecl_stop_empty.
> 	* trans-decl.c (gfc_build_builtin_function_decls): Build declaration
> 	for stop_empty.
> 
> 2010-10-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
> 
> 	PR libgfortran/46079
> 	* runtime/stop.c (stop_empty): New function. (stop_numeric): Restore
> 	to previous behavior. (stop_string, error_stop_string): Use string
> 	pointer to signal emitting numeric only.  Use string length as the
> 	stop code.

Let's keep error_stop_string care about strings only. (Please!)

The current stop_numeric function doesn't escape -1 (and doesn't need to, for 
new binaries), but we have to provide the previous stop_numeric that did. 
That's the problem, right ?

Why not keep stop_numeric for compatibility and add a new function (called 
let's say stop_numeric_{new,plain,noworkaround,jerry} or whatever) and 
generate calls for that new function only?
That's probably some code duplication, but should save some obfuscation ;-)


Mikael



More information about the Fortran mailing list