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 authentication level.

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

Submitter:  Bill Dall <bdall>
Submitted:  Fri 01 Jun 2007 10:31:59 PM UTC
Category:  gcc Severity:  3 - Normal
Item Group:  sw-bug Status:  None
Privacy:  Public Assigned 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: ");

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>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-06-01 bdall Carbon-Copy- Added bdall

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code