This is the mail archive of the gcc@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: genattrtab.c [Am I on drugs?!?]


Richard Kenner wrote:
>     No.  elem is not an array of rtunions.
> 
>     typedef struct rtvec_def{
>       int num_elem;         /* number of elements */
>       int gc_mark;
>       struct rtx_def *elem[1];
>     } *rtvec;
> 
>     Note carefully the type of elem.  It is a struct rtx_def *.  That is
>     rather different than an rtunion.
> 
> Since this was suspected to be a bug "forever", I was looking at the
> gcc2 sources, where it *is* an rtunion.  I wonder when that
> disparity happened?

Um, I did that about a month ago; it was buried in a tree-checking
update.  This change:

1999-08-19 14:44 -0700  Zack Weinberg  <zack@bitmover.com>

        * rtl.h (rtvec): Make "elem" an array of rtx, not rtunion.
        (RTVEC_ELT): Change to match.
	(XVECEXP): Use XVEC and RTVEC_ELT.
	...

I did it because the pointer slot was the only one ever used, and
HOST_WIDE_INT might be wider than a pointer, so using rtunion would
waste memory.  So this isn't an old bug at all.

Graham's suggestion of changing tests to an array of rtx looks good to
me.

zw


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