From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17032 invoked by alias); 28 Oct 2013 21:00:36 -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 17012 invoked by uid 89); 28 Oct 2013 21:00:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 28 Oct 2013 21:00:34 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9SL0KvF005700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Oct 2013 17:00:22 -0400 Received: from barimba (ovpn-113-94.phx2.redhat.com [10.3.113.94]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9SL092g014366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 28 Oct 2013 17:00:14 -0400 From: Tom Tromey To: "Agovic\, Sanimir" Cc: "gdb-patches\@sourceware.org" Subject: Re: [PATCH 05/10] vla: allow side effects for sizeof argument 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> Date: Mon, 28 Oct 2013 21:00:00 -0000 In-Reply-To: <0377C58828D86C4588AEEC42FC3B85A71769F292@IRSMSX105.ger.corp.intel.com> (Sanimir Agovic's message of "Fri, 25 Oct 2013 08:13:43 +0000") Message-ID: <87ppqp9kme.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-10/txt/msg00885.txt.bz2 >>>>> "Sanimir" == Agovic, Sanimir writes: 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. I don't see how this version of the patch solves what I thought the problem was. I'm sure it is just my misunderstanding though. Sanimir> Meanwhile you can track our latest development efforts on Sanimir> http://intel-gdb.github.io/ branch vla-c99. Is that all rebased to binutils-gdb.git now? If so I will start fetching from it again. 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 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL); Sanimir> + return value_from_longest (size_type, Sanimir> + (LONGEST) TYPE_LENGTH (value_type (val))); This makes it seem like the problem case is "sizeof (vla[index])". But I would have thought it was "sizeof (vla)". In any case I think this patch still has the issue, just at one remove. Like: (gdb) print sizeof (array[x++]) For an ordinary array this should not modify x. Tom