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

            Bug ID: 106282
           Summary: m68k: Problem with thread-local storage and -mcpu=5206
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sebastian.hu...@embedded-brains.de
  Target Milestone: ---

The following test code (derived from Newlib l64a.c):

_Thread_local char _tls_l64a_buf[8];

static const char R64_ARRAY[] =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

char *
_l64a_r (long value)
{
  char *ptr;
  char *result;
  int i, index;
  unsigned long tmp = (unsigned long)value & 0xffffffff;

  result = _tls_l64a_buf;
  ptr = result;

  for (i = 0; i < 6; ++i)
    {
      if (tmp == 0)
        {
          *ptr = '\0';
          break;
        }

      index = tmp & (64 - 1);
      *ptr++ = R64_ARRAY[index];
      tmp >>= 6;
    }

  return result;
}

compiled with

m68k-rtems6-gcc -mcpu=5206 -O2 -c test.c

fails with

/tmp/ccO3QdNm.s: Assembler messages:
/tmp/ccO3QdNm.s:24: Error: syntax error -- statement `lea
(_tls_l64a_buf@TLSLE+6,%a0),%a0' ignored

Reply via email to