[LLVMdev] [DragonEgg] Why Fortran's "call flush()" is converted to "call void bitcast (void (...)* @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind" ?

Duncan Sands baldrick at free.fr
Tue Jul 17 00:48:39 PDT 2012


On 17/07/12 08:22, Anton Korobeynikov wrote:
> Dmitry,
>
>> This is probably a question for Fortran/DragonEGG experts:
>>
>> Why Fortran's "call flush()" is converted to "call void bitcast (void (...)*
>> @_gfortran_flush_i4 to void (i8*)*)(i8* null) nounwind" ? Why it needs
>> bitcast?
> Just a wild guess (basing from my llvm-gcc knwoledge though): there is
> a bug with in gcc fortran frontend where it fails to create the
> function TREEs with proper types. It might easily be possible that
> e.g. call of function with type with no args is performed with some
> amount of args, etc. It's pretty fine in gcc, but not in LLVM, the
> latter is much more strict wrt this.
>
> The only solution / workaround for this was to emit the function
> definition as variadic and do bitcast at a call site (there are some
> other fortran-specific stuff involved here, e.g dummy args)...
>
> See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33097 for more info.
>

Yes, this is the reason.

Ciao, Duncan.



More information about the llvm-dev mailing list