From patchwork Sat Jul 26 08:59:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gareev X-Patchwork-Id: 373933 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 238DA140095 for ; Sat, 26 Jul 2014 18:59:18 +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:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=Tu3h6LnYtPOswIvkR6 uD7U5s9kA+RPdDCVQgE9bK2ejMPoF+1Sb4dLPy1iTkGetNRPVv2mcGr6z8TpiPGU PgRMScRTuonA+RD6Q+VSDexklSjpTaWs5fWrz8DRbDIiFqAnIx093L6Xnm0LKj8y SQcWoQBQxHqebe9AfO+4kVRBA= 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:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=dzJPd8IJDGZaCxJdB2PfEzM7 Ggs=; b=oP6Lub4K+MLooZdOIDeQRrxkix75Olc+no4wmtYGfI/D0h2NKmzorWqO snSZcitbqRy/FzUwVjBiWak8IPvezeDgZAEO+srU28w2qDDrSUHItwAYGcT3FMa6 uUM2+LmG6Rh28bsyIspxSFXb+23zug5C2n87GQBzko91VoNdhPc= Received: (qmail 26834 invoked by alias); 26 Jul 2014 08:59:11 -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 26823 invoked by uid 89); 26 Jul 2014 08:59:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yh0-f49.google.com Received: from mail-yh0-f49.google.com (HELO mail-yh0-f49.google.com) (209.85.213.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 26 Jul 2014 08:59:08 +0000 Received: by mail-yh0-f49.google.com with SMTP id b6so3635351yha.36 for ; Sat, 26 Jul 2014 01:59:07 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.236.90.209 with SMTP id e57mr30473899yhf.135.1406365146896; Sat, 26 Jul 2014 01:59:06 -0700 (PDT) Received: by 10.170.91.134 with HTTP; Sat, 26 Jul 2014 01:59:05 -0700 (PDT) In-Reply-To: <53D23FC4.7020607@grosser.es> References: <53D0E24B.2090101@grosser.es> <53D23FC4.7020607@grosser.es> Date: Sat, 26 Jul 2014 14:59:05 +0600 Message-ID: Subject: Re: [GSoC] generation of Gimple code from isl_ast_node_if From: Roman Gareev To: Tobias Grosser Cc: Mircea Namolaru , gcc-patches@gcc.gnu.org If I'm not mistaken, the reason of this bug is incorrect creation of a poly_bb_p for basic_block from the existing pbb in new_pbb_from_pbb (It is located in graphite-sese-to-poly.c). I think, that we should set a new id of pbb1->domain (instead of using the id of the pbb), which contains pointer to the pbb1. I found out this after dumping of an index of pbb in the user statement S_3. Its index is 9. It is created in rewrite_reduction_out_of_ssa using new_pbb_from_pbb and the pbb with index 3. After that the user statement S_3 is removed in build_scop_drs, but the id of the pbb->domain and the pbb->transformed point to the old pbb with index 3. I've attached the patch, which may fix this. --- Cheers, Roman Gareev. Index: gcc/graphite-sese-to-poly.c =================================================================== --- gcc/graphite-sese-to-poly.c (revision 212995) +++ gcc/graphite-sese-to-poly.c (working copy) @@ -2044,6 +2044,10 @@ break; pbb1->domain = isl_set_copy (pbb->domain); + char name[50]; + snprintf (name, sizeof (name), "S_%d", pbb_index (pbb1)); + pbb1->domain = isl_set_set_tuple_id (pbb1->domain, + isl_id_alloc (scop->ctx, name, pbb1)); GBB_PBB (gbb1) = pbb1; GBB_CONDITIONS (gbb1) = GBB_CONDITIONS (gbb).copy ();