From patchwork Wed Feb 8 11:48:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Kulkarni X-Patchwork-Id: 93610 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2642437qgi; Wed, 8 Feb 2017 03:49:18 -0800 (PST) X-Received: by 10.99.143.18 with SMTP id n18mr26097482pgd.133.1486554558591; Wed, 08 Feb 2017 03:49:18 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l63si6897018pgl.252.2017.02.08.03.49.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Feb 2017 03:49:18 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-448201-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-448201-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-448201-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=VyvDnyBloWwxaIADZqXtEIDx+OECEJqp3VZZDb2IjbilMk IdPZhS+XcsYk71oMtSo6VpAYwFajYdNgEy5l6zaTy9NUbPo0Hfp+XD5OlQVhAkM5 hu4JpFg999KvcG1EogzLtwCNFDBx2XMZ7MIimr28hqSyY+6tmxYEUkpjzBm2Y= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=gob7Bww+9RnZInudiGPk/yZnwnU=; b=FSAvZZPNTMBpougtxK8O X2DqVwhM6BITFcIhXOIzGtRxkQ3jvgHkEHY67FG6PEXLml6Mlu1r6ZOWukq1ls5C IATustVXJ9o5WpAl1TY+M1cyt+IalgyvP7pUMOWSQBpMOFpnWgnlT9zsplqh1iXr IpWXA+NhYBLy6RGlOphxjzg= Received: (qmail 35772 invoked by alias); 8 Feb 2017 11:49:01 -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 35728 invoked by uid 89); 8 Feb 2017 11:48:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=auto_vec X-HELO: mail-it0-f52.google.com Received: from mail-it0-f52.google.com (HELO mail-it0-f52.google.com) (209.85.214.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Feb 2017 11:48:49 +0000 Received: by mail-it0-f52.google.com with SMTP id c7so100883569itd.1 for ; Wed, 08 Feb 2017 03:48:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=I3hjoECFtihfbz5Ghs30J1+xrx8AW5TsZmJpivpaOXE=; b=BJaQXMf7fIj6p3D5SHe7DOqs//gv9Bg72q/5l//F3j9p7Nq3REhptArQyPIOg6un+6 9+qmxNxf3dYB1kakuaQBvmtJ5G7Sw0+N2h5EQboMvhTDmAhbwCcVGGmVUw3fU5QLRtoz suloOyYJ1qNLUSMV3HjGOiMFmRBgyxuBLYqSOu3asZthknXS/7oQtSgBkETqCxnzv6le VwLh+drPK/qN0RfUiw0yL6UaCr2DA5WMATSfOQ1Si4tD+dD85xhHJ/E+jGviDYzeTZ2L wb0AYqSJC3kklbwBLjvwcj6O5q5fDlw8eCAsVBenoL2j8XO1igzylol5gi4OSm5XaykS KQJQ== X-Gm-Message-State: AIkVDXKWm4jxcdyAX/B97EhSHhgytEqSeFecBF9NEmHhwXh9CHp+Y43X9DAkgtuXF2DP5d42aNsr1eNFXotFum9C X-Received: by 10.36.120.144 with SMTP id p138mr16938347itc.71.1486554528302; Wed, 08 Feb 2017 03:48:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.162.13 with HTTP; Wed, 8 Feb 2017 03:48:47 -0800 (PST) From: Prathamesh Kulkarni Date: Wed, 8 Feb 2017 17:18:47 +0530 Message-ID: Subject: [ GIMPLE FE] replace calls to c_parser_gimple_unary_expression by c_parser_gimple_postfix_expression To: Richard Biener , gcc Patches X-IsSubscribed: yes Hi, The attached patch replaces couple of calls to c_parser_gimple_unary_expression by c_parser_gimple_postfix_expression, to reject invalid cases like: ~t0_1 = ~a; OK to commit after bootstrap+test ? Thanks, Prathamesh diff --git a/gcc/c/gimple-parser.c b/gcc/c/gimple-parser.c index 942597a..00809a5 100644 --- a/gcc/c/gimple-parser.c +++ b/gcc/c/gimple-parser.c @@ -268,7 +268,7 @@ c_parser_gimple_statement (c_parser *parser, gimple_seq *seq) tree arg = NULL_TREE; auto_vec vargs; - lhs = c_parser_gimple_unary_expression (parser); + lhs = c_parser_gimple_postfix_expression (parser); loc = EXPR_LOCATION (lhs.value); rhs.value = error_mark_node; @@ -403,7 +403,7 @@ c_parser_gimple_statement (c_parser *parser, gimple_seq *seq) && c_parser_peek_2nd_token (parser)->type == CPP_OPEN_PAREN && lookup_name (c_parser_peek_token (parser)->value)) { - rhs = c_parser_gimple_unary_expression (parser); + rhs = c_parser_gimple_postfix_expression (parser); if (rhs.value != error_mark_node) { gimple *call = gimple_build_call_from_tree (rhs.value);