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 [0xffffffffffffffe9])))) 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 <file:///usr/share/doc/gcc-5/README.Bugs> 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.

Reply via email to