From patchwork Mon Jun 23 13:43:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Kulkarni X-Patchwork-Id: 362915 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 02BB914007C for ; Mon, 23 Jun 2014 23:43:52 +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 :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=h7ATqOHsrOYBvZcKzO0j3AOVoOSuR4x5LQstAdK28M8 PCtxnOxt72tR0bf0T2t3afWXjy1ThK5lN1AFmto43Bni6OQbWDWXtChnVTXN407d cT9MhlZeHCij2e9Bd+OaSYqCXVJFBw6TQYQrV6cN+nwASSCI8rbHJH8LrrOhuTFA = 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:date:message-id:subject:from:to:cc:content-type; s=default; bh=xVRozWN+ZrCScbA7Vwb5gz6cfbc=; b=xnuQhcRaQKNYXegXS N47xPLNyj5YokIiBGU1ICTG+wJFwa7AnOoedfaEdJ9l1KpCd52Oz9SobiqwaA9vi oSMydWrvRX0SZXZaWCeVbhqV9JsyFqjAZCRdwHJ25iv1ZVYla7Ni26rW1QmiYKlv uxEGwUIiKcGTq1PV+9qY+uO55s= Received: (qmail 32308 invoked by alias); 23 Jun 2014 13:43:45 -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 32295 invoked by uid 89); 23 Jun 2014 13:43:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f171.google.com Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com) (209.85.214.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 23 Jun 2014 13:43:43 +0000 Received: by mail-ob0-f171.google.com with SMTP id nu7so4018973obb.16 for ; Mon, 23 Jun 2014 06:43:41 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.33.199 with SMTP id t7mr2714891oei.73.1403531021343; Mon, 23 Jun 2014 06:43:41 -0700 (PDT) Received: by 10.182.113.67 with HTTP; Mon, 23 Jun 2014 06:43:41 -0700 (PDT) Date: Mon, 23 Jun 2014 19:13:41 +0530 Message-ID: Subject: [GSoC][match-and-simplify] Remove gen_gimple_match_fail From: Prathamesh Kulkarni To: Richard Biener Cc: Diego Novillo , "gcc-patches@gcc.gnu.org" , Maxim Kuvyrkov X-IsSubscribed: yes * genmatch.c (gen_gimple_match_fail): Remove. (expr::gen_gimple_transform): Remove call to gen_gimple_match_fail. Change fprintf (f, "if (!res)") to fprintf (f, "if (!res) return false;\n") Thanks and Regards, Prathamesh Index: gcc/genmatch.c =================================================================== --- gcc/genmatch.c (revision 211893) +++ gcc/genmatch.c (working copy) @@ -452,15 +452,6 @@ commutate (operand *op) /* Code gen off the AST. */ -static void -gen_gimple_match_fail (FILE *f, const char *label) -{ - if (!label) - fprintf (f, "return NULL_TREE;\n"); - else - fprintf (f, "goto %s;\n", label); -} - void expr::gen_gimple_transform (FILE *f, const char *label, const char *dest) { @@ -481,8 +472,7 @@ expr::gen_gimple_transform (FILE *f, con for (unsigned i = 0; i < ops.length (); ++i) fprintf (f, ", ops[%u]", i); fprintf (f, ", seq, valueize);\n"); - fprintf (f, " if (!res) "); - gen_gimple_match_fail (f, label); + fprintf (f, " if (!res) return false;\n"); fprintf (f, " }\n"); fprintf (f, " else\n"); fprintf (f, " res = gimple_build (seq, UNKNOWN_LOCATION, %s, "