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 Jan 20 21:03:42 2006  
Category: gccSeverity: 4 - Important
Item Group: sw-bugStatus: Fixed
Privacy: PublicAssigned to: Stephane Carrez <ciceron>
Open/Closed: Closed

Sat Feb 18 21:47:53 2006, comment #1:

Fixed in release 3.1

Stephane Carrez <ciceron>
Project AdministratorIn charge of this item.
Fri Jan 20 21:03:42 2006, 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 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):



Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat Feb 18 21:47:53 2006ciceronStatusConfirmed=>Fixed
Fri Jan 20 21:04:14 2006ciceronStatusNone=>Confirmed
Fri Jan 20 21:03:42 2006ciceronCarbon-Copy-=>Added -unavailable-

Back to the top

Powered by Savane 3.1-cleanup1