From patchwork Wed Dec 15 01:05:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 75592 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 AFBA4B7043 for ; Wed, 15 Dec 2010 12:05:35 +1100 (EST) Received: (qmail 27911 invoked by alias); 15 Dec 2010 01:05:33 -0000 Received: (qmail 27903 invoked by uid 22791); 15 Dec 2010 01:05:32 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Dec 2010 01:05:27 +0000 Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [172.25.149.6]) by smtp-out.google.com with ESMTP id oBF15O1A009141 for ; Tue, 14 Dec 2010 17:05:24 -0800 Received: from iyj21 (iyj21.prod.google.com [10.241.51.85]) by hpaq6.eem.corp.google.com with ESMTP id oBF14cLE016022 for ; Tue, 14 Dec 2010 17:05:23 -0800 Received: by iyj21 with SMTP id 21so624460iyj.36 for ; Tue, 14 Dec 2010 17:05:23 -0800 (PST) Received: by 10.42.174.198 with SMTP id w6mr5172394icz.202.1292375123170; Tue, 14 Dec 2010 17:05:23 -0800 (PST) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id 34sm457775ibi.2.2010.12.14.17.05.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 17:05:22 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Don't get confused by error types in traversal Date: Tue, 14 Dec 2010 17:05:18 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes 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 patch fixes the Go frontend to not get confused by error types when doing a traversal. Previously once an error type had been seen, the frontend would think that all subsequent types had been seen, because to avoid knock-on type compatibility error messages the error type is considered to be identical to all other types. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r 8c9b70be1f8c go/gogo.cc --- a/go/gogo.cc Tue Dec 14 16:08:09 2010 -0800 +++ b/go/gogo.cc Tue Dec 14 17:00:35 2010 -0800 @@ -4201,6 +4201,8 @@ bool Traverse::remember_type(const Type* type) { + if (type->is_error_type()) + return true; gcc_assert((this->traverse_mask() & traverse_types) != 0 || (this->traverse_mask() & traverse_expressions) != 0); // We only have to remember named types, as they are the only ones