public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: <SenthilKumar.Selvaraj@microchip.com>
To: <joseph@codesourcery.com>, <richard.guenther@gmail.com>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Update array address space in c_build_qualified_type
Date: Thu, 22 Jun 2023 09:55:17 +0000	[thread overview]
Message-ID: <041c91ef2de23ea35047929d83416f27bdf718fe.camel@microchip.com> (raw)
In-Reply-To: <5ffe3de1-75eb-d397-8255-ce85c155237e@codesourcery.com>

On Wed, 2023-06-21 at 18:37 +0000, Joseph Myers wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Wed, 21 Jun 2023, Richard Biener via Gcc-patches wrote:
> 
> > >   This patch sets the address space of the array type to that of the
> > >   element type.
> > > 
> > >   Regression tests for avr look ok. Ok for trunk?
> > 
> > The patch looks OK to me but please let a C frontend maintainer
> > double-check (I've CCed Joseph for this).
> 
> The question would be whether there are any TYPE_QUALS uses in the C front
> end that behave incorrectly given TYPE_ADDR_SPACE (acting as qualifiers)
> being set on an array type - conceptually, before C2x, array types are
> unqualified, only the element types are qualified.

Hmm, but tree.cc:build_array_type_1 sets the address space of the element
type to the array type, and the relevant commit's ChangeLog entry (from 2009)
says "Inherit array address space from element type."

On the avr target, for an array like

const __flash int arr[] = {1,2,3};

I can see that the array type gets the address space of the element type
already, even before this patch. Surely that must have caused any code that
doesn't expect address space in array type quals to be broken then? 

Regards
Senthil

      reply	other threads:[~2023-06-22  9:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21  5:57 SenthilKumar.Selvaraj
2023-06-21  8:15 ` Richard Biener
2023-06-21 18:37   ` Joseph Myers
2023-06-22  9:55     ` SenthilKumar.Selvaraj [this message]

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=041c91ef2de23ea35047929d83416f27bdf718fe.camel@microchip.com \
    --to=senthilkumar.selvaraj@microchip.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=richard.guenther@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).