public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: Fergus Henderson <fjh@cs.mu.OZ.AU>, Andreas Jaeger <aj@suse.de>
Cc: Andreas Tobler <toa@pop.agri.ch>, gcc@gcc.gnu.org
Subject: Re: Does gcc 3.2 branch bootstrap on RedHat 7.3?
Date: Tue, 08 Oct 2002 03:02:00 -0000	[thread overview]
Message-ID: <820050000.1034064812@localhost> (raw)
In-Reply-To: <20021005140148.GB4994@ceres.cs.mu.oz.au>

[-- Attachment #1: Type: text/plain, Size: 669 bytes --]

Gentlemen --

I am confused as to why I did not see that problem.

I apologize for causing so much chaos.  I appreciate your reverting the
patch.

I am still stuck on the other end of a modem link; my connection
went awry and I am getting to spend the night in Phoenix.

I am virtually positive that the attached will be the fix, relative to
current mainline sources, and am doing the full bootstrap thing as we
speak.  (There was a switch fall-through that I did not see.)

Hopefully I will get this checked in before my morning flight.

Apologetically,

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


[-- Attachment #2: Type: text/plain, Size: 6177 bytes --]

Index: decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.565
diff -c -5 -p -r1.565 decl2.c
*** decl2.c	7 Oct 2002 09:49:18 -0000	1.565
--- decl2.c	8 Oct 2002 08:14:01 -0000
*************** finish_anon_union (anon_union_decl)
*** 1380,1409 ****
      {
        error ("namespace-scope anonymous aggregates must be static");
        return;
      }

!   main_decl = build_anon_union_vars (anon_union_decl,
! 				     &DECL_ANON_UNION_ELEMS (anon_union_decl),
! 				     static_p, external_p);
!
!   if (main_decl == NULL_TREE)
      {
!       warning ("anonymous aggregate with no members");
!       return;
!     }

!   if (static_p)
!     {
!       make_decl_rtl (main_decl, 0);
!       COPY_DECL_RTL (main_decl, anon_union_decl);
!       expand_anon_union_decl (anon_union_decl,
! 			      NULL_TREE,
! 			      DECL_ANON_UNION_ELEMS (anon_union_decl));
      }
!   else
!     add_decl_stmt (anon_union_decl);
  }

  /* Finish processing a builtin type TYPE.  It's name is NAME,
     its fields are in the array FIELDS.  LEN is the number of elements
     in FIELDS minus one, or put another way, it is the maximum subscript
--- 1380,1414 ----
      {
        error ("namespace-scope anonymous aggregates must be static");
        return;
      }

!   if (!processing_template_decl)
      {
!       main_decl
! 	= build_anon_union_vars (anon_union_decl,
! 				 &DECL_ANON_UNION_ELEMS (anon_union_decl),
! 				 static_p, external_p);
!
!       if (main_decl == NULL_TREE)
! 	{
! 	  warning ("anonymous aggregate with no members");
! 	  return;
! 	}

!       if (static_p)
! 	{
! 	  make_decl_rtl (main_decl, 0);
! 	  COPY_DECL_RTL (main_decl, anon_union_decl);
! 	  expand_anon_union_decl (anon_union_decl,
! 				  NULL_TREE,
! 				  DECL_ANON_UNION_ELEMS (anon_union_decl));
! 	  return;
! 	}
      }
!
!   add_decl_stmt (anon_union_decl);
  }

  /* Finish processing a builtin type TYPE.  It's name is NAME,
     its fields are in the array FIELDS.  LEN is the number of elements
     in FIELDS minus one, or put another way, it is the maximum subscript
Index: pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.622
diff -c -5 -p -r1.622 pt.c
*** pt.c	7 Oct 2002 09:49:18 -0000	1.622
--- pt.c	8 Oct 2002 08:14:34 -0000
*************** tsubst_decl (t, args, type, complain)
*** 6132,6141 ****
--- 6132,6143 ----
  	    r = spec;
  	    break;
  	  }

  	r = copy_decl (t);
+ 	if (TREE_CODE (r) == VAR_DECL)
+ 	  type = complete_type (type);
  	TREE_TYPE (r) = type;
  	c_apply_type_quals_to_decl (cp_type_quals (type), r);
  	DECL_CONTEXT (r) = ctx;
  	/* Clear out the mangled name and RTL for the instantiation.  */
  	SET_DECL_ASSEMBLER_NAME (r, NULL_TREE);
*************** tsubst_decl (t, args, type, complain)
*** 6171,6180 ****
--- 6173,6184 ----
  	  register_local_specialization (r, t);

  	TREE_CHAIN (r) = NULL_TREE;
  	if (TREE_CODE (r) == VAR_DECL && VOID_TYPE_P (type))
  	  cp_error_at ("instantiation of `%D' as type `%T'", r, type);
+ 	/* Compute the size, alignment, etc. of R.  */
+ 	layout_decl (r, 0);
        }
        break;

      default:
        abort ();
