From patchwork Fri Mar 4 13:53:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 325 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:41:42 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs15575qah; Fri, 4 Mar 2011 05:53:40 -0800 (PST) Received: by 10.216.17.204 with SMTP id j54mr600722wej.32.1299246819212; Fri, 04 Mar 2011 05:53:39 -0800 (PST) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id y7si4203128weq.41.2011.03.04.05.53.38 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 05:53:39 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of richard.sandiford@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of richard.sandiford@linaro.org) smtp.mail=richard.sandiford@linaro.org Received: by wyf28 with SMTP id 28so2492546wyf.37 for ; Fri, 04 Mar 2011 05:53:38 -0800 (PST) Received: by 10.227.29.27 with SMTP id o27mr599395wbc.16.1299246818755; Fri, 04 Mar 2011 05:53:38 -0800 (PST) Received: from richards-thinkpad (gbibp9ph1--blueice2n1.emea.ibm.com [195.212.29.75]) by mx.google.com with ESMTPS id u9sm1809222wbg.6.2011.03.04.05.53.37 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 05:53:37 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, patches@linaro.org, richard.sandiford@linaro.org Cc: patches@linaro.org Subject: [1/2] Reducing the overhead of dwarf2 location trracking Date: Fri, 04 Mar 2011 13:53:30 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 A typo in dwarf2out.c:compare_loc_operands means that we fail to detect equivalent addresses in location lists. On this ARM testcase: https://bugs.launchpad.net/gcc-linaro/+bug/714921/+attachment/1837418/+files/gcc-oom.i the patch below reduces the number of lines of assembly from 39,230,550 to 1,266,183 when compiling with -O2 -g. (On my box, the original code triggers an OOM in the assembler, so I can't measure the difference in object sizes.) Normally I'd install this as obvious, but I'm not sure whether it qualifies for stage 4. I hope it does though. Not being able to build this file (due to the assembler OOM) is a regression from 4.4. Bootstrapped & regression-tested on x86_64-linux-gnu. OK for 4.6? Richard gcc/ * dwarf2out.c (compare_loc_operands): Fix address handling. Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c 2011-03-04 13:08:38.000000000 +0000 +++ gcc/dwarf2out.c 2011-03-04 13:15:28.000000000 +0000 @@ -23178,7 +23178,7 @@ compare_loc_operands (dw_loc_descr_ref x && valx2->v.val_int == valy2->v.val_int; case DW_OP_addr: hash_addr: - return rtx_equal_p (valx1->v.val_addr, valx2->v.val_addr); + return rtx_equal_p (valx1->v.val_addr, valy1->v.val_addr); case DW_OP_GNU_implicit_pointer: return valx1->val_class == dw_val_class_die_ref && valx1->val_class == valy1->val_class