From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10350 invoked by alias); 6 Apr 2018 15:35:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10259 invoked by uid 89); 6 Apr 2018 15:35:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,T_RP_MATCHES_RCVD,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Apr 2018 15:35:31 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 884E7A1BDA for ; Fri, 6 Apr 2018 15:35:23 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.36.118.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 541FF215CDAF for ; Fri, 6 Apr 2018 15:35:19 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w36EAV0F001895; Fri, 6 Apr 2018 16:10:32 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w36EATE5000585; Fri, 6 Apr 2018 16:10:29 +0200 Date: Fri, 06 Apr 2018 15:35:00 -0000 From: Jakub Jelinek To: Cesar Philippidis , Richard Biener Cc: "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH] Handle empty infinite loops in OpenACC for PR84955 Message-ID: <20180406141029.GF8577@tucnak> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00320.txt.bz2 On Fri, Apr 06, 2018 at 06:48:52AM -0700, Cesar Philippidis wrote: > 2018-04-06 Cesar Philippidis > > PR middle-end/84955 > > gcc/ > * cfgloop.c (flow_loops_find): Add assert. > * omp-expand.c (expand_oacc_for): Add dummy false branch for > tiled basic blocks without omp continue statements. > * tree-cfg.c (execute_fixup_cfg): Handle calls to internal > functions like regular functions. > > libgomp/ > * testsuite/libgomp.oacc-c-c++-common/pr84955.c: New test. > * testsuite/libgomp.oacc-fortran/pr84955.f90: New test. I'd like to defer the cfgloop.c and tree-cfg.c changes to Richard, just want to mention that: > --- a/gcc/tree-cfg.c > +++ b/gcc/tree-cfg.c > @@ -9586,10 +9586,7 @@ execute_fixup_cfg (void) > for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);) > { > gimple *stmt = gsi_stmt (gsi); > - tree decl = is_gimple_call (stmt) > - ? gimple_call_fndecl (stmt) > - : NULL; > - if (decl) > + if (is_gimple_call (stmt)) This change doesn't affect just internal functions, but also all indirect calls through function pointers with const, pure or noreturn attributes. > --- a/gcc/omp-expand.c > +++ b/gcc/omp-expand.c > @@ -5439,6 +5439,13 @@ expand_oacc_for (struct omp_region *region, struct omp_for_data *fd) > > split->flags ^= EDGE_FALLTHRU | EDGE_TRUE_VALUE; > > + /* Add a dummy exit for the tiled block when cont_bb is missing. */ > + if (cont_bb == NULL) > + { > + edge e = make_edge (body_bb, exit_bb, EDGE_FALSE_VALUE); > + e->probability = profile_probability::even (); > + } I miss here updating of split->probability, if you make e even (the other edge needs to have probability of 100%-the probability, i.e. even as well. Jakub