Solution to Problem 2: ---------------------- Initially copy the file "bb.py" to the build directory, this is the tool we will be using and is among the resources of the assignment, then open terminal go to the $BUILD directory and run the given tool in interactive mode, $ ./bb.py -i -s $SOURCE once the tool has started, type insn-output.c for name of file and for level enter 3, this will generate following tree. $BUILD/gcc/insn-output.c |--$BUILD/gcc/tmp-output.c |--|--$BUILD/gcc/build/genoutput |--|--|--$BUILD/build-i686-pc-linux-gnu/libiberty/libiberty.a |--|--|--$BUILD/gcc/build/errors.o |--|--|--$BUILD/gcc/build/genoutput.o |--|--|--$BUILD/gcc/build/gensupport.o |--|--|--$BUILD/gcc/build/ggc-none.o |--|--|--$BUILD/gcc/build/min-insn-modes.o |--|--|--$BUILD/gcc/build/print-rtl.o |--|--|--$BUILD/gcc/build/read-md.o |--|--|--$BUILD/gcc/build/read-rtl.o |--|--|--$BUILD/gcc/build/rtl.o |--|--|--$BUILD/gcc/build/vec.o |--|--$BUILD/gcc/insn-conditions.md |--|--|--$BUILD/gcc/tmp-cond.md |--|--/home/sumit/Gcc/Extractions/gcc-4.6.2/gcc/config/spim/spim1.md NOTE:Here "/home/sumit/Gcc/Extractions/gcc-4.6.2/" is $SOURCE directory As you can see the insn-output.c is dependent on genoutput which is an executable file which when run makes use of the target machine's `.md' files, and generate insn-output.c. Among the dependencies you will find insn-conditons.md. This file is also generated at build time of gcc and is target machine dependent. Similarly we can generate trees for insn-emit.c and insn-recog.c $BUILD/gcc/insn-recog.c |--$BUILD/gcc/tmp-recog.c |--|--$BUILD/gcc/build/genrecog |--|--|--$BUIfLD/build-i686-pc-linux-gnu/libiberty/libiberty.a |--|--|--$BUILD/gcc/build/errors.o |--|--|--$BUILD/gcc/build/genrecog.o |--|--|--$BUILD/gcc/build/gensupport.o |--|--|--$BUILD/gcc/build/ggc-none.o |--|--|--$BUILD/gcc/build/min-insn-modes.o |--|--|--$BUILD/gcc/build/print-rtl.o |--|--|--$BUILD/gcc/build/read-md.o |--|--|--$BUILD/gcc/build/read-rtl.o |--|--|--$BUILD/gcc/build/rtl.o |--|--|--$BUILD/gcc/build/vec.o |--|--$BUILD/gcc/insn-conditions.md |--|--|--$BUILD/gcc/tmp-cond.md |--|--/home/sumit/Gcc/Extractions/gcc-4.6.2/gcc/config/spim/spim1.md $BUILD/gcc/insn-emit.c |--$BUILD/gcc/tmp-emit.c |--|--$BUILD/gcc/build/genemit |--|--|--$BUILD/build-i686-pc-linux-gnu/libiberty/libiberty.a |--|--|--$BUILD/gcc/build/errors.o |--|--|--$BUILD/gcc/build/genemit.o |--|--|--$BUILD/gcc/build/gensupport.o |--|--|--$BUILD/gcc/build/ggc-none.o |--|--|--$BUILD/gcc/build/min-insn-modes.o |--|--|--$BUILD/gcc/build/print-rtl.o |--|--|--$BUILD/gcc/build/read-md.o |--|--|--$BUILD/gcc/build/read-rtl.o |--|--|--$BUILD/gcc/build/rtl.o |--|--|--$BUILD/gcc/build/vec.o |--|--$BUILD/gcc/insn-conditions.md |--|--|--$BUILD/gcc/tmp-cond.md |--|--/home/sumit/Gcc/Extractions/gcc-4.6.2/gcc/config/spim/spim1.md Both of these files also have a similar dependency tree as insn-output.c. That means these files are generated in the similar manner i.e. by an exeutable which makes use of target machine`s md file. There is one important thing to notice here that whatever files was generated from the gen* executable files have names of the format tmp-* which are then renamed to insn-*. For example: tmp-output.c ===>>> insn-output.c tmp-recog.c ===>>> insn-recog.c tmp-emit.c ===>>> insn-emit.c Solution to Problem 3: --------------------- Now to find out other similar files which are target machine dependent we will have to open run the tool in reverse mapping interactive mode, open a new tab in the terminal and type ./bb.py -i -r -s ./../gcc-4.6.2/ because of the -r switch the tool can now be used for reverse mapping mode. For the file name use spim1.md and for level type 2. This will generate the following result. /home/sumit/Gcc/Extractions/gcc-4.6.2/gcc/config/spim/spim1.md ^--$BUILD/gcc/tmp-attrtab.c ^--^--$BUILD/gcc/insn-attrtab.c ^--$BUILD/gcc/tmp-automata.c ^--^--$BUILD/gcc/insn-automata.c ^--$BUILD/gcc/tmp-condmd.c ^--^--$BUILD/gcc/build/gencondmd.c ^--$BUILD/gcc/tmp-emit.c ^--^--$BUILD/gcc/insn-emit.c ^--$BUILD/gcc/tmp-enums.c ^--^--$BUILD/gcc/insn-enums.c ^--$BUILD/gcc/tmp-extract.c ^--^--$BUILD/gcc/insn-extract.c ^--$BUILD/gcc/tmp-opinit.c ^--^--$BUILD/gcc/insn-opinit.c ^--$BUILD/gcc/tmp-output.c ^--^--$BUILD/gcc/insn-output.c ^--$BUILD/gcc/tmp-peep.c ^--^--$BUILD/gcc/insn-peep.c ^--$BUILD/gcc/tmp-preds.c ^--^--$BUILD/gcc/insn-preds.c ^--$BUILD/gcc/tmp-recog.c ^--^--$BUILD/gcc/insn-recog.c The above is the list of all the files where spim1.md is used while building the gcc compilor providing us with the details about the target machine dependent part of gcc. As one can observe all the object files generated are dependent on the source files which are from the build directory itself and on obeserving the depedency tree of the all the above files, using the tool in normal interactive mode, one can easily find out that they all were generated at build time.