Am 21.06.26 um 11:27 schrieb Georg-Johann Lay:

Here is a related one:

#define AS1 const __flash
extern AS1 int array[] = { 1 };

The object is located in AS0 (.rodata) but should be in the section
for AS1 (.progmem.data).  In avr_insert_attributes the node looks fine:

     <var_decl 0x7fc286cb8c78 array>
        <array_type 0x7fc286caebd0>
           <integer_type 0x7fc286cae0a8 int address-space-1> read-only

Simple values like

extern AS1 int value = 1;

are located correctly.

Johann

Strange things are happening.  With the correct

extern AS1 int value = 1;

the TARGET_ASM_NAMED_SECTION hook is called with
flags = 0x8100000 which is 1<<20 for SECTION_NAMED and
0x8000000 for SECTION_MACH_DEP which encodes the AS.

In

extern AS1 int array[] = { 1 };

however, the section flags are 0x140000 which is
SECTION_NAMED plus SECTION_NOTYPE where they should
be SECTION NAMED | SECTION_MACH_DEP, too.

Johann

Reply via email to