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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #25 from Richard Biener <rguenth at gcc dot gnu.org> ---
I see.  The relevant code to patch is still sem_variable::equals_wpa I think,
which doesn't compare any of the decls (or their types) attributes.

Note there is the "no_icf" attribute, maybe defining PROGMEM as also
setting that attribute works?

I wonder if it would be possible to set the appropriate address-space when
parsing the "progmem" attribute in the target?

For ICF (or more generally IPA) there's comp_type_attributes which
we already check and which dispatches to target code.  We're also
rejecting differing DECL_ATTRIBUTES:

  /* Merging two definitions with a reference to equivalent vtables, but
     belonging to a different type may result in ipa-polymorphic-call analysis
     giving a wrong answer about the dynamic type of instance.  */
  if (is_a <varpool_node *> (n1))
    {
...
      /* For functions we compare attributes in equals_wpa, because we do
         not know what attributes may cause codegen differences, but for
         variables just compare attributes for references - the codegen
         for constructors is affected only by those attributes that we lower
         to explicit representation (such as DECL_ALIGN or DECL_SECTION).  */
      if (!attribute_list_equal (DECL_ATTRIBUTES (n1->decl),
                                 DECL_ATTRIBUTES (n2->decl)))
        return return_false_with_msg ("different var decl attributes");
      if (comp_type_attributes (TREE_TYPE (n1->decl),
                                TREE_TYPE (n2->decl)) != 1)
        return return_false_with_msg ("different var type attributes");

so I wonder what happens here?  Does AVR not actually add the progmem
attribute?

Reply via email to