[Bug target/100152] [10.3, 11, 12 Regression] used caller-saved register not preserved across a call.

2021-04-23 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100152

--- Comment #29 from Iain Sandoe  ---
what is also somewhat peculiar is that replacing the first function in the
reduced test case with "extern void ___UTF_8_put(char *a, int b);" changes the
code-gen for the second function.

[Bug target/100152] [10.3, 11, 12 Regression] used caller-saved register not preserved across a call.

2021-04-22 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100152

--- Comment #28 from Iain Sandoe  ---
reduced test case:
___UTF_8_put(char *a, int b) {
  char *c = a;
  int bytes;
  if (b <= 15)
bytes = 2;
  else if (b <= 255)
bytes = 4;
  else if (b <= 4095)
bytes = 5;
  else
bytes = 6;
  c = *a = c;
  switch (bytes) {
  case 6:
*--c = b >>= 6;
  case 5:
*--c = b;
b >>= 6;
  }
  *c = bytes + b;
}

___SCMOBJ_to_NONNULLSTRING(d) {
  {
unsigned long g, h;
char c;
h = ((long *)1)[1];
g = 0;
for (; g < h; g++)
  i();
g = 0;
for (; g < h; g++)
  ___UTF_8_put(c, (long)*((unsigned *)d + (g << 2 >> 2)) << 2 >> 2);
  }
}

[Bug target/100152] [10.3, 11, 12 Regression] used caller-saved register not preserved across a call.

2021-04-22 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100152

Iain Sandoe  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org
Summary|[10.3, 11, 12 Regression]   |[10.3, 11, 12 Regression]
   |[Darwin, X86] used  |used caller-saved register
   |caller-saved register not   |not preserved across a
   |preserved across a call.|call.

--- Comment #27 from Iain Sandoe  ---
this is caused by, or exposed by,
r10-9246-geddcb627ccfbd97e025cf366cc3f3bad76211785

since that's a change in tree optimisation, the problem might not be confined
to Darwin, but I wasn't able to get the preprocessed source attached here to
produce wrong code on Linux.

For x86_64, the Darwin ABI is supposed to be same as Linux - and as noted,
there is not so much Darwin-specific back end code (but, of course, there is
some).