From patchwork Wed Sep 8 17:17:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 64183 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]) by ozlabs.org (Postfix) with SMTP id 7F679B6EFF for ; Thu, 9 Sep 2010 03:16:41 +1000 (EST) Received: (qmail 20911 invoked by alias); 8 Sep 2010 17:16:39 -0000 Received: (qmail 20896 invoked by uid 22791); 8 Sep 2010 17:16:38 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Sep 2010 17:16:34 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o88HGXtH021757 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 8 Sep 2010 13:16:33 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o88HGWni011755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Sep 2010 13:16:33 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id o88HH0tl018819; Wed, 8 Sep 2010 19:17:01 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id o88HH05Q018818; Wed, 8 Sep 2010 19:17:00 +0200 Date: Wed, 8 Sep 2010 19:17:00 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: [PATCH] Enable frontend-passes.c optimizations even in omp regions etc. Message-ID: <20100908171700.GN1269@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes 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 Hi! optimize_code_node doesn't dive into OpenMP etc. regions. The following patch fixes it by walking ->block in the default case. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2010-09-08 Jakub Jelinek * frontend-passes.c (optimize_code_node): Walk block chain by default. Jakub --- gcc/fortran/frontend-passes.c.jj 2010-09-06 08:41:42.000000000 +0200 +++ gcc/fortran/frontend-passes.c 2010-09-07 22:06:52.000000000 +0200 @@ -225,8 +225,12 @@ optimize_code_node (gfc_code *c) case EXEC_OMP_TASK: case EXEC_OMP_TASKWAIT: case EXEC_OMP_WORKSHARE: + case EXEC_OMP_END_NOWAIT: + case EXEC_OMP_END_SINGLE: case EXEC_DEALLOCATE: - + case EXEC_DT_END: + for (d = c->block; d; d = d->block) + optimize_code (d->next); break; default: