This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Invalid store_deref with immediate operand on x86_64


As part of bug #3079, I added some more tests to make sure it's all
working.  I ran into a problem on x86_64 with using 64-bit values on
store_deref:

{standard input}: Assembler messages:
{standard input}:5464: Error: suffix or operands invalid for `movq'

The relevant asm line:
  1:  movq $-2401053089480183795,16(%rsp)

And the line from x86_64 store_deref:
  case 8: __put_user_asm(((u64)(value)),addr,_bad,"q","","ir",1); break;

According to the instruction set reference, a MOV to an m64 destination
can only have a source of r64, 16-bit Sreg (zero extended), or imm32
(sign extended).  The "ir" tells gcc that it can use an immediate or
register, but my operand is too large for an imm32.  

AFAIK, there's no way tell gcc that an immediate value is ok only up to
32-bits.  I tried changing "ir" to just "r", and that works fine.  I
just want to run this change by others before I commit, as I'm not too
familiar with assembly in GCC.  Also Roland, I would like to make sure
that this change is ok for loc2c generated code.


Thanks,

Josh


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