From patchwork Wed Oct 28 20:26:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 537560 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 077E11402B9 for ; Thu, 29 Oct 2015 07:26:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=d05DGF+E; 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=jEqQNCZ7AcX0pToKZpCn0uXb+TTcNJ/ZlQxza1bnxJLOSO7zRo k4pDPOLu9HgqOQfKggj7JVCoQn/oN1bB1lfiROyaa8PFq/SHft+eJUfV+rkZ02dh S+46/LmYDQlkfJzJ9wrPcPFYQHKScdMKCUXeZtre6x7qJwIafOkTQhGCo= 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=+ndbovCJ4xImzwj6aqz5WZmpalE=; b=d05DGF+EA9/joSION5u+ s568hEV0UPzrDD3alrX8SDzof1MnvjqTynfrlYjNZbxiRMO10TI78QpTuU1M9Vm2 chd2Om7t4OGaANaz0e4kPZNmH7JNvw8Tu5zVm20CHqZdfEY8vftB1WfKgSCzxiHu 0HNBKNiiRrhqraSF9FQA3cY= Received: (qmail 59924 invoked by alias); 28 Oct 2015 20:26:37 -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 59915 invoked by uid 89); 28 Oct 2015 20:26:36 -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-pa0-f52.google.com Received: from mail-pa0-f52.google.com (HELO mail-pa0-f52.google.com) (209.85.220.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 28 Oct 2015 20:26:35 +0000 Received: by padhy1 with SMTP id hy1so10674179pad.0 for ; Wed, 28 Oct 2015 13:26:33 -0700 (PDT) X-Received: by 10.66.66.196 with SMTP id h4mr35494368pat.113.1446063993460; Wed, 28 Oct 2015 13:26:33 -0700 (PDT) Received: from ?IPv6:2600:1012:b115:101e:a2a8:cdff:fe3e:b48? ([2600:1012:b115:101e:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id ha1sm47018572pbc.54.2015.10.28.13.26.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Oct 2015 13:26:32 -0700 (PDT) To: Jakub Jelinek Cc: GCC Patches From: Nathan Sidwell Subject: omp cleanup Message-ID: <56312F77.3010005@acm.org> Date: Wed, 28 Oct 2015 13:26:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Jakub, looking at the next thing to merge, I stumbled on code in lower_omp_target that appears at least confused. we have: if (offloaded || data_region) { A } else if (data_region) new_body = tgt_body; if (offloaded || data_region) { B } which can clearly be simplified to: if (offloaded || data_region) { A; B; } If that's incorrect, is the first '|| data_region' wrong? nathan 2015-10-28 Nathan Sidwell * omp-low.c (lower_omp_target): Remove unreachable code & merge ifs. Index: omp-low.c =================================================================== --- omp-low.c (revision 229499) +++ omp-low.c (working copy) @@ -15931,14 +15931,12 @@ lower_omp_target (gimple_stmt_iterator * } break; } + gimple_seq_add_seq (&new_body, tgt_body); + if (offloaded) new_body = maybe_catch_exception (new_body); - } - else if (data_region) - new_body = tgt_body; - if (offloaded || data_region) - { + gimple_seq_add_stmt (&new_body, gimple_build_omp_return (false)); gimple_omp_set_body (stmt, new_body); }