[Bug target/81471] internal compiler error: in curr_insn_transform, at lra-constraints.c:3495
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81471 --- Comment #4 from Gian-Carlo Pascutto --- Further reduced testcase: #include uint64_t f(uint64_t x) { return ((uint32_t)x << 55) | ((uint32_t)x >> -23); } This makes it more clear the code is UB, but AFAIK a compiler ICE doesn't fall under allowable UB :-)
[Bug target/81471] internal compiler error: in curr_insn_transform, at lra-constraints.c:3495
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81471 --- Comment #3 from Gian-Carlo Pascutto --- Note the flags, -march=native in this case was Intel Haswell. -O3 -march=haswell is required to trigger this.
[Bug target/81471] internal compiler error: in curr_insn_transform, at lra-constraints.c:3495
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81471 --- Comment #2 from Gian-Carlo Pascutto --- #include inline uint32_t rotl(const uint32_t x, const int k) { return (x << k) | (x >> (32 - k)); } uint64_t s[2]; uint64_t random(void) { const uint64_t s0 = s[0]; uint64_t s1 = s[1]; const uint64_t result = s0 + s1; s1 ^= s0; s[0] = rotl(s0, 55) ^ s1 ^ (s1 << 14); s[1] = rotl(s1, 36); return result; } int main(void) { int x = random(); return 0; } According to https://godbolt.org/g/8CVJ9a this is broken in all current gcc versions, not just 5.4.0.
[Bug c/81471] New: internal compiler error: in curr_insn_transform, at lra-constraints.c:3495
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81471 Bug ID: 81471 Summary: internal compiler error: in curr_insn_transform, at lra-constraints.c:3495 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: gcp at sjeng dot org Target Milestone: --- gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) -Wall -Wextra -pipe -O3 -g -ffast-math -march=native -flto -fopenmp -std=c++11 -DNDEBUG -D_CONSOLE UCTSearch.cpp:130:1: error: unable to generate reloads for: } ^ (insn 1085 1084 1086 88 (set (reg:DI 538 [ D.12393 ]) (zero_extend:DI (rotatert:SI (subreg:SI (reg/v:DI 321 [ s0 ]) 0) (const_int -23 [0xffe9] Random.cpp:30 590 {*bmi2_rorxsi3_1_zext} (nil)) UCTSearch.cpp:130:1: internal compiler error: in curr_insn_transform, at lra-constraints.c:3495 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. lto-wrapper: fatal error: /usr/bin/g++-5.real returned 1 exit status compilation terminated. /usr/bin/ld.bfd.real: error: lto-wrapper failed The offending function is: uint64 Random::random(void) { const uint64 s0 = s[0]; uint64 s1 = s[1]; const uint64 result = s0 + s1; s1 ^= s0; s[0] = Utils::rotl(s0, 55) ^ s1 ^ (s1 << 14);<<<<<<<<<<<<<<< s[1] = Utils::rotl(s1, 36); return result; } In another module there is: inline uint32 rotl(const uint32 x, const int k) { return (x << k) | (x >> (32 - k)); } Note that the code is buggy, the rotl should be using 64-bit integers. But gcc shouldn't ICE.
[Bug lto/65950] Loop is not vectorized with lto.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65950 Gian-Carlo Pascutto changed: What|Removed |Added CC||gcp at sjeng dot org --- Comment #6 from Gian-Carlo Pascutto --- I'm seeing similar behavior in gcc-4.9.2 (debian stable) and gcc-5.3.1 (Ubuntu 16.04 prelease). Adding -flto causes certain loops not to get vectorized, adding -fno-lto to affected files fixes it. Unfortunately producing a reduced testcase is not so easy, but program source is available to gcc devs on request.