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]

Re: Fix to EH bug caused by packed union issue




--On Monday, July 02, 2001 06:25:00 AM +0000 Richard Kenner 
<kenner@vlsi1.ultra.nyu.edu> wrote:

>     Since `layout_decl' aborts for most kinds of decls -- but specifically
>     does not abort for FIELD_DECL, one must assume it accepts FIELD_DECLs.
>     So, if you're now asserting that it should not be called for *any*
>     FIELD_DECLs, you need to change it to abort in that case too.  If for
>     *these* FIELD_DECLs you need an explanatory comment about why for
>     other DECLs, but not FIELD_DECLs.
>
> The issue is simply that layout_decl is called for FIELD_DECLs only as
> part of laying out the type they are in, not before.  So I don't
> understand your comment.

Ah, but you so nicely proved my point! :-)

Look at the comment for layout_decl -- it doesn't say what you said.  So,
you know more thna me, and it would be nice if you would update the 
layout_decl comment, and then also the change that you made to say "We 
don't call layout_decl for a FIELD_DECL here because the containing type is 
not yet complete."

And, it sounds like you should probably add an:

  if (!TYPE_SIZE (DECL_CONTEXT (field))
    abort ();

in layout_decl.

> I'll remove the one hunk in question.

Great.  Thanks.

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


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