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