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
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 26 Aug 2010 14:55:50 +0000 (UTC)
- Subject: Re: [PATCH][RFC] Add -Otest for unit-testing optimization passes
- References: <alpine.LNX.2.00.1008261445280.28912@zhemvz.fhfr.qr>
On Thu, 26 Aug 2010, Richard Guenther wrote:
> + case OPT_Otest:
> + /* -Otest adds flags to -O0 but keeps optimze == 1. */
> + optimize_size = 0;
> + optimize = 1;
> + ofast = 1;
> + otest = 1;
> + break;
I think you should have the other OPT_O* cases set otest = 0, to preserve
the principle that only the last -O* option matters (note that
gcc.c:check_live_switch contains such an assumption), and add OPT_Otest to
the OPT_O* cases in java/jvspec.c. That is, keep it as if there is a
single -O option that takes enumerated arguments { 0, 1, 2, 3, s, fast,
test } (plus -O meaning -O1 and -On for n > 3 meaning -O3).
--
Joseph S. Myers
joseph@codesourcery.com