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 authentification 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: gccSeverity: 4 - Important
Item Group: sw-bugStatus: Fixed
Privacy: PublicAssigned 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:

xgdx
stab 2,x
xgdx

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)
(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 18 Feb 2006 09:47:53 PM UTCciceronStatusConfirmed=>Fixed
  Open/ClosedOpen=>Closed
Fri 20 Jan 2006 09:04:14 PM UTCciceronStatusNone=>Confirmed
Fri 20 Jan 2006 09:03:42 PM UTCciceronCarbon-Copy-=>Added -unavailable-

Back to the top


Powered by Savane 3.1-cleanup