gen_* functions in gcc source
Soubhik Bhattacharya
soubhik@cse.iitk.ac.in
Mon Feb 12 08:46:00 GMT 2001
hi!
i'm working on a tool that reads a machine description (written in a
language called Sim-nML) and generates a machine description for gcc. for
this i'm looking into machide descriptions and source files (of gcc
2.8.1).......
i guess the expected prototypes of gen_* functions (e.g. gen_call()) are
hard-coded in gcc's m/c independent files. in fact, machine-independent
files, calls.c, expr.c invokes gen_call() with four arguments, so that the
expected prototype of gen_call() is as follows:
rtx gen_call (rtx, rtx, rtx, rtx)
now, one can write an arbitrary m/c description so that gen_call(), as
generated from the target.md, has a different prototype. in fact, i've
modified sparc.md in a way, that in insn-emit.c (a file generated from
the md file), gen_call() has following prototype definition:
rtx gen_call(rtx, rtx)
because of this mismatch, one would expect that while building gcc for
sparc, there will be a compilation error. but this is not happening. in
fact, i've invoked gen_call() recursively in insn-emit.c (just to
test) with four arguments and compiled that module (stand-alone)
successfully!...... dose anybody have a clue? my compiler is gcc 2.95.3
and build platform is i586-linux-gnu2.2.15......
regards,
soubhik.
More information about the Gcc
mailing list