This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Disable VOPs at -O0
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 4 Apr 2009 16:10:31 +0200 (CEST)
- Subject: [PATCH] Disable VOPs at -O0
There seems to be one testcase at least where the decrease in stmt
memory needs does not compensate the memory requirements for VOPs at -O0.
Thus the following patch simply disables VOPs at -O0 - if we ever need
them it's trivial to enable them again.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2009-04-04 Richard Guenther <rguenther@suse.de>
* tree-ssa.c (verify_ssa): With -O0 we do not need VOPs.
* tree-ssa-operands.c (append_vdef): Do not append VOPs at -O0.
(append_vuse): Likewise.
Index: tree-ssa.c
===================================================================
*** tree-ssa.c (revision 145534)
--- tree-ssa.c (working copy)
*************** verify_ssa (bool check_modified_stmt)
*** 624,630 ****
if (base_address
&& SSA_VAR_P (base_address)
! && !gimple_vdef (stmt))
{
error ("statement makes a memory store, but has no VDEFS");
print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
--- 624,631 ----
if (base_address
&& SSA_VAR_P (base_address)
! && !gimple_vdef (stmt)
! && optimize > 0)
{
error ("statement makes a memory store, but has no VDEFS");
print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
Index: tree-ssa-operands.c
===================================================================
*** tree-ssa-operands.c (revision 145534)
--- tree-ssa-operands.c (working copy)
*************** append_use (tree *use_p)
*** 608,613 ****
--- 608,616 ----
static inline void
append_vdef (tree var)
{
+ if (!optimize)
+ return;
+
gcc_assert ((build_vdef == NULL_TREE
|| build_vdef == var)
&& (build_vuse == NULL_TREE
*************** append_vdef (tree var)
*** 623,628 ****
--- 626,634 ----
static inline void
append_vuse (tree var)
{
+ if (!optimize)
+ return;
+
gcc_assert (build_vuse == NULL_TREE
|| build_vuse == var);