This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/81931] [8 regression] r251260 breaks many tests on powerpc64
- From: "aldyh at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Aug 2017 11:54:32 +0000
- Subject: [Bug middle-end/81931] [8 regression] r251260 breaks many tests on powerpc64
- Auto-submitted: auto-generated
- References: <bug-81931-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81931
--- Comment #8 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
FWIW, the reason a cross x86-64 to ppc64 doesn't exhibit the problem may be
because
wi::shwi (-1, precision) calls sext_hwi() which eventually shifts left by 64
bits:
int shift = HOST_BITS_PER_WIDE_INT - prec;
return ((HOST_WIDE_INT) ((unsigned HOST_WIDE_INT) src << shift)) >>
shift;
AFAIK, shifting left by the entire width of a type is undefined, and I am
definitely seeing the above return instruction yield two different things on
x86-64 (0) than on ppc64 native (-1).