From patchwork Fri Aug 17 13:09:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Monakov X-Patchwork-Id: 958804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-483851-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ispras.ru Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Jo87dF9L"; dkim-atps=neutral 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 41sNp62hT9z9s3x for ; Fri, 17 Aug 2018 23:09:32 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:in-reply-to:message-id:references:mime-version :content-type; q=dns; s=default; b=PP5yXbiWcFT+iy+mEpXS8+Z+PNvYC 6R0Za0m9XC3Vr6CkzoitMWNyr+GWvE1sDcPO4vSvMfTypIhyhwDdZAhc6w2G4rxb aTWd17LidzKVob+OMWJlOB07cVwcA3itsJ5vGcMKSBpySpyMSRz/aDUgurEY21D+ gxPAbetW5BgKvc= 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:date :from:to:subject:in-reply-to:message-id:references:mime-version :content-type; s=default; bh=GQoFkqUPj69vIx8BF2qpJaC1MwY=; b=Jo8 7dF9L100eVbtqBDW3oG8vQVowtTJBSzCpHhAnCzqHH8X+JpvteQULvgG7aF9eEZB WU7dtVSAcOFFrBh+ffBRGjBMqBvrMBDvVlNTvGw2IN7HbnqLA6aCjrOTxDDNZRAf WwiZd+22oe/nt3xyg2iC+7fx1iLa9z3DhYMDvgZM= Received: (qmail 121312 invoked by alias); 17 Aug 2018 13:09:25 -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 121300 invoked by uid 89); 17 Aug 2018 13:09:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.ispras.ru Received: from bran.ispras.ru (HELO smtp.ispras.ru) (83.149.199.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Aug 2018 13:09:23 +0000 Received: from monopod.intra.ispras.ru (monopod.intra.ispras.ru [10.10.3.121]) by smtp.ispras.ru (Postfix) with ESMTP id 899BB2127F for ; Fri, 17 Aug 2018 16:09:21 +0300 (MSK) Date: Fri, 17 Aug 2018 16:09:21 +0300 (MSK) From: Alexander Monakov To: gcc-patches@gcc.gnu.org Subject: [PATCH RFC] gimplefe: expose MULT_HIGHPART_EXPR In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 For testing generic expansion of MULT_HIGHPART_EXPR I chose to expose it via the GIMPLE FE with the following patch. "h*" is how tree-pretty-print dumps MULT_HIGHPART_EXPR. This patch accepts "h*" which ideally shouldn't happen, but I don't see a simple way to fix that. Is this desirable for trunk? Is there general policy for how fancy tree codes should be exposed in the GIMPLE FE? * c/gimple-parser.c (c_parser_gimple_statement): Add "h*" for MULT_HIGHPART_EXPR. diff --git a/gcc/c/gimple-parser.c b/gcc/c/gimple-parser.c index 1be5d14dc2d..cf05c936166 100644 --- a/gcc/c/gimple-parser.c +++ b/gcc/c/gimple-parser.c @@ -450,6 +450,7 @@ c_parser_gimple_statement (c_parser *parser, gimple_seq *seq) gimple-binary-expression: gimple-unary-expression * gimple-unary-expression + gimple-unary-expression h* gimple-unary-expression gimple-unary-expression / gimple-unary-expression gimple-unary-expression % gimple-unary-expression gimple-unary-expression + gimple-unary-expression @@ -544,6 +545,18 @@ c_parser_gimple_binary_expression (c_parser *parser) case CPP_OR_OR: c_parser_error (parser, "%<||%> not valid in GIMPLE"); return ret; + case CPP_NAME: + { + tree id = c_parser_peek_token (parser)->value; + if (strcmp (IDENTIFIER_POINTER (id), "h") == 0 + && c_parser_peek_2nd_token (parser)->type == CPP_MULT) + { + c_parser_consume_token (parser); + code = MULT_HIGHPART_EXPR; + break; + } + } + /* Fallthru. */ default: /* Not a binary expression. */ return lhs;