Skip to content
  • Stefan Weil's avatar
    77182df1
    target/rx: Fix compiler errors for build with sanitizers · 77182df1
    Stefan Weil authored
    
    
    gcc (Debian 10.2.1-6) 10.2.1 20210110 aborts builds with enabled sanitizers:
    
    ../../../target/rx/op_helper.c: In function ‘helper_scmpu’:
    ../../../target/rx/op_helper.c:213:24: error: ‘tmp1’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      213 |     env->psw_c = (tmp0 >= tmp1);
          |                  ~~~~~~^~~~~~~~
    ../../../target/rx/op_helper.c:213:24: error: ‘tmp0’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ../../../target/rx/op_helper.c: In function ‘helper_suntil’:
    ../../../target/rx/op_helper.c:299:23: error: ‘tmp’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      299 |     env->psw_c = (tmp <= env->regs[2]);
          |                  ~~~~~^~~~~~~~~~~~~~~~
    ../../../target/rx/op_helper.c: In function ‘helper_swhile’:
    ../../../target/rx/op_helper.c:318:23: error: ‘tmp’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      318 |     env->psw_c = (tmp <= env->regs[2]);
          |                  ~~~~~^~~~~~~~~~~~~~~~
    
    Rewriting the code fixes those errors.
    
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
    Message-Id: <20210128172127.46041-1-sw@weilnetz.de>
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
    77182df1
    target/rx: Fix compiler errors for build with sanitizers
    Stefan Weil authored
    
    
    gcc (Debian 10.2.1-6) 10.2.1 20210110 aborts builds with enabled sanitizers:
    
    ../../../target/rx/op_helper.c: In function ‘helper_scmpu’:
    ../../../target/rx/op_helper.c:213:24: error: ‘tmp1’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      213 |     env->psw_c = (tmp0 >= tmp1);
          |                  ~~~~~~^~~~~~~~
    ../../../target/rx/op_helper.c:213:24: error: ‘tmp0’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ../../../target/rx/op_helper.c: In function ‘helper_suntil’:
    ../../../target/rx/op_helper.c:299:23: error: ‘tmp’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      299 |     env->psw_c = (tmp <= env->regs[2]);
          |                  ~~~~~^~~~~~~~~~~~~~~~
    ../../../target/rx/op_helper.c: In function ‘helper_swhile’:
    ../../../target/rx/op_helper.c:318:23: error: ‘tmp’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      318 |     env->psw_c = (tmp <= env->regs[2]);
          |                  ~~~~~^~~~~~~~~~~~~~~~
    
    Rewriting the code fixes those errors.
    
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
    Message-Id: <20210128172127.46041-1-sw@weilnetz.de>
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
Loading