[PATCH] Fix PR58115

Jakub Jelinek jakub@redhat.com
Thu Jan 9 09:43:00 GMT 2014


On Thu, Jan 09, 2014 at 10:36:43AM +0100, Bernd Edlinger wrote:
> On Thu, 9 Jan 2014 10:28:43, Jakub Jelinek wrote:
> >
> > On Thu, Jan 09, 2014 at 09:02:28AM +0000, Richard Sandiford wrote:
> >>> I think Jakub's patch will fix this case, but I did not try.
> >>> However even if the i368 is now clean, there are
> >>> still many targets that use target_reinit() in
> >>> target_set_current_function.
> >>
> >> FWIW I only see three others (nios, rs6000 and rx). nios and rs6000
> >> are direct cut-&-pastes of the i386 version so should be easy to switch.
> >> rx looks more like MIPS in that it's switching between two specific
> >> subtargets.
> >
> > Yeah, if i386 is changed into SWITCHABLE_TARGET, then I'd strongly encourage
> > rs6000 and nios folks to follow the suit.
> >
> > Jakub
> 
> Ok for me. Hope they read this thread...
> 
> If that is our policy for 4.9.0, then the comment in function.c where
> the targetm.set_current_function (fndecl); is called should
> _very_ clearly say that this callback is no longer allowed to call
> target_reinit() any more.

But that is not the case, even with the i386 SWITCHABLE_TARGET patch it may
call target_reinit, because that is what save_target_globals_default_opts
calls.  It just calls it temporarily with the optimization_default_node.

	Jakub



More information about the Gcc-patches mailing list