From patchwork Thu Oct 7 05:41:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 66996 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B414DB6F06 for ; Thu, 7 Oct 2010 16:41:36 +1100 (EST) Received: (qmail 24581 invoked by alias); 7 Oct 2010 05:41:32 -0000 Received: (qmail 24482 invoked by uid 22791); 7 Oct 2010 05:41:31 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Oct 2010 05:41:25 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o975fNZA023641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Oct 2010 01:41:23 -0400 Received: from freie.oliva.athome.lsd.ic.unicamp.br (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id o975fLXN017989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Oct 2010 01:41:23 -0400 Received: from livre.localdomain (livre.oliva.athome.lsd.ic.unicamp.br [172.31.160.2]) by freie.oliva.athome.lsd.ic.unicamp.br (8.14.4/8.14.4) with ESMTP id o975fLQi021944; Thu, 7 Oct 2010 02:41:21 -0300 Received: from livre.localdomain (aoliva@localhost [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o975fJBa012829; Thu, 7 Oct 2010 02:41:20 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id o975fHbL012827; Thu, 7 Oct 2010 02:41:17 -0300 From: Alexandre Oliva To: Richard Guenther Cc: gcc-patches@gcc.gnu.org Subject: Re: [PR debug/45673] fix more MEM_REF -fcompare-debug lossage References: Date: Thu, 07 Oct 2010 02:41:17 -0300 In-Reply-To: (Alexandre Oliva's message of "Wed, 06 Oct 2010 01:51:28 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Oct 6, 2010, Alexandre Oliva wrote: >> What we could do is to always print the MEM variant for INTEGER_CST >> operand zero. That would make sense anyway as you have no way >> of guessing the type of operand one by looking at operand zero. >> A patch to do this is pre-approved if it passes bootstrap & regtest. > 'k Here it is. Regstraped on x86_64-linux-gnu and i686-linux-gnu. Ok? for gcc/ChangeLog from Alexandre Oliva PR debug/45673 PR debug/45604 PR debug/45419 PR debug/45408 * tree-pretty-print.c (dump_generic_node): Explicitly dump the type of MEM_REFs to INTEGER_CSTs. Index: gcc/tree-pretty-print.c =================================================================== --- gcc/tree-pretty-print.c.orig 2010-10-06 02:23:36.533623658 -0300 +++ gcc/tree-pretty-print.c 2010-10-06 05:30:38.002638564 -0300 @@ -801,6 +801,10 @@ dump_generic_node (pretty_printer *buffe case MEM_REF: { if (integer_zerop (TREE_OPERAND (node, 1)) + /* Dump the types of INTEGER_CSTs explicitly, for we can't + infer them and MEM_ATTR caching will share MEM_REFs + with differently-typed op0s. */ + && TREE_CODE (TREE_OPERAND (node, 0)) != INTEGER_CST /* Same pointer types, but ignoring POINTER_TYPE vs. REFERENCE_TYPE. */ && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 0))) @@ -1163,6 +1167,10 @@ dump_generic_node (pretty_printer *buffe || (TREE_CODE (op0) == MEM_REF && TREE_CODE (TREE_OPERAND (op0, 0)) != ADDR_EXPR && integer_zerop (TREE_OPERAND (op0, 1)) + /* Dump the types of INTEGER_CSTs explicitly, for we + can't infer them and MEM_ATTR caching will share + MEM_REFs with differently-typed op0s. */ + && TREE_CODE (TREE_OPERAND (op0, 0)) != INTEGER_CST /* Same pointer types, but ignoring POINTER_TYPE vs. REFERENCE_TYPE. */ && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 0)))