--enable-debug error

Bug #594944 reported by htmldeveloper@gmail.com
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

This bug was already reported in 0.12.3, and in the present 0.12.4 is still present:

  CC sparc-softmmu/disas.o
  CC sparc64-softmmu/ide/qdev.o
/root/download/qemu/qemu-0.12.4/target-sparc/translate.c: In function ‘gen_load_trap_state_at_tl’:
/root/download/qemu/qemu-0.12.4/target-sparc/translate.c:1684: error: incompatible type for argument 3 of ‘tcg_gen_add_i32’
  CC sparc64-softmmu/ide/pci.o
  CC sparc-softmmu/i386-dis.o
make[1]: *** [translate.o] Error 1
make: *** [subdir-sparc64-linux-user] Error 2
make: *** Waiting for unfinished jobs....
  CC sparc64-softmmu/ide/cmd646.o
  CC sparc64-softmmu/vga.o
  CC sparc64-softmmu/vga-pci.o
  CC sparc64-softmmu/fdc.o
  CC sparc64-softmmu/mc146818rtc.o
  CC sparc-softmmu/sparc-dis.o
  CC sparc64-softmmu/serial.o
  CC sparc64-softmmu/cirrus_vga.o
  CC sparc64-softmmu/parallel.o
  CC sparc64-softmmu/exec.o
  CC sparc64-softmmu/translate-all.o
  AR sparc-softmmu/libqemu.a
  LINK sparc-softmmu/qemu-system-sparc
  CC sparc64-softmmu/cpu-exec.o
  CC sparc64-softmmu/translate.o
  CC sparc64-softmmu/tcg/tcg.o
  CC sparc64-softmmu/fpu/softfloat.o
/root/download/qemu/qemu-0.12.4/target-sparc/translate.c: In function ‘gen_load_trap_state_at_tl’:
/root/download/qemu/qemu-0.12.4/target-sparc/translate.c:1684: error: incompatible type for argument 3 of ‘tcg_gen_add_i32’
make[1]: *** [translate.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [subdir-sparc64-softmmu] Error 2

The following patch seemed to work:

diff -Nurp target-sparc/translate.c.orig target-sparc/translate.c
--- target-sparc/translate.c.orig 2010-06-16 13:58:26.395527708 +0800
+++ target-sparc/translate.c 2010-06-16 14:09:18.683573175 +0800
@@ -1663,27 +1663,28 @@ static inline TCGv get_src2(unsigned int
 #ifdef TARGET_SPARC64
 static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_ptr cpu_env)
 {
- TCGv r_tl = tcg_temp_new();
+ TCGv_i32 r_tl = tcg_temp_new_i32();

     /* load env->tl into r_tl */
- {
- TCGv_i32 r_tl_tmp = tcg_temp_new_i32();
- tcg_gen_ld_i32(r_tl_tmp, cpu_env, offsetof(CPUSPARCState, tl));
- tcg_gen_ext_i32_tl(r_tl, r_tl_tmp);
- tcg_temp_free_i32(r_tl_tmp);
- }
+
+ tcg_gen_ld_i32(r_tl, cpu_env, offsetof(CPUSPARCState, tl));

     /* tl = [0 ... MAXTL_MASK] where MAXTL_MASK must be power of 2 */
- tcg_gen_andi_tl(r_tl, r_tl, MAXTL_MASK);
+ tcg_gen_andi_i32(r_tl, r_tl, MAXTL_MASK);

     /* calculate offset to current trap state from env->ts, reuse r_tl */
- tcg_gen_muli_tl(r_tl, r_tl, sizeof (trap_state));
+ tcg_gen_muli_i32(r_tl, r_tl, sizeof (trap_state));
     tcg_gen_addi_ptr(r_tsptr, cpu_env, offsetof(CPUState, ts));

     /* tsptr = env->ts[env->tl & MAXTL_MASK] */
- tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl);
+ {
+ TCGv_ptr r_tl_tmp = tcg_temp_new_ptr();
+ tcg_gen_ext_i32_ptr(r_tl_tmp, r_tl);
+ tcg_gen_add_ptr(r_tsptr, r_tsptr, r_tl_tmp);
+ tcg_temp_free_i32(r_tl_tmp);
+ }

- tcg_temp_free(r_tl);
+ tcg_temp_free_i32(r_tl);
 }
 #endif

It is following the previous bug fixs by Jay Foad:

http://<email address hidden>/msg25585.html

Not sure if it is correct?

Aurelien Jarno (aurel32)
Changed in qemu:
status: New → Fix Committed
Aurelien Jarno (aurel32)
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.