From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11682 invoked by alias); 19 Oct 2009 14:35:47 -0000 Received: (qmail 11670 invoked by uid 22791); 19 Oct 2009 14:35:46 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-vw0-f178.google.com (HELO mail-vw0-f178.google.com) (209.85.212.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Oct 2009 14:35:41 +0000 Received: by vws8 with SMTP id 8so3025522vws.0 for ; Mon, 19 Oct 2009 07:35:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.88.23 with SMTP id y23mr8181911vcl.94.1255962938684; Mon, 19 Oct 2009 07:35:38 -0700 (PDT) In-Reply-To: <200910191424.n9JEOKrH032607@d12av02.megacenter.de.ibm.com> References: <200910162158.n9GLwKLb000655@greed.delorie.com> <200910191424.n9JEOKrH032607@d12av02.megacenter.de.ibm.com> Date: Mon, 19 Oct 2009 14:36:00 -0000 Message-ID: <84fc9c000910190735k5bda29bav9002e1f011d0cec6@mail.gmail.com> Subject: Re: m32c support for named addr spaces branch From: Richard Guenther To: Ulrich Weigand Cc: DJ Delorie , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg01198.txt.bz2 On Mon, Oct 19, 2009 at 4:24 PM, Ulrich Weigand wrote: > DJ Delorie wrote: > >> Found it, bug in expr.c: >> >> Index: expr.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- expr.c =A0 =A0(revision 152895) >> +++ expr.c =A0 =A0(working copy) >> @@ -4248,13 +4248,13 @@ expand_assignment (tree to, tree from, b >> =A0 =A0 =A0 =A0 =A0 } >> >> =A0 =A0 =A0 =A0 offset_rtx =3D expand_expr (offset, NULL_RTX, VOIDmode, = EXPAND_SUM); >> =A0 =A0 =A0 =A0 address_mode >> =A0 =A0 =A0 =A0 =A0 =3D targetm.addr_space.address_mode (MEM_ADDR_SPACE = (to_rtx)); >> =A0 =A0 =A0 =A0 if (GET_MODE (offset_rtx) !=3D address_mode) >> - =A0 =A0 =A0 =A0 offset_rtx =3D convert_to_mode (address_mode, offset_r= tx, 0); >> + =A0 =A0 =A0 =A0 offset_rtx =3D convert_to_mode (address_mode, offset_r= tx, POINTERS_EXTEND_UNSIGNED); > > I'm not sure POINTERS_EXTEND_UNSIGNED is the correct test here; the offset > is not itself a pointer type. =A0What if the offset actually *is* a negat= ive > value of a smaller, signed type? If the above is expanding a POINTER_PLUS_EXPR then the offset needs to be extended as _signed_ always, independent of the sign of sizetype which is the type of the offset (as sizetypes are always sign-extended). Richard.