This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3.3] C++ PATCH: Improving compile-time performance 2/n


Gabriel Dos Reis wrote:

>        Compile-time improvement: 2/n.
>        * cp-tree.h (struct cxx_binding): New datatype;

This breaks bootstrap on s390 and s390x, the reason being a crash
in garbage collection.  This is because an element of type struct
cxx_binding has its union discriminator is_local incorrectly set.

This in turn is apparently due to the fact that

cxx_binding *
binding_for_name (tree name, tree scope)
{
  cxx_binding *result;

  scope = ORIGINAL_NAMESPACE (scope);
  result = cxx_scope_find_binding_for_name (scope, name);
  if (result)
    return result;
  /* Not found, make a new one.  */
  result = cxx_binding_make ();
  result->previous = IDENTIFIER_NAMESPACE_BINDINGS (name);
  BINDING_TYPE (result) = NULL_TREE;
  BINDING_VALUE (result) = NULL_TREE;
  BINDING_SCOPE (result) = scope;
  IDENTIFIER_NAMESPACE_BINDINGS (name) = result;
  return result;
}

leaves is_local uninitialized.

Strangely enough, the patch from your mail has this hunk:

! cxx_binding *
! binding_for_name (tree name, tree scope)
  {
!   cxx_binding *result;
  
    scope = ORIGINAL_NAMESPACE (scope);
!   result = cxx_scope_find_binding_for_name (scope, name);
!   if (result)
      return result;
    /* Not found, make a new one.  */
!   result = cxx_binding_make ();
!   result->previous = IDENTIFIER_NAMESPACE_BINDINGS (name);
    BINDING_TYPE (result) = NULL_TREE;
    BINDING_VALUE (result) = NULL_TREE;
+   BINDING_SCOPE (result) = scope;
+   result->is_local = false;
+   result->value_is_inherited = false;
+   result->has_level = false;
+   IDENTIFIER_NAMESPACE_BINDINGS (name) = result;
    return result;
  }

Bad check-in?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand at informatik dot uni-erlangen dot de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]