public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aldyh at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/102605] address instruction from -fdump-tree-*-gimple doesn't work with -fgimple
Date: Wed, 06 Oct 2021 07:40:12 +0000	[thread overview]
Message-ID: <bug-102605-4-XwzzI0ppki@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102605-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2021-10-06  7:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05  9:48 [Bug other/102605] New: " aldyh at gcc dot gnu.org
2021-10-05 12:16 ` [Bug other/102605] " rguenth at gcc dot gnu.org
2021-10-05 14:14 ` aldyh at gcc dot gnu.org
2021-10-05 14:37 ` cvs-commit at gcc dot gnu.org
2021-10-06  6:11 ` rguenther at suse dot de
2021-10-06  7:40 ` aldyh at redhat dot com [this message]
2021-10-06  8:13 ` rguenther at suse dot de
2021-10-06  8:28 ` aldyh at redhat dot com
2021-10-06 10:02 ` cvs-commit at gcc dot gnu.org
2021-10-07  6:21 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-102605-4-XwzzI0ppki@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).