bugGNU Development Chain for 68HC11/68HC12 - Bugs: bug #20041, Code generation problem (bset/bclr...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #20041: Code generation problem (bset/bclr -m68hc11 -Os -fomit-frame-ptr indirect addr)

Submitted by:  Bill Dall <bdall>
Submitted on:  Fri 01 Jun 2007 10:31:59 PM UTC  
 
Category: gccSeverity: 3 - Normal
Item Group: sw-bugStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

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

Bill Dall <bdall>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bdall (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 01 Jun 2007 10:32:00 PM UTCbdallCarbon-Copy-=>Added bdall

    Back to the top


    Powered by Savane 3.1-cleanup