public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Martin Sebor <msebor@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [committed] fix another ICE in MEM_REF formatting (PR 98578)
Date: Thu, 7 Jan 2021 22:37:02 +0100	[thread overview]
Message-ID: <20210107213702.GQ725145@tucnak> (raw)
In-Reply-To: <12069778-e6af-6fb9-13d4-a3c555c70a29@gmail.com>

On Thu, Jan 07, 2021 at 02:29:50PM -0700, Martin Sebor via Gcc-patches wrote:
> --- a/gcc/c-family/c-pretty-print.c
> +++ b/gcc/c-family/c-pretty-print.c
> @@ -1844,22 +1844,25 @@ print_mem_ref (c_pretty_printer *pp, tree e)
>  	}
>      }
>  
> -  const tree access_type = TREE_TYPE (e);
> +  tree access_type = TREE_TYPE (e);
> +  if (TREE_CODE (access_type) == ARRAY_TYPE)
> +    access_type = TREE_TYPE (access_type);
>    tree arg_type = TREE_TYPE (TREE_TYPE (arg));
>    if (TREE_CODE (arg_type) == ARRAY_TYPE)
>      arg_type = TREE_TYPE (arg_type);

The array types can be multidimensional, are you sure you don't want
to use strip_array_types instead?

	Jakub


  reply	other threads:[~2021-01-07 21:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 21:29 Martin Sebor
2021-01-07 21:37 ` Jakub Jelinek [this message]
2021-01-07 23:24   ` Martin Sebor

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=20210107213702.GQ725145@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.com \
    /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).