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

--- Comment #7 from Jan Hubicka <hubicka at ucw dot cz> ---
> void  
> output_offload_tables (void)
> {
>   ...
> 
>   /* In WHOPR mode during the WPA stage the joint offload tables need to be
>      streamed to one partition only.  That's why we free offload_funcs and
>      offload_vars after the first call of output_offload_tables.  */
>   if (flag_wpa)
>     {
>       vec_free (offload_funcs);
>       vec_free (offload_vars);
>       vec_free (offload_ind_funcs);
>     }
> }
> 
> which obviously fails if multiple forks process such that each forks writes it
> once, before freeing the vector ...

We treat first partition somewhat specially in other code too, so I
guess we could a test if the streamed partition is first one instad of
relying on free to happen.

Reply via email to