From patchwork Wed Sep 18 18:36:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 275777 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3FC5E2C00F1 for ; Thu, 19 Sep 2013 04:36:46 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=OcSV6CVMLuiadWBxodo1nZKVz1rQYJ/4JVa+tkF0Tib5ji2XzaSHV BL1HeRGYH2QmRBmJdNI/VsouczbnE7AHcETXvmd9Ir2fsuYQx2fsg9xselSHygrm gg63NvSxFjtteD89mLxp/RnAvG/CQdvmFIeMk1sNvJjENbYGf3TcNI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=votq5nD2cCRAENOxjwilzLMtH5E=; b=Gr076R2hrPKKE21JGwcO zxyuZhWT03Rs1Y8u9G9rmYayzPp6Wh4hNsxCf1CbeiO9DkyzzFHXeE49fXI+U7S3 /7ZZBmu7Bh65se14kmxykFZSpWQ35XDmhYx+GwK0tPTDKZ2G0psFNY9/HwX6X9rJ AETLStftrJDTA72UlJTuu30= Received: (qmail 5128 invoked by alias); 18 Sep 2013 18:36:40 -0000 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 Received: (qmail 5116 invoked by uid 89); 18 Sep 2013 18:36:40 -0000 Received: from mail-pd0-f177.google.com (HELO mail-pd0-f177.google.com) (209.85.192.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 18 Sep 2013 18:36:40 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED, BAYES_00, T_TVD_MIME_NO_HEADERS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f177.google.com Received: by mail-pd0-f177.google.com with SMTP id y10so7332049pdj.8 for ; Wed, 18 Sep 2013 11:36:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=D2lx+syMC3kjsXbYr2kF6PshsO3gs83RzANgprlz+3s=; b=Fzq6m3yWjaZvPxlANCuFQ8Ls4a+6Np8BakK6UeA0MXmkSjL+JnfkheOFkIKmg8krZD kfDfm+RijBKUHCRLFqg+o7MsXGaSvSwEq2tUJ4VQNYKXrBpyyX9s79sfSYSNkk9OFIwG IS1MDslhY8M8Rr+DoifrnNkClSnVVoeIT3RJFk3jIYweVbodhzX2BjnDdvt7CL/+XuBk g12x4EIAL4k9uWTU7DeDacLpL48uQ6/VozoEjHEiHfj37s82qYjf95JuMu5N8U3waBxC FY8/Zx/cR34x+Z68P2M0tRwsCWJldmTRrdDtepzjHNgbSBhA5699fsVs02J/rxWVzjWa K0jA== X-Gm-Message-State: ALoCoQmPtq3i3hyJxh5vkKFHaqkaWJM3M8GEmecfP14JLGr6L8Iad2YTHrdsHz3SrTK9gl8QobwJTnl710i970RbujHIh0rXicWRaU9iTKpWvlNH0/1VVu7qAsXGml3CmgHwNUnCuEpD59BnQ7grK0KyfB8WzUuVBPC7SOKUtcaOv14wKzl51y+XffmNZ8x7pXArppCSGnkuqJsfQN07y1MyVZWWvYrhHg== X-Received: by 10.66.146.199 with SMTP id te7mr21850164pab.106.1379529397136; Wed, 18 Sep 2013 11:36:37 -0700 (PDT) Received: from iant-glaptop.roam.corp.google.com.google.com ([172.19.249.10]) by mx.google.com with ESMTPSA id vz4sm6706995pab.11.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 18 Sep 2013 11:36:36 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Fix bug in type of shortcut operation Date: Wed, 18 Sep 2013 11:36:34 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes When the Go frontend converts a shortcut operator like && or || to an if statement, it used the wrong type for the temporary variable. It always used bool, but the operator could be using a named version of bool. This matters when the type has methods. This patch fixes the problem. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.8 branch. Ian diff -r 35afa97b6c21 go/gogo.cc --- a/go/gogo.cc Tue Sep 17 15:09:45 2013 -0700 +++ b/go/gogo.cc Wed Sep 18 11:30:33 2013 -0700 @@ -2367,7 +2367,7 @@ Block* retblock = new Block(enclosing, loc); retblock->set_end_location(loc); - Temporary_statement* ts = Statement::make_temporary(Type::lookup_bool_type(), + Temporary_statement* ts = Statement::make_temporary(shortcut->type(), left, loc); retblock->add_statement(ts);