From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6992 invoked by alias); 18 Nov 2013 08:39:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 6981 invoked by uid 89); 18 Nov 2013 08:39:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mga01.intel.com Received: from Unknown (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Nov 2013 08:39:24 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 18 Nov 2013 00:39:17 -0800 X-ExtLoop1: 1 Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by fmsmga001.fm.intel.com with ESMTP; 18 Nov 2013 00:39:16 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.215]) by IRSMSX102.ger.corp.intel.com ([169.254.2.114]) with mapi id 14.03.0123.003; Mon, 18 Nov 2013 08:39:01 +0000 From: "Agovic, Sanimir" To: 'Tom Tromey' CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH 05/10] vla: allow side effects for sizeof argument Date: Mon, 18 Nov 2013 09:37:00 -0000 Message-ID: <0377C58828D86C4588AEEC42FC3B85A7176B5F16@IRSMSX105.ger.corp.intel.com> References: <1382366424-21010-1-git-send-email-sanimir.agovic@intel.com> <1382366424-21010-6-git-send-email-sanimir.agovic@intel.com> <87d2mua1gi.fsf@fleche.redhat.com> <0377C58828D86C4588AEEC42FC3B85A71769F292@IRSMSX105.ger.corp.intel.com> <87ppqp9kme.fsf@fleche.redhat.com> In-Reply-To: <87ppqp9kme.fsf@fleche.redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00456.txt.bz2 Thanks for your review. It turns out this patch is not needed anymore as the bounds are resolved=20 before the sizeof function is called. So in v2 this patch will be dropped from the series. > (gdb) print sizeof (array[x++]) >=20 > For an ordinary array this should not modify x. Indeed, that is the behavior we have now in HEAD@vla-c99. > Sanimir> Meanwhile you can track our latest development efforts on > Sanimir> http://intel-gdb.github.io/ branch vla-c99. >=20 > Is that all rebased to binutils-gdb.git now? > If so I will start fetching from it again. Meanwhile the above repository got re-setup to mirror binutils-gdb.git. -Sanimir > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourcewa= re.org] On Behalf > Of Tom Tromey > Sent: Monday, October 28, 2013 10:00 PM > To: Agovic, Sanimir > Cc: gdb-patches@sourceware.org > Subject: Re: [PATCH 05/10] vla: allow side effects for sizeof argument >=20 > >>>>> "Sanimir" =3D=3D Agovic, Sanimir writes: >=20 > Sanimir> I avoid to re-send the complete patch series, thus see my > Sanimir> alternative proposal below. Once I receive more feedback > Sanimir> I will re-publish my patch series including this fix if > Sanimir> applicable. >=20 > I don't see how this version of the patch solves what I thought the > problem was. >=20 > I'm sure it is just my misunderstanding though. >=20 > Sanimir> Meanwhile you can track our latest development efforts on > Sanimir> http://intel-gdb.github.io/ branch vla-c99. >=20 > Is that all rebased to binutils-gdb.git now? > If so I will start fetching from it again. >=20 > Sanimir> + case BINOP_SUBSCRIPT: > Sanimir> + /* In case of a variable length array we need to evaluate= the subscript > Sanimir> + with side effects to correcly infere the size. */ > Sanimir> + val =3D evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL= ); > Sanimir> + return value_from_longest (size_type, > Sanimir> + (LONGEST) TYPE_LENGTH (value_ty= pe (val))); >=20 > This makes it seem like the problem case is "sizeof (vla[index])". > But I would have thought it was "sizeof (vla)". >=20 > In any case I think this patch still has the issue, just at one remove. > Like: >=20 > (gdb) print sizeof (array[x++]) >=20 > For an ordinary array this should not modify x. >=20 > Tom Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052