Re: Do not drom MEM_EXPR when accessing structure fields

2016-09-19 Thread Bernd Edlinger
On 09/19/16 16:23, Richard Biener wrote: > On 19/09/16 15:49, Bernd Edlinger wrote: >> On 09/19/16 11:28, Richard Biener wrote: >>> On Sun, 18 Sep 2016, Jan Hubicka wrote: >>> > Hi, > >> when expanding code for >> struct a {short a,b,c,d;} *a; >> a->c; >>

Re: Do not drom MEM_EXPR when accessing structure fields

2016-09-19 Thread Richard Biener
On 19/09/16 15:49, Bernd Edlinger wrote: > On 09/19/16 11:28, Richard Biener wrote: >> On Sun, 18 Sep 2016, Jan Hubicka wrote: >> Hi, > when expanding code for > struct a {short a,b,c,d;} *a; > a->c; > > we first produce correct BLKmode MEM rtx

Re: Do not drom MEM_EXPR when accessing structure fields

2016-09-19 Thread Bernd Edlinger
On 09/19/16 11:28, Richard Biener wrote: > On Sun, 18 Sep 2016, Jan Hubicka wrote: > >>> Hi, >>> >>> > when expanding code for >>> > struct a {short a,b,c,d;} *a; >>> > a->c; >>> > >>> > we first produce correct BLKmode MEM rtx representing the whole >>> > structure *a, >>> > then we

Re: Do not drom MEM_EXPR when accessing structure fields

2016-09-19 Thread Bernd Schmidt
On 09/18/2016 02:51 PM, Jan Hubicka wrote: to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE); - - /* If the field has a mode, we want to access it in the -field's mode, not the computed mode. -If a MEM has VOIDmode (external with incomplete type), -

Re: Do not drom MEM_EXPR when accessing structure fields

2016-09-19 Thread Richard Biener
On Sun, 18 Sep 2016, Jan Hubicka wrote: > > Hi, > > > > > when expanding code for > > > struct a {short a,b,c,d;} *a; > > > a->c; > > > > > > we first produce correct BLKmode MEM rtx representing the whole > > > structure *a, > > > then we use adjust_address to turn it into HImode MEM and

Re: Do not drom MEM_EXPR when accessing structure fields

2016-09-18 Thread Jan Hubicka
> Hi, > > > when expanding code for > > struct a {short a,b,c,d;} *a; > > a->c; > > > > we first produce correct BLKmode MEM rtx representing the whole > > structure *a, > > then we use adjust_address to turn it into HImode MEM and finally > > extract_bitfield is used to offset it by 32

Re: Do not drom MEM_EXPR when accessing structure fields

2016-09-18 Thread Bernd Edlinger
Hi, > when expanding code for > struct a {short a,b,c,d;} *a; > a->c; > > we first produce correct BLKmode MEM rtx representing the whole > structure *a, > then we use adjust_address to turn it into HImode MEM and finally > extract_bitfield is used to offset it by 32 bits to get correct

Do not drom MEM_EXPR when accessing structure fields

2016-09-18 Thread Jan Hubicka
Hi, when expanding code for struct a {short a,b,c,d;} *a; a->c; we first produce correct BLKmode MEM rtx representing the whole structure *a, then we use adjust_address to turn it into HImode MEM and finally extract_bitfield is used to offset it by 32 bits to get correct value. The catch is