[gfortran] PR 14928: Fix two-argument variant of MINLOC/MAXLOC

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Sat Jun 12 14:52:00 GMT 2004


Paul Brook wrote:
>>2004-06-05  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
>>	    Andrew Vaught <andyv@firstinter.net>
>>
>>	* check.c (gfc_check_minloc_maxloc): Take argument list insted
>>	of individual arguments, reorder if necessary.
>>	* intrinsic.h (gfc_check_minloc_maxloc): ... adapt prototype.
>>	* intrinsic.c (add_functions): Special treatment for MINLOC,
>>	MAXLOC, pass check function as (void *).
>>	(check_specific): Catch special case MINLOC, MAXLOC.
> 
> 
> You can't typecast a function pointer to (void *), it will break on targets 
> that use function descriptors (eg. ia64). You'll need to figure out another 
> way of doing this. Maybe add a new variant of add_sym_3, (similar to 
> gfc_add_sym_3s).

Actually, it doesn't call the function pointed to by the (void *), but 
only compares (void *)check_function (I forgot the name in the code) to 
(void *)gfc_check_minloc_maxloc, so the function pointer need not be 
callable, it only has to be unique. I agree that it would still be 
cleaner to implement its own add_sym* function, even though I refrained 
from doing this, as MINLOC is indeed unique in its characteristics.

- Tobi



More information about the Gcc-patches mailing list