> OK, all that does is process some options and then call another
> executable, which does the actual compilation.
>
> To compile C code it calls cc1, to compile C++ code it calls cc1plus etc.
>
> So if you're only tracing the 'gcc' driver then you are basically only
> tracing the code for parsing command-line arguments and choosing which
> compiler to execute.
>
>
>>>
>>> Typically to run the testsuite you run 'make', which runs DejaGnu's
>>> 'runtest' shell script, which runs the 'expect' program (written in
>>> Tcl), which invokes the 'gcc' driver, which invokes the actual
>>> compiler, 'cc1', to compile a testcase. So a lot of that is common to
>>> every testcase.

I'm understanding that the major of code that I instrumented (in the
first level of ..gcc-version-x.x/gcc/ and the dirs related to C/C++)
is part of the 'gcc' driver. If so, this explains the great amount of
common function calls across the tests.


>> Do you mean, for example, that the compiler will always build the AST,
>> translate to intermediary code representations, etc., regardless of
>> the compilation option... and it corresponds to a lot of common code
>> across all tests?
>
> No, for example if it is run with -E it will only do preprocessing.

I ran
make RUNTESTFLAGS='dg.exp=c90-float-1.c -v -v' check-gcc
And I saw in the log:
...
doing compile
Invoking the compiler as
../gcc-r227092/objdir/gcc/testsuite/g++/../../xg++ -B/...
...

The test ../testsuite/gcc.dg/c90-float-1.c contains the action: /* {
dg-do preprocess } */
So, why "doing compile" was in the execution log? I thought that the
compiler would not be called in this case.
Am I running the test in a wrong way?


>
> But you're not tracing the compiler anyway. The 'gcc' executable is
> not the compiler.

I think I understood.
But, how can I differentiate between the 'gcc' driver's code and the
compiler's code?
All the code inside ..gcc-version-x.x/gcc/ corresponds to the 'gcc'
driver's code?
Where can I find all the code that implements the compiler and
preprocessor? In libcpp, libcc1, boehm-gc ?
Please, help me.




Thanks,
-- 
Sabrina Souto

Reply via email to