[PATCH] Fix PR63266: Keep track of impact of sign extension in bswap
Thomas Preud'homme
thomas.preudhomme@arm.com
Wed Oct 22 08:57:00 GMT 2014
> From: Christophe Lyon [mailto:christophe.lyon@linaro.org]
> Sent: Tuesday, October 21, 2014 10:03 PM
> > +typedef int SItype __attribute__ ((mode (SI)));
> What's the purpose of this? It seems unused.
Sigh. Bad copy/paste from optimize-bswapsi-1.c
I'll add it to my patch for pr63259.
> I believe this should be:
> "checks that unknown byte markers are set correctly in case of cast"
Indeed, there is a 's' missing for markers.
>
> > +
> > +HItype
> > +swap16 (HItype in)
> > +{
> > + return (HItype) (((in >> 0) & 0xFF) << 8)
> > + | (((in >> 8) & 0xFF) << 0);
> > +}
> > +
> > /* { dg-final { scan-tree-dump-times "16 bit load in target endianness
> found at" 3 "bswap" } } */
> > -/* { dg-final { scan-tree-dump-times "16 bit bswap implementation
> found at" 3 "bswap" { xfail alpha*-*-* arm*-*-* } } } */
> > +/* { dg-final { scan-tree-dump-times "16 bit bswap implementation
> found at" 1 "bswap" { target alpha*-*-* arm*-*-* } } } */
>
> This line fails when forcing the compiler to target -march=armv5t for
> instance. I suspect this is because the check_effective_target_bswap
> test is too permissive.
Yep, it's likely to be the case. Feel to add a version check in it.
Thanks for the review.
Best regards,
Thomas
More information about the Gcc-patches
mailing list