Message ID | 20191212143546.wusbyi263hzd55et@kam.mff.cuni.cz |
---|---|
State | New |
Headers | show |
Series | Fix ipa-cp bit propagation streaming | expand |
On 12/12/19 3:35 PM, Jan Hubicka wrote: > Hi, > this rather nasty bug makes value and mask to be exchanged during > streaming. This makes us to sometimes set bogus pointer alignments > and causes misoptimization of Firefox when built with GCC 9. Hi. I've just prepare and tested backport for both GCC 8 and 9 branches. I'm going to install the patches. @Honza: Can you please next time create a PR? It's the best tracker for release branches we have. Thanks, Martin > > Comitted as obvious. I will backport it to release branches soon - it > is quite dangerous bug. > > Honza > > * ipa-prop.c (read_ipcp_transformation_info): Fix undefined ordering > of execution of function call parameters. > Index: ipa-prop.c > =================================================================== > --- ipa-prop.c (revision 278815) > +++ ipa-prop.c (working copy) > @@ -4715,9 +4715,10 @@ read_ipcp_transformation_info (lto_input > bool known = bp_unpack_value (&bp, 1); > if (known) > { > + const widest_int value = streamer_read_widest_int (ib); > + const widest_int mask = streamer_read_widest_int (ib); > ipa_bits *bits > - = ipa_get_ipa_bits_for_value (streamer_read_widest_int (ib), > - streamer_read_widest_int (ib)); > + = ipa_get_ipa_bits_for_value (value, mask); > (*ts->bits)[i] = bits; > } > } >
Index: ipa-prop.c =================================================================== --- ipa-prop.c (revision 278815) +++ ipa-prop.c (working copy) @@ -4715,9 +4715,10 @@ read_ipcp_transformation_info (lto_input bool known = bp_unpack_value (&bp, 1); if (known) { + const widest_int value = streamer_read_widest_int (ib); + const widest_int mask = streamer_read_widest_int (ib); ipa_bits *bits - = ipa_get_ipa_bits_for_value (streamer_read_widest_int (ib), - streamer_read_widest_int (ib)); + = ipa_get_ipa_bits_for_value (value, mask); (*ts->bits)[i] = bits; } }