From patchwork Mon Nov 10 14:23:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 3636 Received: (qmail 2701 invoked by alias); 10 Nov 2014 14:24:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 2689 invoked by uid 89); 10 Nov 2014 14:24:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: e36.co.us.ibm.com Received: from e36.co.us.ibm.com (HELO e36.co.us.ibm.com) (32.97.110.154) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 10 Nov 2014 14:24:51 +0000 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Nov 2014 07:24:49 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 10 Nov 2014 07:24:48 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 2444A3E40041 for ; Mon, 10 Nov 2014 07:24:05 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sAACKJPL7274762 for ; Mon, 10 Nov 2014 13:20:19 +0100 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sAAENiPo010386 for ; Mon, 10 Nov 2014 07:23:44 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id sAAENgT5010159; Mon, 10 Nov 2014 07:23:42 -0700 Message-Id: <201411101423.sAAENgT5010159@d03av02.boulder.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 10 Nov 2014 15:23:41 +0100 Subject: [push] Work around GCC bug 63748 (Re: [PATCH] PR c++/17494 - Fix evaluation of method calls under EVAL_SKIP) To: amodra@gmail.com (Alan Modra) Date: Mon, 10 Nov 2014 15:23:41 +0100 (CET) From: "Ulrich Weigand" Cc: james.greenhalgh@arm.com (James Greenhalgh), sivachandra@google.com (Siva Chandra), gdb-patches@sourceware.org (gdb-patches) In-Reply-To: <20141105125436.GE30857@bubble.grove.modra.org> from "Alan Modra" at Nov 05, 2014 11:24:36 PM MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14111014-0021-0000-0000-00000607423B Alan Modra wrote: > On Wed, Nov 05, 2014 at 11:00:26AM +0000, James Greenhalgh wrote: > > For what it is worth, I'm seeing the same with my GCC 4.9.1 (x84_64-linux), > > again nothing special in the configure options for GCC: > > Thanks for the confirmation. I've opened a gcc bugzilla. > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63748 While this GCC bug is in the process of being fixed, it would still be good to allow GDB to be built with the affected GCC versions (in particular 4.9.x). I've pushed the following workaround that changes the CFG of the affected GDB routine in an equivalent way so that the GCC bug is no longer triggered. Tested on x86_64-linux, pushed to mainline. Bye, Ulrich gdb/ChangeLog: * eval.c (evaluate_subexp_standard): Work around GCC bug 63748. diff --git a/gdb/eval.c b/gdb/eval.c index c49f7b6..655ea22 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1696,8 +1696,6 @@ evaluate_subexp_standard (struct type *expect_type, do_call_it: - if (noside == EVAL_SKIP) - goto nosideret; if (argvec[0] == NULL) error (_("Cannot evaluate function -- may be inlined")); if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -1804,6 +1802,8 @@ evaluate_subexp_standard (struct type *expect_type, for (; tem <= nargs; tem++) argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside); argvec[tem] = 0; /* signal end of arglist */ + if (noside == EVAL_SKIP) + goto nosideret; goto do_call_it; default: