bugGNU Development Chain for 68HC11/68HC12 - Bugs: bug #15822, Erroneous code generation of...


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

bug #15822: Erroneous code generation of increment.

Submitted by:  Frances Cohen <fcohen>
Submitted on:  Mon 20 Feb 2006 09:28:31 PM UTC  
Category:  gcc Severity:  3 - Normal
Item Group:  sw-bug Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Mon 20 Feb 2006 09:28:31 PM UTC, original submission:  

The following line:
 _io_ports[MC6812_SCIDRL + m_Port]= m_TXBuffer[m_TxHead++];

Is generating a bad increment of m_TxHead.  The increment of the above line is being compiled as:
  LDX  _Frame (1292)
  INC  1A, X

when it should read
  LDX  _Frame (1292)
  LDX  0, X
  LDX  1A, X

In short, it is losing a layer of indirection, and updating offset the stack frame instead of offset my "this" pointer. It worked when my "m_Port" was 8 bit, but failed when I changed it to 16 bit (if that is any help). 
I am using the latest 3.1 compiler (is also on 3.01 compiler). My flags are:
CXXFLAGS +=-g -c -Os -mshort -fno-exceptions -fno-rtti -m68hc12 $(INCLUDEFLAGS)

Frances Cohen <fcohen>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


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

Only logged-in users can vote.




No changes have been made to this item

Back to the top

Powered by Savane 3.5