Patchwork tcg: Update --enable-debug for TCG_OPF_NOT_PRESENT.

login
register
mail settings
Submitter Richard Henderson
Date Aug. 23, 2011, 5:43 p.m.
Message ID <1314121412-7102-1-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/111151/
State New
Headers show

Comments

Richard Henderson - Aug. 23, 2011, 5:43 p.m.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
Peter Maydell - Aug. 23, 2011, 6:41 p.m.
On 23 August 2011 18:43, Richard Henderson <rth@twiddle.net> wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Confirmed that this fixes the assertion on x86-64 host.

-- PMM
Edgar Iglesias - Aug. 23, 2011, 7:31 p.m.
On Tue, Aug 23, 2011 at 07:41:35PM +0100, Peter Maydell wrote:
> On 23 August 2011 18:43, Richard Henderson <rth@twiddle.net> wrote:
> > Signed-off-by: Richard Henderson <rth@twiddle.net>
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> Confirmed that this fixes the assertion on x86-64 host.

I've applied this. Thanks both of you for the quick response.

Cheers

Patch

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 06ce214..411f971 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1128,18 +1128,19 @@  void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs)
 #if defined(CONFIG_DEBUG_TCG)
     i = 0;
     for (op = 0; op < ARRAY_SIZE(tcg_op_defs); op++) {
-        if (op < INDEX_op_call || op == INDEX_op_debug_insn_start) {
+        const TCGOpDef *def = &tcg_op_defs[op];
+        if (op < INDEX_op_call
+            || op == INDEX_op_debug_insn_start
+            || (def->flags & TCG_OPF_NOT_PRESENT)) {
             /* Wrong entry in op definitions? */
-            if (tcg_op_defs[op].used) {
-                fprintf(stderr, "Invalid op definition for %s\n",
-                        tcg_op_defs[op].name);
+            if (def->used) {
+                fprintf(stderr, "Invalid op definition for %s\n", def->name);
                 i = 1;
             }
         } else {
             /* Missing entry in op definitions? */
-            if (!tcg_op_defs[op].used) {
-                fprintf(stderr, "Missing op definition for %s\n",
-                        tcg_op_defs[op].name);
+            if (!def->used) {
+                fprintf(stderr, "Missing op definition for %s\n", def->name);
                 i = 1;
             }
         }