From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3078 invoked by alias); 20 Nov 2013 12:16:58 -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 3069 invoked by uid 89); 20 Nov 2013 12:16:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mga11.intel.com Received: from Unknown (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Nov 2013 12:16:56 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 20 Nov 2013 04:16:49 -0800 X-ExtLoop1: 1 Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga001.fm.intel.com with ESMTP; 20 Nov 2013 04:16:43 -0800 Received: from irsmsx151.ger.corp.intel.com (163.33.192.59) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 20 Nov 2013 12:16:42 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.215]) by IRSMSX151.ger.corp.intel.com ([169.254.4.126]) with mapi id 14.03.0123.003; Wed, 20 Nov 2013 12:16:42 +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: Wed, 20 Nov 2013 12:18:00 -0000 Message-ID: <0377C58828D86C4588AEEC42FC3B85A7176B8257@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> <0377C58828D86C4588AEEC42FC3B85A7176B5F16@IRSMSX105.ger.corp.intel.com> <87vbzppuz5.fsf@fleche.redhat.com> In-Reply-To: <87vbzppuz5.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/msg00591.txt.bz2 > -----Original Message----- > From: Tom Tromey [mailto:tromey@redhat.com] > Sent: Monday, November 18, 2013 04:53 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> It turns out this patch is not needed anymore as the bounds are > Sanimir> resolved before the sizeof function is called. So in v2 this > Sanimir> patch will be dropped from the series. >=20 > Tom> (gdb) print sizeof (array[x++]) > Tom> For an ordinary array this should not modify x. >=20 > Sanimir> Indeed, that is the behavior we have now in HEAD@vla-c99. >=20 > I thought sizeof with a vla as an argument had to evaluate its argument. > So it seems that the above may yield incorrect semantics in some other > test case. >=20 The patch was needed for a now discontinued vla prototype, meanwhile we moved the logic to the following value constructors=20 value_at/value_at_lazy/value_from_contents_and_address which is easier to maintain and is mostly transparent to existing code. In this particular case we will end up in dispatching 'array' in the switch case 'OP_VAR_VALUE', using value_of_variable which will end up calling a value constructor with an address, therefore we resolved correctly the bounds and the patch is not needed anymore. -Sanimir 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