This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cgen-ibld.in 64-bit extract bug


CGEN_INSN_INT is usually an unsigned int, while valuep is a long.
Under these conditions, the masking and sign-extension done at the
end of the function is incorrect unless sizeof(int)==sizeof(long).

Ok?


r~


	* cgen-ibld.in (extract_normal): Make value and mask a long.

Index: cgen-ibld.in
===================================================================
RCS file: /cvs/cvsfiles/devo/opcodes/cgen-ibld.in,v
retrieving revision 1.15
diff -c -p -d -r1.15 cgen-ibld.in
*** cgen-ibld.in	2001/07/01 02:49:14	1.15
--- cgen-ibld.in	2001/07/17 05:32:18
*************** extract_normal (cd, ex_info, insn_value,
*** 415,421 ****
  #endif
       long *valuep;
  {
!   CGEN_INSN_INT value, mask;
  
    /* If LENGTH is zero, this operand doesn't contribute to the value
       so give it a standard value of zero.  */
--- 415,421 ----
  #endif
       long *valuep;
  {
!   long value, mask;
  
    /* If LENGTH is zero, this operand doesn't contribute to the value
       so give it a standard value of zero.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]