This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Add -Otest for unit-testing optimization passes
On Fri, 27 Aug 2010, Mark Mitchell wrote:
> Richard Guenther wrote:
>
> >> Is your idea that we will still use DejaGNU tests to do this kind
> >> unit-testing, writing C code as input and scanning assembly code or tree
> >> dumps as output?
> >
> > Yes. I think that's a lot more practical for exhaustively testing
> > optimization passes than using GIMPLE.
>
> It's certainly more practical in the short term; all the test
> infrastructure is there.
>
> I guess that -Otest might be a useful hack. I'm somewhat skeptical that
> we can rely on the input making it to the pass you're trying to test
> without be modified in some surprising way by some part of the compiler
> that isn't disabled at -O0, or that all of our existing passes will
> really work if we disable everything in front of them, but I suppose we
> can try.
There surely might be issues and we do have passes that have no
switch to turn it on or off, so those will be unconditionally enabled
at -Otest.
> How different is -0test from -O2 -fno{opt1,opt2,opt3,...} (for some vast
> set of -fno-* options)?
It should be the same as -O1 -fno{....}, in fact, the optimize variable
will be 1.
Richard.