This is the mail archive of the gcc@gcc.gnu.org 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]

Re: What's the deal with MD_CALL_PROTOTYPES ?


> 	So I'm prototyping stuff in insn-* and I notice that the macro
> MD_CALL_PROTOTYPES wraps gen_call() and gen_call_value() in
> insn-flags.h.  The docs says this:
> 
>  > `MD_CALL_PROTOTYPES'
>  >      Define this if you wish to generate prototypes for the `gen_call'
>  >      or `gen_call_value' functions generated from the machine
>  >      description file.  If `USE_PROTOTYPES' is defined to be 0, or the
>  >      host compiler does not support prototypes, or `NO_MD_PROTOTYPES'
>  >      is defined, this macro has no effect.  As soon as all of the
>  >      machine descriptions are modified to have the appropriate number
>  >      of arguments, this macro will be removed.

IIRC the problem is that the call patterns in some machine descriptions don't
use all the operands that are passed to them.  A normal call without a return
value takes three operands, but only the first two of them are used in some
ports.  So if you generate a prototype for gen_call, you will get errors
about wrong number of parameters when the compiler sees a call to gen_call
with more than two operands.
You could try adding the necessary operands to all call patterns in all
machine descriptions (nasty), or you could try to fix it in genflags.c by
emitting a known good prototype rather than emitting no prototype at all.

Bernd


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