From patchwork Wed Aug 19 17:37:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 508788 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 7ACD514032E for ; Thu, 20 Aug 2015 03:38:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=sQEOaUj4; 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:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=ujjXdsKHE2swhgJB6mn786HD3VLSQCLxiCej3yWdE7xAryLMsw BT+GInvE81vYD3pK0OGZ6VrG1AARXpQVLCD2hFYoDvUJsUnI1cmwWcp6UEA+OFFm F1buEnFiUveMDR+ls4ckWPE3Soqckb6X28WIcMLHZIAReQrthPLjAJFBk= 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:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=3CbyNdxRNeZvynwLMf6kXRjKjGY=; b=sQEOaUj4aJg91DHn0P37 Dj6lLOiOuD2ic6Kfv69mb9KRWIOBq7o5aqBLExB+lqCg+AMdRgNh2o3phFUZddoh 3u0lgb+La/ShSQjtutr3HE2PCWznGcYDjhlNHAFOyIpLG7BOnZu4DbHrILcLZwyJ sZdUkVObAa7/O/Y3nsqScPs= Received: (qmail 67566 invoked by alias); 19 Aug 2015 17:38:10 -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 67549 invoked by uid 89); 19 Aug 2015 17:38:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qk0-f179.google.com Received: from mail-qk0-f179.google.com (HELO mail-qk0-f179.google.com) (209.85.220.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 19 Aug 2015 17:37:59 +0000 Received: by qkbm65 with SMTP id m65so4864681qkb.2 for ; Wed, 19 Aug 2015 10:37:57 -0700 (PDT) X-Received: by 10.55.16.3 with SMTP id a3mr25223540qkh.65.1440005877299; Wed, 19 Aug 2015 10:37:57 -0700 (PDT) Received: from ?IPv6:2601:181:c000:c497:a2a8:cdff:fe3e:b48? ([2601:181:c000:c497:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id o2sm721187qkl.38.2015.08.19.10.37.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Aug 2015 10:37:56 -0700 (PDT) To: GCC Patches Cc: Cesar Philippidis , james norris From: Nathan Sidwell Subject: [gomp4] Fixacc_on_device xform Message-ID: <55D4BEF3.20307@acm.org> Date: Wed, 19 Aug 2015 13:37:55 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 I've committed this fix for a typo I introduced yesterday (and not testing what I thought I was testing). Sadly passing a gimple_seq to gsi_replace doesn't lead to a compile error, but to bad runtime behaviour. nathan 2015-08-19 Nathan Sidwell * omp-low.c (oacc_xform_on_device): Fix thinko in previous change. Index: gcc/omp-low.c =================================================================== --- gcc/omp-low.c (revision 226986) +++ gcc/omp-low.c (working copy) @@ -14619,14 +14621,14 @@ oacc_xform_on_device (gimple stmt) #endif result = fold_convert (integer_type_node, result); tree lhs = gimple_call_lhs (stmt); - gimple_seq replace = NULL; + gimple_seq seq = NULL; push_gimplify_context (true); - gimplify_assign (lhs, result, &replace); + gimplify_assign (lhs, result, &seq); pop_gimplify_context (NULL); gimple_stmt_iterator gsi = gsi_for_stmt (stmt); - gsi_replace (&gsi, replace, false); + gsi_replace_with_seq (&gsi, seq, false); } /* Transform oacc_dim_size and oacc_dim_pos internal function calls to