From patchwork Wed Jun 9 13:10:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 55090 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 F35F51007D1 for ; Wed, 9 Jun 2010 23:10:35 +1000 (EST) Received: (qmail 8058 invoked by alias); 9 Jun 2010 13:10:33 -0000 Received: (qmail 8050 invoked by uid 22791); 9 Jun 2010 13:10:32 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UPPERCASE_50_75 X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Jun 2010 13:10:28 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id C7E9B93A00 for ; Wed, 9 Jun 2010 15:10:25 +0200 (CEST) Date: Wed, 9 Jun 2010 15:10:25 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH][mem-ref2] More fancy dumping Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) 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 This fixes spurious testsuite FAILs in C++ that occur because we do not do fancy printing when referece vs. pointer types occur. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the branch. Richard. 2010-06-09 Richard Guenther * tree-pretty-print.c (dump_generic_node): Ignore pointer vs. reference type when doing fancy MEM_REF dumping. Index: gcc/tree-pretty-print.c =================================================================== --- gcc/tree-pretty-print.c (revision 160437) +++ gcc/tree-pretty-print.c (working copy) @@ -797,8 +797,17 @@ dump_generic_node (pretty_printer *buffe case MEM_REF: { if (integer_zerop (TREE_OPERAND (node, 1)) - && (TREE_TYPE (TREE_OPERAND (node, 0)) - == TREE_TYPE (TREE_OPERAND (node, 1))) + /* Same pointer types, but ignoring POINTER_TYPE vs. + REFERENCE_TYPE. */ + && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 0))) + == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1)))) + && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 0))) + == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node, 1)))) + && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 0))) + == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node, 1)))) + && (TYPE_QUALS (TREE_TYPE (TREE_OPERAND (node, 0))) + == TYPE_QUALS (TREE_TYPE (TREE_OPERAND (node, 1)))) + /* Same value types ignoring qualifiers. */ && (TYPE_MAIN_VARIANT (TREE_TYPE (node)) == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1)))))) @@ -1145,8 +1154,17 @@ 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)) - && (TREE_TYPE (TREE_OPERAND (op0, 0)) - == TREE_TYPE (TREE_OPERAND (op0, 1))) + /* Same pointer types, but ignoring POINTER_TYPE vs. + REFERENCE_TYPE. */ + && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 0))) + == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 1)))) + && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0, 0))) + == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0, 1)))) + && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0, 0))) + == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0, 1)))) + && (TYPE_QUALS (TREE_TYPE (TREE_OPERAND (op0, 0))) + == TYPE_QUALS (TREE_TYPE (TREE_OPERAND (op0, 1)))) + /* Same value types ignoring qualifiers. */ && (TYPE_MAIN_VARIANT (TREE_TYPE (op0)) == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 1))))))))