*************** tsubst_expr (t, args, complain, in_decl)
*** 7422,7456 ****
  	  {
  	    init = DECL_INITIAL (decl);
  	    decl = tsubst (decl, args, complain, in_decl);
  	    if (decl != error_mark_node)
  	      {
-                 if (TREE_CODE (decl) != TYPE_DECL)
-                   /* Make sure the type is instantiated now.  */
-                   complete_type (TREE_TYPE (decl));
  	        if (init)
  	          DECL_INITIAL (decl) = error_mark_node;
  	        /* By marking the declaration as instantiated, we avoid
  	           trying to instantiate it.  Since instantiate_decl can't
  	           handle local variables, and since we've already done
  	           all that needs to be done, that's the right thing to
  	           do.  */
  	        if (TREE_CODE (decl) == VAR_DECL)
  	          DECL_TEMPLATE_INSTANTIATED (decl) = 1;
! 	        maybe_push_decl (decl);
! 		if (DECL_PRETTY_FUNCTION_P (decl))
  		  {
! 		    /* For __PRETTY_FUNCTION__ we have to adjust the
! 		       initializer.  */
! 		    const char *const name
! 		      = cxx_printable_name (current_function_decl, 2);
! 		    init = cp_fname_init (name);
! 		    TREE_TYPE (decl) = TREE_TYPE (init);
  		  }
- 		else
- 		  init = tsubst_expr (init, args, complain, in_decl);
- 	        cp_finish_decl (decl, init, NULL_TREE, 0);
  	      }
  	  }

  	/* A DECL_STMT can also be used as an expression, in the condition
  	   clause of an if/for/while construct.  If we aren't followed by
--- 7426,7464 ----
  	  {
  	    init = DECL_INITIAL (decl);
  	    decl = tsubst (decl, args, complain, in_decl);
  	    if (decl != error_mark_node)
  	      {
  	        if (init)
  	          DECL_INITIAL (decl) = error_mark_node;
  	        /* By marking the declaration as instantiated, we avoid
  	           trying to instantiate it.  Since instantiate_decl can't
  	           handle local variables, and since we've already done
  	           all that needs to be done, that's the right thing to
  	           do.  */
  	        if (TREE_CODE (decl) == VAR_DECL)
  	          DECL_TEMPLATE_INSTANTIATED (decl) = 1;
! 		if (TREE_CODE (decl) == VAR_DECL
! 		    && ANON_AGGR_TYPE_P (TREE_TYPE (decl)))
! 		  /* Anonymous aggregates are a special case.  */
! 		  finish_anon_union (decl);
! 		else
  		  {
! 		    maybe_push_decl (decl);
! 		    if (DECL_PRETTY_FUNCTION_P (decl))
! 		      {
! 			/* For __PRETTY_FUNCTION__ we have to adjust the
! 			   initializer.  */
! 			const char *const name
! 			  = cxx_printable_name (current_function_decl, 2);
! 			init = cp_fname_init (name);
! 			TREE_TYPE (decl) = TREE_TYPE (init);
! 		      }
! 		    else
! 		      init = tsubst_expr (init, args, complain, in_decl);
! 		    cp_finish_decl (decl, init, NULL_TREE, 0);
  		  }
  	      }
  	  }

  	/* A DECL_STMT can also be used as an expression, in the condition
  	   clause of an if/for/while construct.  If we aren't followed by

      parent reply	other threads:[~2002-10-08  8:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-04  1:59 H. J. Lu
2002-10-04  6:03 ` kwall
2002-10-04  9:51 ` Janis Johnson
2002-10-04  9:56   ` H. J. Lu
2002-10-04 10:05     ` H. J. Lu
2002-10-04 11:43       ` PATCH: Revert part of c++ change (Re: Does gcc 3.2 branch bootstrap on RedHat 7.3?) H. J. Lu
2002-10-05  3:33     ` Does gcc 3.2 branch bootstrap on RedHat 7.3? Andreas Tobler
2002-10-05  4:00       ` Andreas Jaeger
2002-10-05 11:21         ` Fergus Henderson
2002-10-05 13:56           ` Andreas Jaeger
2002-10-06  0:12             ` Fergus Henderson
2002-10-08  3:02           ` Mark Mitchell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=820050000.1034064812@localhost \
    --to=mark@codesourcery.com \
    --cc=aj@suse.de \
    --cc=fjh@cs.mu.OZ.AU \
    --cc=gcc@gcc.gnu.org \
    --cc=toa@pop.agri.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).