]> Git Repo - binutils.git/commitdiff
Work around GCC bug 63748
authorUlrich Weigand <[email protected]>
Mon, 10 Nov 2014 14:11:44 +0000 (15:11 +0100)
committerUlrich Weigand <[email protected]>
Mon, 10 Nov 2014 14:11:44 +0000 (15:11 +0100)
A recent change to eval.c triggered a GCC bug that causes a false positive
"may be used uninitialized" warning in evaluate_subexp_standard.  This seems
to be triggered by a specific CFG constructed via setjmp and gotos.

While the GCC bug is in the process of being fixed, there are released
compiler versions (in particular GCC 4.9) in the field that show this
problem.  In order to allow compiling GDB with one of those compilers,
this commit slightly reworks the CFG (in an equivalent way) of the
affected function, so that the GCC bug is no longer triggered.

gdb/ChangeLog:

* eval.c (evaluate_subexp_standard): Work around GCC bug 63748.

gdb/ChangeLog
gdb/eval.c

index 0a8bee86c1b1cd1f0d609283c904972f345428ad..ea055da4a508f330bcc25230940111bce9e11ada 100644 (file)
@@ -1,3 +1,7 @@
+2014-11-10  Ulrich Weigand  <[email protected]>
+
+       * eval.c (evaluate_subexp_standard): Work around GCC bug 63748.
+
 2014-11-07  Pedro Alves  <[email protected]>
 
        * infrun.c (process_event_stop_test) <subroutine check>: Don't
index c49f7b63eb696b4d6033cd48fdbedaab015008b4..655ea223b1d65f5bde098ec0e94b277481ce0c0a 100644 (file)
@@ -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:
This page took 0.048336 seconds and 4 git commands to generate.