From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16655 invoked by alias); 19 Jul 2010 15:28:08 -0000 Received: (qmail 16642 invoked by uid 22791); 19 Jul 2010 15:28:07 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Jul 2010 15:28:02 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6JFS080004446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Jul 2010 11:28:01 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6JFS0YT008270 for ; Mon, 19 Jul 2010 11:28:00 -0400 Received: from [10.15.16.129] (dhcp-10-15-16-129.yyz.redhat.com [10.15.16.129]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o6JFS0hg019754 for ; Mon, 19 Jul 2010 11:28:00 -0400 Message-ID: <4C446F00.5060709@redhat.com> Date: Mon, 19 Jul 2010 15:28:00 -0000 From: sami wagiaalla User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Thunderbird/3.0.5 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [patch] function eval cleanup References: <4C3B6428.8090906@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2010-07/txt/msg00282.txt.bz2 > You didn't mention how you tested this... > This was tested by running the test suit on Fedora 13 with gcc 4.4.4 on x8664. > Sami> + /* If this is a C++ function wait until overload resolution. */ > Sami> + if (overload_resolution > Sami> + && (exp->language_defn->la_language == language_cplus)) > Sami> { > Sami> - for (; tem<= nargs&& tem<= TYPE_NFIELDS (type); tem++) > Sami> + (*pos) += 4; /* Skip the evaluation of the symbol. */ > > Why is it ok to add 4 here? > I think this assumes that the function in question is a symbol. > But is that always the case? What about something like calling via a > function pointer? Or some other more complicated subexpression? > In this particular location and if the language is C++ we are dealing with an OP_VAR_VALUE since all the other constructs were eliminated by the if else chain. So it is always a symbol, but I could add a check for OP_VAR_VALUE before skipping evaluation. > If there is a failing case here, and it was not caught by the test > suite, please also add a regression test. > No, no failing case. Just the FIXME by pai. It is kind of tricky to test because whatever symbol is evaluated here is replace by overload reslution and quietly re-evaluated. It only causes problems when meta-symbol for templates is introduced as it is not meant to be evaluated see patch 2 of Template Lookup.