[pretty-ipa, omp] Fix cgraph edge building in omp lowering
Jan Hubicka
hubicka@ucw.cz
Tue Feb 17 13:36:00 GMT 2009
> On Mon, Feb 16, 2009 at 04:20:08PM +0100, Richard Guenther wrote:
> > On Mon, Feb 16, 2009 at 4:07 PM, Martin Jambor <mjambor@suse.cz> wrote:
> > > Hi,
> > >
> > > omp-low.c fails to create any call graph edges for its newly created
> > > functions because it does not set current_function_decl when calling
> > > rebuild_cgraph_edges() which requires it to function properly.
> > > the following patch fixes this. It has passed bootstrap and caused no
> > > new regressions, ok for pretty-ipa?
> > >
> > > There's no testcase, but a patch I will hopefully send out in the next
> > > few days miscompiles a testcase we already have (strassen) without
> > > this fix.
> > >
> > > Moreover, please note that the new functions do not have any callers
> > > either. This cannot be easily fixed with rebuild_cgraph_edges()
> > > because they are invoked through __builtin_GOMP_task(). I am not sure
> > > whether this is a problem, but unlike the other bug it does not bother
> > > me at the moment.
> >
> > With the patch it seems that rebuild_cgraph_edges is called for the
> > same function as before. Or am I missing something?
> >
> > > /* Fix the callgraph edges for child_cfun. Those for cfun will be
> > > fixed in a following pass. */
> > > push_cfun (child_cfun);
> > > + save_current = current_function_decl;
> > > if (optimize)
> > > optimize_omp_library_calls (entry_stmt);
> > > rebuild_cgraph_edges ();
> >
> > shouldn't this also set current_function_decl to child_cfun->decl?
>
> Ouch, I did not re-create the patch correctly. I'm about to test the
> following. Thanks for noticing it before it hit me again.
>
> Martin
>
>
> 2009-02-16 Martin Jambor <mjambor@suse.cz>
>
> * omp-low.c (expand_omp_taskreg): Always setting current_function_decl.
Seems fine for the branch.
Honza
More information about the Gcc-patches
mailing list