Fri 01 Jun 2007 10:31:59 PM UTC, original submission:
Similar to bug #11813, I am seeing this on 68hc11 compiles with version 3.1 of the 68hc11 development chain.
c code with in-line lst file output:
The pointer pos_desc seems to be located at the head of the stack at the time of entry here. The tsx loads x with the stack pointer and ldx 0,x de-references that pointer. Then cmpb 14,x compares g_ack_ref (in b) with recode slice which is offset 14 bytes from what pos_desc is pointing to.
The error is later in the bclr opcode, where the stack pointer had not yet been dereferenced.
if(pos_desc->recode_slice == g_ack_ref)
10430 eaac: f6 b3 7c ldab b37c <g_ack_ref>
10431 eaaf: 30 tsx
10432 eab0: ee 00 ldx 0,x
10433 eab2: e1 0e cmpb 14,x
10434 eab4: 26 08 bne eabe <.LM91>
{
#if 1
// don't use because of compiler error.
//ipcr_print_str("rcv nack on recode: ");
//ipcr_print_uint8(g_ack_ref);
//ipcr_print_flush();
pos_desc->pos_state
&= ~(TERA_FSP_RECODE_SLICE_CREATED | TERA_FSP_RECODE_SLICE_XMITTED);
10438 eab6: 30 tsx
*** we seem to be missing a ldx 0,x here, or we should drop the tsx (above)
10439 eab7: 1d 0d 0c bclr 13,x #$0c
compiler command line:
m6811-elf-gcc -x c -c -I../inc -Os -Wall -Wcast-align -Winline -Wmissing-prototypes -Wpadded -Wshadow -fomit-frame-pointer -g -m68hc11 -mshort -msoft-reg-count=12 -static filename.cpp -o filename.o
|