This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][4.3][RFC] Disable field-sensitive aliasing at -O1 (fix PR36474)
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Jun 2008 15:10:24 +0200 (CEST)
- Subject: [PATCH][4.3][RFC] Disable field-sensitive aliasing at -O1 (fix PR36474)
PR36474 is another case where silly big source code is taking ages to
build with basic optimization (-O1) and uses unreasonable amount of
memory (I aborted the compile after 15mins when it was starting to run
into swap on a 3GB machine).
This is likely a fallout from the aliasing-with-SFT fixes that forces
some of the SFTs to be unpartitioned. Disabling SFTs makes the testcase
build almost instantly even with -O2.
Thus I propose to disable SFTs on the 4.3 branch _for -O1 only_ with
the reason that -O1 should be a usable fallback for compile-time and
memory-usage problems. I'd declare -O2 WONTFIX for the branch though
(I don't want to spend the time to eventually tune the value for
max-fields-for-field-sensitive -- the specific testcase is fine with
32 but not with 64, though I guess it's simply a lot of temporaries
of the same type that is decomposed with 64 but not with 32).
Thoughts? I'll see to not break any testcases, so eventually the
zero for max-fields-for-field-sensitive will become N << 100
(which is the default now).
Thanks,
Richard.
2008-06-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36474
* opts.c (decode_options): Set max-fields-for-field-sensitive
parameter to 100 for -O2, -Os and -O3.
* params.def (max-fields-for-field-sensitive): Set default to zero.
* doc/invoke.texi (max-fields-for-field-sensitive): Document
defaults.
Index: gcc/opts.c
===================================================================
*** gcc/opts.c (revision 136500)
--- gcc/opts.c (working copy)
*************** decode_options (unsigned int argc, const
*** 846,851 ****
--- 846,854 ----
/* Allow more virtual operators to increase alias precision. */
set_param_value ("max-aliased-vops", 500);
+
+ /* Track fields in field-sensitive alias analysis. */
+ set_param_value ("max-fields-for-field-sensitive", 100);
}
if (optimize >= 3)
Index: gcc/params.def
===================================================================
*** gcc/params.def (revision 136500)
--- gcc/params.def (working copy)
*************** DEFPARAM (PARAM_MAX_JUMP_THREAD_DUPLICAT
*** 652,658 ****
DEFPARAM (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE,
"max-fields-for-field-sensitive",
"Maximum number of fields in a structure before pointer analysis treats the structure as a single variable",
! 100, 0, 0)
DEFPARAM(PARAM_MAX_SCHED_READY_INSNS,
"max-sched-ready-insns",
--- 652,658 ----
DEFPARAM (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE,
"max-fields-for-field-sensitive",
"Maximum number of fields in a structure before pointer analysis treats the structure as a single variable",
! 0, 0, 0)
DEFPARAM(PARAM_MAX_SCHED_READY_INSNS,
"max-sched-ready-insns",
Index: gcc/doc/invoke.texi
===================================================================
*** gcc/doc/invoke.texi (revision 136500)
--- gcc/doc/invoke.texi (working copy)
*************** duplicated when threading jumps.
*** 7270,7276 ****
@item max-fields-for-field-sensitive
Maximum number of fields in a structure we will treat in
! a field sensitive manner during pointer analysis.
@item prefetch-latency
Estimate on average number of instructions that are executed before
--- 7270,7277 ----
@item max-fields-for-field-sensitive
Maximum number of fields in a structure we will treat in
! a field sensitive manner during pointer analysis. The default is zero
! for -O0, and -O1 and 100 for -Os, -O2, and -O3.
@item prefetch-latency
Estimate on average number of instructions that are executed before