https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98549

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
           Priority|P3                          |P1
                 CC|                            |segher at gcc dot gnu.org
           Assignee|marxin at gcc dot gnu.org          |unassigned at gcc dot 
gnu.org
             Status|ASSIGNED                    |NEW

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

$ extern "C" void *memcpy(void *, const void *, unsigned long);
inline void copy_mem(unsigned char *out, unsigned char *in, long n) {
  memcpy(out, in, n);
}
template <typename T> void typecast_copy(unsigned char out[], T in, long N) {
  memcpy(out, in, sizeof(T) * N);
}
template <typename T> void typecast_copy(T out, unsigned char in[], long N) {
  memcpy(out, in, sizeof(T) * N);
}
unsigned long xor_buf_y[1];
inline void xor_buf(unsigned char out[], unsigned char in[]) {
  unsigned long x[4];
  typecast_copy(x, out, 4);
  typecast_copy(xor_buf_y, in, 4);
  x[0] ^= xor_buf_y[0];
  x[3] ^= 3;
  typecast_copy(out, x, 4);
}
char compress_n_S_10, compress_n_S_8, compress_n_S_27, compress_n_S_25,
    compress_n_S_0;
unsigned char compress_n___trans_tmp_1;
unsigned char *compress_n_input;
void compress_n() {
  unsigned char S[32], S2[32];
  S2[9] = compress_n_S_25;
  S2[13] = S[7];
  S2[14] = S[28];
  S2[15] = S2[16] = S[0];
  S2[17] = 9 ^ S[31];
  S2[18] = S[8];
  S2[19] = S[29];
  S2[21] = compress_n_S_27;
  S2[22] = compress_n_S_10;
  S2[23] = S[1];
  S2[24] = S[6];
  S2[25] = S[23];
  S2[6] = S[2] ^ compress_n_S_8;
  S2[7] = S[9];
  S2[8] = S[22];
  S2[29] = S[11] ^ S[17];
  S2[0] = S[12] ^ compress_n_S_0;
  S2[1] = S[5] ^ S[3];
  long x[4], y[4];
  typecast_copy(x, S2, 4);
  typecast_copy(y, compress_n_input, 4);
  x[0] ^= y[0];
  x[1] ^= y[1];
  x[2] ^= x[3] ^= y[3];
  typecast_copy(S, x, 4);
  S2[1] = 5 ^ S[7];
  copy_mem(S, S + 2, 30);
  S[31] = S2[1];
  xor_buf(S, &compress_n___trans_tmp_1);
  S2[2] = S2[3] = S2[4] = S[24];
  S2[5] = S2[0] = compress_n_S_8 ^ S[4] ^ S[28];
  char *__trans_tmp_2;
  memcpy(__trans_tmp_2, S2, 32);
}

$ g++ pr98549.C -c  -O3 -fPIC -fstack-protector
In function ‘void typecast_copy(T, unsigned char*, long int) [with T = long
unsigned int*]’,
    inlined from ‘void xor_buf(unsigned char*, unsigned char*)’ at
pr98549.C:15:16,
    inlined from ‘void compress_n()’ at pr98549.C:54:10:
pr98549.C:9:9: warning: ‘void* memcpy(void*, const void*, long unsigned int)’
writing 32 bytes into a region of size 8 overflows the destination
[-Wstringop-overflow=]
    9 |   memcpy(out, in, sizeof(T) * N);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
pr98549.C: In function ‘void compress_n()’:
pr98549.C:11:15: note: destination object ‘xor_buf_y’ of size 8
   11 | unsigned long xor_buf_y[1];
      |               ^~~~~~~~~
during RTL pass: reload
pr98549.C:59:1: internal compiler error: in rs6000_emit_le_vsx_store, at
config/rs6000/rs6000.c:9938
   59 | }
      | ^
0x606caa rs6000_emit_le_vsx_store(rtx_def*, rtx_def*, machine_mode)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/config/rs6000/rs6000.c:9938
0x1252e57 gen_movv2di(rtx_def*, rtx_def*)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/config/rs6000/vector.md:155
0x999ce7 rtx_insn* insn_gen_fn::operator()<rtx_def*, rtx_def*>(rtx_def*,
rtx_def*) const
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/recog.h:407
0x999ce7 emit_move_insn_1(rtx_def*, rtx_def*)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/expr.c:3764
0x99a11c emit_move_insn(rtx_def*, rtx_def*)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/expr.c:3934
0xb16086 lra_emit_move(rtx_def*, rtx_def*)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/lra.c:502
0xb29343 curr_insn_transform
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/lra-constraints.c:4547
0xb2a465 lra_constraints(bool)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/lra-constraints.c:5138
0xb18632 lra(_IO_FILE*)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/lra.c:2329
0xad5a89 do_reload
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/ira.c:5802
0xad5a89 execute
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-ppc64le/build/gcc/ira.c:5988
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to