bugGNU Development Chain for 68HC11/68HC12 - Bugs: bug #11274, IF (...) wrongly translate in...

 
 

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

bug #11274: IF (...) wrongly translate in assembly

Submitted by:  None
Submitted on:  Thu 09 Dec 2004 08:07:58 AM UTC  
 
Category: gccSeverity: 3 - Normal
Item Group: requestStatus: Invalid
Privacy: PublicAssigned to: Stephane Carrez <ciceron>
Open/Closed: Closed

Thu 09 Dec 2004 08:32:14 PM UTC, comment #1:

Hi!

I disagree with your analysis. The flags set by
the ldd are lost by the next ldx. That's true.
But the std sets the flags and they will therefore
correspond to the value loaded initially by ldd.

ldd 0,x ; Value of OSTCBPrioTbl[prio] and flags update
ldx *_.frame ; flags lost thats a bugs
std 4,x ; why
bne .L19 ;

So the flags used by the bne correspond to D which is
OSTCBPrioTbl[prio] (according to you).

Please, send more information than just an extract of
code and extract of generated assembly. The compiler
can perform complex optimization for which a complete
and compilable source file is necessary to debug
and understand the problem.

As far as you describe this, I consider there is no problem.

Stephane

Stephane Carrez <ciceron>
Project AdministratorIn charge of this item.
Thu 09 Dec 2004 08:07:58 AM UTC, original submission:

Hi

During the compilaton of µC/CosII, I found a bug in the compiler or the optimizer.
I put below the 2 lignes C sources and two version of the assembler generate with or without Frame-pointer.

//=========================================================================
C source

if (OSTCBPrioTbl[prio] == (OS_TCB *)0) {
OSTCBPrioTbl[prio] = (OS_TCB *)1;

//=========================================================================

Compile with \usr\bin\m6811-elf-gcc -S -Os -mshort -o tst.s kernel\os_task.c

Assembler generate with a big bug

ldx *_.frame
clra
ldab 15,x
asld
addd #OSTCBPrioTbl
std 2,x
xgdx
ldd 0,x ; Value of OSTCBPrioTbl[prio] and flags update
ldx *_.frame ; flags lost thats a bugs
std 4,x ; why
bne .L19 ;
ldd #1
ldx 2,x
std 0,x

//=========================================================================

Compile with \usr\bin\m6811-elf-gcc -S -Os -mshort -fomit-frame-pointer -o tst.s kernel\os_task.c

Assembler generate without bug

tsx
clra
ldab 12,x
asld
addd #OSTCBPrioTbl
std 1,x
xgdx
ldd 0,x ; Value of OSTCBPrioTbl[prio] and flags update
tsx ; flags not affected
std 3,x
bne .L19
ldd #1
ldx 1,x
std 0,x

Kind regards

Michel Clerbois
-unavailable-

Anonymous

 

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 05 Nov 2005 09:20:38 PM UTCciceronOpen/ClosedOpen=>Closed
Thu 09 Dec 2004 08:32:14 PM UTCciceronStatusNone=>Invalid
  Assigned toNone=>ciceron
  Carbon-Copy-=>Added mclerbois --AT-- isiph --DOT-- be

Back to the top


Powered by Savane 3.1-cleanup1