https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92606

--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #6)
> or whether the backend "forgets" to set DECL_SECTION_NAME or the like.

That caused problems (don't remember which ones exactly, maybe to make
-fdata-sections work).  The section is set in TARGET_ASM_SELECT_SECTION so the
middle-end knows the section (in principle).  But presumably the middle-end
concept is broken, because telling what section belongs to a decl is not enough
to convince the middle-end that the section belongs to the decl...  It's gcc
after all.

(Very) old versions did set DECL_SECTION_NAME in insert_attributes, but that's
no more the case.  Presumably to fix one of the 100s of FIXMEs in the avr
backend.

> Similarly address-spaces need to be honored (I bet avr would have one -- is
> PROGMEM actually an address-space implementation-wise?)

No, progmem is just an attribute and dates back to the times when there was no
address-spaces in gcc.  It's still supposed to be supported because old code
should still work, and because g++ will never have address-spaces.

> I see there's a 'progmem' target attribute but its effects might be hidden
> completely from the middle-end.

That's why I opened PR92932. As mentioned in comment #3, the bug also appears
for address-space __flash.

Reply via email to