From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6945 invoked by alias); 25 Oct 2008 20:07:55 -0000 Received: (qmail 9547 invoked by uid 48); 25 Oct 2008 20:06:32 -0000 Date: Sat, 25 Oct 2008 20:07:00 -0000 Subject: [Bug tree-optimization/37916] New: [4.0 Regression] SSA names causing register pressure; unnecessarily many simultaneously "live" names. X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "hp at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg01643.txt.bz2 The attached preprocessed code in the first attachment is that of the adler32 function in zlib-1.1.3. It comes highest in the profile of a zlib-based performance regression test (the "example" program with no parameters). I'm attaching the assembly code corresponding to gcc-3.2.1 for cris-axis-elf with -O2 -march=v10 -fno-gcse -fno-reorder-blocks (the latter options being the default in our local distribution) as well as the versions for the 4.3 branch at 141344 and trunk at 141361 with the same options. Note the larger stack frames for the newer versions, as well as larger code that uses all available registers and then some stack slots for the additive sums, where two registers would have been enough. While SSA generates lots of "names", IIUC they should have been collapsed before outof-ssa. It does to some extent, if the uses and the definitions are close enough. Looking at the tree-dumps, it's one pass that moved all the uses away from the definitions, tree-reassoc, and no pass later that moved them "back"; in particular TER (part of outof-ssa) did not. Adding the option -fno-tree-reassoc gets rid of most of the regression for this code (and others). Having TER changed to, or adding a subpass of outof-ssa, that moves each use back to its definition, would seem like a better solution than shutting off tree-reassoc. This is also a good example of missed post-increment opportunities (all versions); instead of increasing offsets from a base, there should have been a single post-incremented register. -- Summary: [4.0 Regression] SSA names causing register pressure; unnecessarily many simultaneously "live" names. Product: gcc Version: 4.3.3 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hp at gcc dot gnu dot org GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: cris-*-* and crisv32-*-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37916