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

--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to ak from comment #18)
> Okay I looked into need_assembler_name_p. For __ct function_decl it bails
> out due to

> I assume that means HAS_DECL_ASSEMBLER_NAME_P returns false.

HAS_DECL_ASSEMBLER_NAME_P is:
#define HAS_DECL_ASSEMBLER_NAME_P(NODE) \
  (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WITH_VIS))

FUNCTION_DECL is defined as:
DEFTREECODE (FUNCTION_DECL, "function_decl", tcc_declaration, 0)

#define MARK_TS_DECL_WITH_VIS(C)                        \
  (MARK_TS_DECL_WRTL (C),                               \
   tree_contains_struct[C][TS_DECL_WITH_VIS] = true)

#define MARK_TS_DECL_NON_COMMON(C)                      \
  (MARK_TS_DECL_WITH_VIS (C),                           \
   tree_contains_struct[C][TS_DECL_NON_COMMON] = true)

initialize_tree_contains_struct does:
      code = (enum tree_code) i;
      ts_code = tree_node_structure_for_code (code);

      /* Mark the TS structure itself.  */
      tree_contains_struct[code][ts_code] = 1;

      /* Mark all the structures that TS is derived from.  */
      switch (ts_code)
...
        case TS_TYPE_DECL:
        case TS_FUNCTION_DECL:
          MARK_TS_DECL_NON_COMMON (code);
          break;


tree_node_structure_for_code  is defined by:
static inline enum tree_node_structure_enum
tree_node_structure_for_code (enum tree_code code)
{
  switch (TREE_CODE_CLASS (code))
    {
    case tcc_declaration:
      switch (code)
        {
        case CONST_DECL:        return TS_CONST_DECL;
        case DEBUG_EXPR_DECL:   return TS_DECL_WRTL;
        case FIELD_DECL:        return TS_FIELD_DECL;
        case FUNCTION_DECL:     return TS_FUNCTION_DECL;




So the answer to `HAS_DECL_ASSEMBLER_NAME_P return false` is no it does not.

Are you sure looking at the correct `__ct` function_decl? There are a couple of
clones of the constructor decl due to in-charge ABI reasons.

Reply via email to