Re: [PATCH] Fix incorrect folding of bitfield in a union on big endian target

2014-08-13 Thread Jakub Jelinek
On Wed, Aug 13, 2014 at 04:21:24PM +0800, Thomas Preud'homme wrote: > > From: Richard Biener [mailto:richard.guent...@gmail.com] > > Sent: Monday, August 11, 2014 8:29 PM > > > > That's now extra compares (the operand_equal_p check now does > > a check that can be derived transitively). > > > > S

RE: [PATCH] Fix incorrect folding of bitfield in a union on big endian target

2014-08-13 Thread Thomas Preud'homme
> From: Richard Biener [mailto:richard.guent...@gmail.com] > Sent: Monday, August 11, 2014 8:29 PM > > That's now extra compares (the operand_equal_p check now does > a check that can be derived transitively). > > So - ok with the operand_equal_p cehck removed. > > Also see if this can be backpo

Re: [PATCH] Fix incorrect folding of bitfield in a union on big endian target

2014-08-11 Thread Richard Biener
On Mon, Aug 11, 2014 at 9:36 AM, Thomas Preud'homme wrote: > In the code dealing with folding of structure and union initialization, there > is a > check that the size of the constructor is the same as the field being read. > However, in the case of bitfield this test can be wrong because it reli

Re: [PATCH] Fix incorrect folding of bitfield in a union on big endian target

2014-08-11 Thread Mikael Pettersson
Thomas Preud'homme writes: > In the code dealing with folding of structure and union initialization, > there is a > check that the size of the constructor is the same as the field being read. > However, in the case of bitfield this test can be wrong because it relies on > TYPE_SIZE to get the

RE: [PATCH] Fix incorrect folding of bitfield in a union on big endian target

2014-08-11 Thread Thomas Preud'homme
> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- > ow...@gcc.gnu.org] On Behalf Of Thomas Preud'homme > > No regression were observed on any of the tests. The ChangeLog is as > follows: > > > 2014-08-11 Thomas Preud'homme > > * gimple-fold.c (fold_ctor_reference): Don't fold

[PATCH] Fix incorrect folding of bitfield in a union on big endian target

2014-08-11 Thread Thomas Preud'homme
In the code dealing with folding of structure and union initialization, there is a check that the size of the constructor is the same as the field being read. However, in the case of bitfield this test can be wrong because it relies on TYPE_SIZE to get the size of the field being read but TYPE_SIZ