bugGNU Development Chain for 68HC11/68HC12 - Bugs: bug #15493, Code generation problem on 68HC12


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

bug #15493: Code generation problem on 68HC12

Submitted by:  Stephane Carrez <ciceron>
Submitted on:  Fri 20 Jan 2006 09:03:42 PM UTC  
Category:  gcc Severity:  4 - Important
Item Group:  sw-bug Status:  Fixed
Privacy:  Public Assigned to:  Stephane Carrez <ciceron>
Open/Closed:  Closed

Sat 18 Feb 2006 09:47:53 PM UTC, comment #1:

Fixed in release 3.1

Stephane Carrez <ciceron>
Project AdministratorIn charge of this item.
Fri 20 Jan 2006 09:03:42 PM UTC, original submission:

If we compile the following code with:

m6811-elf-gcc -m68hc12 -S -Os b-2006-01-20.c -da -mshort

the generate code is wrong. The following insn:

stab 2,x

which corresponds to the RTL:

(insn:HI 19 17 21 0 0xb7fd72ec (set (mem/s/v:QI (plus:HI (reg/v/f:HI 2 y [54])
(const_int 3 [0x3])) [0 <variable>.dirB+0 S1 A8])
(reg:QI 2 y [54])) 30 {*movqi_68hc12} (nil)

is emitted. It is wrong because of the xgdx.
Gcc emits this because reg 54 is 0 and the code wants
to clear the memory at 2,x.

typedef struct
volatile unsigned char portA;
volatile unsigned char portB;
volatile unsigned char dirA;
volatile unsigned char dirB;
} MEBI_Regs;

void ReadExternalBus( unsigned int addr )
MEBI_Regs mebi = (MEBI_Regs)0;

// Write the address to the port A and B registers
mebi->portB = addr;
mebi->portA = addr>>8;

// Change ports A and B to inputs
mebi->dirA = 0;
mebi->dirB = 0;

int main( void )
ReadExternalBus( 0x1000 );

Stephane Carrez <ciceron>
Project AdministratorIn charge of this item.


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.




Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-02-18 ciceron StatusConfirmed => Fixed
    Open/ClosedOpen => Closed
2006-01-20 ciceron StatusNone => Confirmed
2006-01-20 ciceron Carbon-Copy- => Added -email is unavailable-

Back to the top

Powered by Savane 3.4