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 authentication 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:  gcc Severity:  3 - Normal
Item Group:  sw-bug Status:  Fixed
Privacy:  Public Assigned 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;
if (test != 5L)
return 1;
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 add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.




Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-08-29 ciceron StatusNone => Fixed
    Open/ClosedOpen => Closed

Back to the top

Powered by Savane 3.4