https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105459

--- Comment #10 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Kewen Lin from comment #8)
> (In reply to Kewen Lin from comment #7)
> > I wonder if it's fine to move init_function_start downward after
> > execute_all_ipa_transforms call? the testing is ongoing.
> 
> This proposed patch was bootstrapped and regress-tested. I think it's
> reasonable as it can avoid uninitialized target global issue (on secondary
> members) exposed by this bug.
> 

Just noticed that in execute_pass_list (cfun, g->get_passes ()->all_passes),
it's still possible in theory to change the cfun and cause the possible target
global creation (call save_target_globals_default_opts for a totally new target
option node, I think it wants copying actually) in target hook. Although the
proposed fix can make the ICE gone, this issue gets exposed is due to the
special handlings introduced by r11-5855 which creates target globals again.

Technically speaking we can create one new target option node and with a new
target globals in set_current_function hook without any restricted conditions,
then this issue can be exposed easily. Not sure this kind of need would become
popular or not, if yes, we probably need to add one deep copy interface for
target globals when its previous target global having
this_target_rtl->target_specific_initialized true.

Reply via email to