qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] target-tricore: Possible bug in get_mtcr()


From: Markus Armbruster
Subject: [Qemu-devel] target-tricore: Possible bug in get_mtcr()
Date: Tue, 20 Jan 2015 10:23:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Coverity[*] points out:

    *** CID 1264337:  Logically dead code  (DEADCODE)
    /target-tricore/translate.c: 348 in gen_mtcr()
    342     #define E(ADDRESS, REG, FEATURE) A(ADDRESS, REG, FEATURE)
    343 static inline void gen_mtcr(CPUTriCoreState *env, DisasContext
    *ctx, TCGv r1,
    344                                 int32_t offset)
    345     {
    346         if (ctx->hflags & TRICORE_HFLAG_SM) {
    347             /* since we're caching PSW make this a special case */
    >>>     CID 1264337:  Logically dead code  (DEADCODE)
    >>>     Execution cannot reach this statement: "if (offset == 65028) {
      ge...".
    348             if (offset == 0xfe04) {
    349                 gen_helper_psw_write(cpu_env, r1);
    350             } else {
    351                 switch (offset) {
    352     #include "csfr.def"
    353                 }

Correct, because TRICORE_HFLAG_SM is zero:

    #define TRICORE_HFLAG_UM0     0x00002 /* user mode-0 flag          */
    #define TRICORE_HFLAG_UM1     0x00001 /* user mode-1 flag          */
    #define TRICORE_HFLAG_SM      0x00000 /* kernel mode flag          */

Shouls this perhaps be (ctx->hflags & (1 << TRICORE_HFLAG_SM))?

[*] https://scan.coverity.com/projects/378



reply via email to

[Prev in Thread] Current Thread [Next in Thread]