http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51174

--- Comment #10 from David Edelsohn <dje at gcc dot gnu.org> 2011-11-17 
19:23:11 UTC ---
My patch did not fix the testsuite failures in trans-mem.c:tm_mangle() where
ipa_tm_create_version() and ipa_tm_create_version_alias() call tm_mangle() with
DECL_COMDAT_GROUP field NULL.  tm_mangle() tries to reference the field.

As I wrote in comment 6, I suggest that ipa_tm_create_version() and
ipa_tm_create_version_alias() only invoke tm_mangle if the platform defines
HAVE_COMDAT_GROUP, otherwise copy the NULL value like the rest of GCC:

  /* Perform the same remapping to the comdat group.  */
  if (DECL_COMDAT (new_decl) && HAVE_COMDAT_GROUP)
    DECL_COMDAT_GROUP (new_decl) = tm_mangle (DECL_COMDAT_GROUP (old_decl));
  else
    DECL_COMDAT_GROUP (new_decl) = DECL_COMDAT_GROUP (old_decl);

One could have tm_mangle() check for NULL, but I think it is reasonable for it
to expect a non-NULL argument and it is used in other mangling situations.  The
problem, IMHO, is calling tm_mangle() with DECL_COMDAT_GROUP argument assuming
that field of the decl is non-NULL.

Reply via email to