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

Submitter:  Stephane Carrez <ciceron>
Submitted:  Sun 29 Aug 2004 10:17:27 AM UTC
   
 
Category:  gcc Severity:  3 - Normal
Item Group:  sw-bug Status:  Fixed
Privacy:  Public Assigned to:  ciceron
Open/Closed:  Closed

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

Fixed in r2.92.

Stephane Carrez <ciceron>
Group administrator
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>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

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.14-f13d.
Corresponding source code