[push] Work around GCC bug 63748 (Re: [PATCH] PR c++/17494 - Fix evaluation of method calls under EVAL_SKIP)

Message ID 201411101423.sAAENgT5010159@d03av02.boulder.ibm.com
State New, archived
Headers

Commit Message

Ulrich Weigand Nov. 10, 2014, 2:23 p.m. UTC
  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.
  

Patch

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: