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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2019-10-08
          Component|testsuite                   |middle-end
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot 
gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The code from the test case on line 159 in Wstringop-overflow-18.c:

char a8[8], b4[4];

void f (void)
{
  __builtin_strcpy (b4, "123");
  char *d = a8 + 5;
  __builtin_memcpy (d, b4, 4);
}

is represented like this on the failing sparc-sun-solaris2.11 (same on
mips64el-linux):

  <bb 2> [local count: 1073741824]:
  MEM <unsigned char[4]> [(char * {ref-all})&b4] = MEM <unsigned char[4]>
[(char * {ref-all})"123"];
  MEM <unsigned char[4]> [(char * {ref-all})&a8 + 5B] = MEM <unsigned char[4]>
[(char * {ref-all})&b4];
  return;

but like this on the passing arm-none-eabi:

  <bb 2> [local count: 1073741824]:
  MEM <unsigned char[4]> [(char * {ref-all})&b4] = "123";
  MEM <unsigned char[4]> [(char * {ref-all})&a8 + 5B] = "123";
  return;

and like this on the passing x86_64:

  <bb 2> [local count: 1073741824]:
  MEM <unsigned char[4]> [(char * {ref-all})&b4] = MEM <unsigned char[4]>
[(char * {ref-all})"123"];
  MEM <unsigned int> [(char * {ref-all})&a8 + 5B] = 3355185;
  return;

The warning knows how to handle all three forms but it doesn't know handle the
first case correctly: it doesn't set the size of the store in the failing case.

Reply via email to