On Thu, Jan 29, 2015 at 11:39 AM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Thu, Jan 29, 2015 at 06:27:36PM +0800, Thomas Preud'homme wrote:
>> Incorrect folding happen when a bitfield in a union is accessed and the 
>> union was initialized via another field. This is a reminiscence of 
>> GCC32RM-325 due to sccvn not passing the right size to fold_ctor_reference. 
>> sccvn uses TYPE_SIZE which gives the size of the container integer for a 
>> bitfield instead of TYPE_PRECISION that gives the actual size occupied by 
>> the bitfield. This patch fixes that and modify bitfld-6 so that it catch 
>> this issue in addition to the old one.
>>
>> ChangeLog entries are as follows:
>>
>> *** gcc/ChangeLog ***
>>
>> 2015-01-28  Thomas Preud'homme  <thomas.preudho...@arm.com>
>>
>
> You should mention
>         PR middle-end/62103
> I'll defer review of the sccvn change to Richard.
>
>>         * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Use 
>> TYPE_PRECISION
>>         to compute size of referenced value in the constant case.
>>
>> *** gcc/testsuite/ChangeLog ***
>>
>> 2015-01-28  Thomas Preud'homme  <thomas.preudho...@arm.com>
>>
>>         * gcc.c-torture/execute/bitfld-6.c: Use 24 bits for bitfield b.  
>> Adapt
>>         expected values accordingly.
>
> IMHO if the old testcase wasn't incorrect, you'd better add a new testcase
> instead of modifying existing one.

Yeah - please add a new testcase.  The patch is otherwise ok.

Thanks,
Richard.

>         Jakub

Reply via email to