diff mbox series

Fix ipa-cp bit propagation streaming

Message ID 20191212143546.wusbyi263hzd55et@kam.mff.cuni.cz
State New
Headers show
Series Fix ipa-cp bit propagation streaming | expand

Commit Message

Jan Hubicka Dec. 12, 2019, 2:35 p.m. UTC
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.

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.

Comments

Martin Liška Jan. 9, 2020, 10:32 a.m. UTC | #1
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;
>   	    }
>   	}
>
diff mbox series

Patch

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;
 	    }
 	}