[PATCH] Fix up 20181120-1.c testcase on big-endian (PR rtl-optimization/85925)

Segher Boessenkool segher@kernel.crashing.org
Wed Nov 21 18:08:00 GMT 2018


On Wed, Nov 21, 2018 at 06:31:43PM +0100, Jakub Jelinek wrote:
> > > As mentioned in the PR, the testcase fails on big-endian targets.
> > > The following patch tweaks it so that it does not fail there and still
> > > checks for the original bug.
> > 
> > It relies on a certain bitfield layout, not just on LE.  I think the
> > testcase should run only on those specific targets where it works.  I don't
> > see how this patch would fix the problem for BE, btw.
> 
> With the patch, it doesn't rely on anything, it compares if what you get at
> runtime from the code combiner would optimize is equal to what is read from
> a volatile union.

Oh, I think I misread it, sorry :-)

> Admittedly, it might be better if the initializer was 0x1010101 or say
> 0x4030201 because on big endian in particular 0x10101 has the top 15 bits
> all zero and thus that is what is in u.f1, so if the bug can be reproduced
> with the combine.c + rtlanal.c fix reverted with 0x4030201, it would be
> better to use that value (in both spots).

Yeah good point.


Segher



More information about the Gcc-patches mailing list