This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 252.eon
- From: Michael Matz <matz at kde dot org>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Paolo Carlini <pcarlini at unitus dot it>, <matz at suse dot de>, <gcc-patches at gcc dot gnu dot org>, <mark at codesourcery dot com>
- Date: Fri, 1 Mar 2002 13:15:42 +0100 (MET)
- Subject: Re: 252.eon
Hi,
On Thu, 28 Feb 2002, Jason Merrill wrote:
> > Jason Merrill <jason@redhat.com> writes:
> >>
> >> It looks to me like the existing call to complete_type_or_else is useless;
> >> a pointer type is always complete. I'd suggest just removing that in favor
> >> of the call to complete_type added by the patch. Also, don't cast the
> >> result to void.
> >>
> >> With those changes, the patch is OK.
>
> > Also for the branch?
>
> Yes.
Just to make this crystal clear for myself: You mean something like the
patch below? I've regtested it on x86 (3.1 branch and head), and
bootstrap is just running on both. If there are no problems with that
I'll commit the below diff to both branches.
Ciao,
Michael.
--
Index: typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.388
diff -u -p -c -p -r1.388 typeck.c
*** typeck.c 2002/02/20 23:05:42 1.388
--- typeck.c 2002/03/01 11:56:34
*************** cp_pointer_int_sum (resultcode, ptrop, i
*** 4076,4083 ****
enum tree_code resultcode;
register tree ptrop, intop;
{
! if (!complete_type_or_else (TREE_TYPE (ptrop), ptrop))
! return error_mark_node;
return pointer_int_sum (resultcode, ptrop, fold (intop));
}
--- 4076,4089 ----
enum tree_code resultcode;
register tree ptrop, intop;
{
! tree res_type = TREE_TYPE (ptrop);
!
! /* pointer_int_sum() uses size_in_bytes() on the TREE_TYPE(res_type)
! in certain circumstance (when it's valid to do so). So we need
! to make sure it's complete. We don't need to check here, if we
! can actually complete it at all, as those checks will be done in
! pointer_int_sum() anyway. */
! complete_type (TREE_TYPE (res_type));
return pointer_int_sum (resultcode, ptrop, fold (intop));
}