This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

> Paul Brook wrote:
> >>2004-06-05  Tobias Schlueter  <>
> >>	    Andrew Vaught <>
> >>
> >>	* 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.

Even on some targets you cannot just compare function pointers which have
been casted as again they are function descriptors (ie PA RISC) and the
comparision have to be expanded to two comparisions.
There is a bug report about this and I cannot remember the number.

Andrew Pinski

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]