bugGNU Development Chain for 68HC11/68HC12 - Bugs: bug #10207, invalid shift long computation...

 
 

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

bug #10207: invalid shift long computation with -fomit-frame-pointer

Submitted by:  Stephane Carrez <ciceron>
Submitted on:  Sun 29 Aug 2004 10:17:27 AM UTC  
 
Category: gccSeverity: 3 - Normal
Item Group: sw-bugStatus: Fixed
Privacy: PublicAssigned to: Stephane Carrez <ciceron>
Open/Closed: Closed

Sun 29 Aug 2004 07:55:36 PM UTC, comment #1:

Fixed in r2.92.

Stephane Carrez <ciceron>
Project AdministratorIn charge of this item.
Sun 29 Aug 2004 10:17:27 AM UTC, original submission:

The following example fails when it is compiled with

-m68hc12 -O -fomit-frame-pointer -mshort

The generated code is wrong because the shift count
loaded by 'shl' is loaded at an invalid stack offset.
This example works with gcc 3.0.4 but fails with gcc 3.3.

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;

uint32_t test;

void shl(uint8_t Nr)
{
test |= (1L<<Nr);
}

int main(void)
{
test = 1;
shl(2);
if (test != 5L)
return 1;
shl(17);
if (test != (5L | (1L << 17)))
return 1;
return 0;
}

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 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 29 Aug 2004 07:55:36 PM UTCciceronStatusNone=>Fixed
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup