This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [trunk<-vta] Re: [vta,vta4.3,trunk?] introduce -fcompare-debug


On Jun  2, 2009, Ian Lance Taylor <iant@google.com> wrote:

> Alexandre Oliva <aoliva@redhat.com> writes:
>> Sure we do have a number of internal property checkers that are
>> controlled through configure-time options.  They can be turned on or off
>> because they do have a run-time impact to support.  This one doesn't, so
>> it doesn't hurt at all to always have it there, so that it can be
>> enabled or disabled like any of the other hundreds of flags that are
>> designed exclusively to aid in compiler debugging, and that are
>> nevertheless exposed to users.
>> 
>> And then, having it as a compile-time option rather than a
>> configure-time option means we can get better coverage from our
>> bootstrap checking without significant impact.  E.g., we can build
>> stage2 without debug info (builds much faster with the unoptimized
>> stage1) and then build stage3 with -fcompare-debug (must still produce
>> the same output to pass bootstrap compare, but can still check that the
>> internal representation doesn't change because of -g).

> I don't fully understand what the proposed option does, so I don't know
> if this comment applies: if this is for a run-time option to improve
> checking, then it should not be a -f option, it should be a --param.  -f
> options are for users.  --param options are for developers.

Err...  -fdump-*, -fsched-verbose, etc are all -f options.  Besides, --*
is an alias for -f*, so --param is -fparam.  And then, most if not all
params I'm aware of are for users rather than for developers.


Anyhow, what the option does is to compile twice, once with the given
flags, once adding the flags given to -fcompare-debug, and comparing the
final RTL they generate to check that it is the same.

-fcompare-debug[=-gtoggle] checks that a compilation with -g or -g0
(depending on which is in effect) wouldn't generate different code.  It
could be used to test other kinds of code stability across command line
options, say with or without LTO, with or without PCH, etc.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer


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