From patchwork Thu Apr 28 22:00:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 616478 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qwrPM525Qz9t3p for ; Fri, 29 Apr 2016 08:00:54 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=pKum6Kbl; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=R1isi2a16rRCXatTAr1fv2M4HQldmSlq5wUgY3pNcRNpOvmn6a dZqFgEf9jA4QSuTIcoUYFrKuhm4WJtqNrA5nWMtpj/WcBLZJIQsgpFmbt+EmanJr VoS2y8n2NSMu+u/qIWF1XdgiXTkmPuHYjVrjdNTwfukQ+NRY1avrE0760= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=+TY54QDbtO2TDzAzgJ7avXdDi2E=; b=pKum6KbldLtMRSesEpLv 0swNQO9yb2K1vHgV6BoAp3dpn/Z5clVFYZ001LzBeCnRws04k4tCvPofQ1pIUukT /AFSmx447fz4cHvHFQDQUt8xCdimxMlWv7QfLOMNSvrLqMjuM2oPBRXSCDnKVwKP cvs6qMS17VEptr6jDZ2QS40= Received: (qmail 2651 invoked by alias); 28 Apr 2016 22:00:48 -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 2637 invoked by uid 89); 28 Apr 2016 22:00:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2276 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 28 Apr 2016 22:00:46 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 722B37F0A7 for ; Thu, 28 Apr 2016 22:00:45 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-93.phx2.redhat.com [10.3.113.93]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3SM0jbV015123 for ; Thu, 28 Apr 2016 18:00:45 -0400 To: gcc-patches From: Jeff Law Subject: [PATCH] Fix wrong argument to build_modify_expr Message-ID: Date: Thu, 28 Apr 2016 16:00:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 X-IsSubscribed: yes As Andrew pointed out a while ago, build_modify_expr's last argument is supposed to be a tree type. However in two cases within fix_builtin_array_notation_fn we end passing down an tree expression. Thankfully in the contexts were this happens, the last argument isn't actually used, so it hasn't caused problems. This patch fixes the two call sites. Andrew and I independently bootstrapped and regression tested this change on x86_64. Installed on the trunk. Jeff commit bd4625a0c2cb387b7e05ddddab7785b1063a8a0a Author: law Date: Thu Apr 28 22:00:19 2016 +0000 2016-04-28 Andrew MacLeod * c-array-notation.c (fix_builtin_array_notation_fn): Fix final argument to build_modify_expr in two cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235614 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index a641721..5161f7d 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2016-04-28 Andrew MacLeod + + * c-array-notation.c (fix_builtin_array_notation_fn): Fix final + argument to build_modify_expr in two cases. + 2016-04-27 Bernd Schmidt * c-parser.c (c_parser_postfix_expression_after_primary): Call diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c index 716bd11..c7cf66a 100644 --- a/gcc/c/c-array-notation.c +++ b/gcc/c/c-array-notation.c @@ -489,7 +489,7 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) new_yes_expr = build_modify_expr (location, array_ind_value, TREE_TYPE (array_ind_value), NOP_EXPR, - location, func_parm, TREE_OPERAND (array_op0, 1)); + location, func_parm, TREE_TYPE (TREE_OPERAND (array_op0, 1))); } new_yes_list = alloc_stmt_list (); append_to_statement_list (new_yes_ind, &new_yes_list); @@ -539,7 +539,7 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) new_yes_expr = build_modify_expr (location, array_ind_value, TREE_TYPE (array_ind_value), NOP_EXPR, - location, func_parm, TREE_OPERAND (array_op0, 1)); + location, func_parm, TREE_TYPE (TREE_OPERAND (array_op0, 1))); } new_yes_list = alloc_stmt_list (); append_to_statement_list (new_yes_ind, &new_yes_list);