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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Or consider
typedef unsigned __INTPTR_TYPE__ uintptr_t;
volatile int v;

int
foo (int x)
{
  static uintptr_t a = ((char *)&&l2 - (char *)&&l1) + ((char *)&&l4 - (char
*)&&l3) + ((char *)&&l6 - (char *)&&l5);
  void *b[] = { &&l1, &&l2, &&l3, &&l4, &&l5, &&l6 };
l1:
  ++v;
l2:
  ++v;
l3:
  ++v;
l4:
  ++v;
l5:
  ++v;
l6:
  ++v;
  if (x >= 0 && x <= 5)
    {
      x += 42;
      goto *b[x - 42];
    }
  return a;
}
That is even older.
r0-79351-g7771bb621aad43c7d0e21ccec4922dd3beac9cb6
still used to reject that:
error: initializer element is not computable at load time
r0-79390-g7ffb5e78794b6d8f8094d7c928e6f0e94b62cad6
already accepts but assembler doesn't handle that:
pr112499-2.s:58: Error: invalid operands (*ABS* and .text sections) for `-'
pr112499-2.s:58: Error: invalid operands (*ABS* and .text sections) for `-'
pr112499-2.s:58: Error: invalid operands (.text and .text sections) for `+'
        .quad   .L3-.L6-.L4-.L2+.L7+.L5
Guess we can only accept a subtraction of 2 labels, not addition of 2 labels or
something more complex.

Reply via email to