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

--- Comment #5 from Aldy Hernandez <aldyh at redhat dot com> ---
> > BTW, the __MEM_REF output from the dumps does not work in -fgimple either.
> > More errors.
>
> Can you share an example?

This is from gcc.c-torture/execute/961125-1.c compiled with -fgimple:

char * begfield (int tab, char * ptr, char * lim, int sword, int schar);

int __GIMPLE (ssa)
main ()
{
  char * lim;
  char * s;
  char * _1;

  __BB(2):
  _1 = begfield (58, ":ab", &__MEM <char[4]> ((void *)":ab" + _Literal
(void *) 3), 1, 1);
  if (_1 != &__MEM <char[4]> ((void *)":ab" + _Literal (void *) 2))
    goto __BB3;
  else
    goto __BB4;

  __BB(3):
  abort ();

  __BB(4):
  exit (0);

}

$ ./cc1 x.c -quiet -fgimple
x.c: In function ‘main’:
x.c:11:55: error: invalid type of ‘__MEM’ operand
   11 |   _1 = begfield (58, ":ab", &__MEM <char[4]> ((void *)":ab" +
_Literal (void *) 3), 1, 1);
      |                                                       ^
x.c:11:60: error: expected ‘)’ before ‘+’ token
   11 |   _1 = begfield (58, ":ab", &__MEM <char[4]> ((void *)":ab" +
_Literal (void *) 3), 1, 1);
      |                                                            ^~
      |                                                            )
x.c:12:13: error: expected expression before ‘&’ token
   12 |   if (_1 != &__MEM <char[4]> ((void *)":ab" + _Literal (void *) 2))
      |             ^
x.c: At top level:
x.c:12:67: error: expected identifier or ‘(’ before ‘)’ token
   12 |   if (_1 != &__MEM <char[4]> ((void *)":ab" + _Literal (void *) 2))
      |                                                                   ^
x.c:14:3: error: expected identifier or ‘(’ before ‘else’
   14 |   else
      |   ^~~~
x.c:17:8: error: expected declaration specifiers or ‘...’ before
numeric constant
   17 |   __BB(3):
      |        ^
x.c:20:8: error: expected declaration specifiers or ‘...’ before
numeric constant
   20 |   __BB(4):
      |        ^
x.c:23:1: error: expected identifier or ‘(’ before ‘}’ token
   23 | }
      | ^

Thanks for improving all this.

Reply via email to