From: Hans-Peter Nilsson Date: Wed, 16 Nov 2005 04:50:57 +0000 (+0000) Subject: * cris/cris-tmpl.c (MY (f_model_insn_before)): Make sure only the X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ae81c235497c566a30bfeef3f6b3fc9884becd5a;p=binutils-gdb.git * cris/cris-tmpl.c (MY (f_model_insn_before)): Make sure only the low 32 bits are used after an unsigned long cast. --- diff --git a/sim/ChangeLog b/sim/ChangeLog index e7ef6a5a380..3fa2416c3b8 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,3 +1,8 @@ +2005-11-16 Hans-Peter Nilsson + + * cris/cris-tmpl.c (MY (f_model_insn_before)): Make sure only the + low 32 bits are used after an unsigned long cast. + 2005-05-28 Hans-Peter Nilsson * cris/Makefile.in (stamp-v32fmloop): Depend on stamp-v10fmloop. diff --git a/sim/cris/cris-tmpl.c b/sim/cris/cris-tmpl.c index 3a24cf3333b..678ac01d38c 100644 --- a/sim/cris/cris-tmpl.c +++ b/sim/cris/cris-tmpl.c @@ -121,13 +121,15 @@ MY (f_model_insn_before) (SIM_CPU *current_cpu, int first_p ATTRIBUTE_UNUSED) char flags[7]; SIM_DESC sd = CPU_STATE (current_cpu); - cris_trace_printf (sd, current_cpu, "%lx ", (unsigned long) (CPU (h_pc))); + cris_trace_printf (sd, current_cpu, "%lx ", + 0xffffffffUL & (unsigned long) (CPU (h_pc))); for (i = 0; i < 15; i++) cris_trace_printf (sd, current_cpu, "%lx ", - (unsigned long) (XCONCAT3(crisv,BASENUM, - f_h_gr_get) (current_cpu, - i))); + 0xffffffffUL + & (unsigned long) (XCONCAT3(crisv,BASENUM, + f_h_gr_get) (current_cpu, + i))); flags[0] = GET_H_IBIT () != 0 ? 'I' : 'i'; flags[1] = GET_H_XBIT () != 0 ? 'X' : 'x'; flags[2] = GET_H_NBIT () != 0 ? 'N' : 'n'; @@ -148,9 +150,10 @@ MY (f_model_insn_before) (SIM_CPU *current_cpu, int first_p ATTRIBUTE_UNUSED) ->unaligned_mem_dword_count - CPU_CRIS_PREV_MISC_PROFILE (current_cpu) ->unaligned_mem_dword_count)), - (unsigned long) (XCONCAT3(crisv,BASENUM, - f_h_gr_get) (current_cpu, - 15))); + 0xffffffffUL + & (unsigned long) (XCONCAT3(crisv,BASENUM, + f_h_gr_get) (current_cpu, + 15))); else cris_trace_printf (sd, current_cpu, "%s %d\n", flags, (int)