Article ID: 942918 - Last Review: December 13, 2007 - Revision: 1.0

FIX: The SH compiler may generate bad code on a Windows CE 5.0-based device if the SH compiler has optimizations enabled

On This Page

Expand all | Collapse all

SYMPTOMS

Consider the following scenario. On a Windows CE 5.0-based device, you use the SH compiler. The SH compiler has optimizations enabled. In this scenario, the SH compiler may generate bad code. Additionally, the bad code may throw an alignment exception at runtime.

For example, the following disassembly is generated by the SH compiler.
; 41   : 		tbl_ptr->data_rec[rec_num - cnt - 1].nd_rec_size= 11;

00001c e10b		 mov     #11,r1
00001e 6013		 mov     r1,r0
000020 4119		 shlr8   r1
000022 8023		 mov.b   r0,@(0x00000003,r2)
000024 6013		 mov     r1,r0
000026 4129		 shlr16  r1
000028 8122		 mov.w   r0,@(0x00000004,r2)   
00002a 6013		 mov     r1,r0
00002c 8026		 mov.b   r0,@(0x00000006,r2)
When the following instruction is run, the alignment exception is thrown.
000028 8122		 mov.w   r0,@(0x00000004,r2)
Note The alignment exception does not occur if the code is compiled without optimizations.

RESOLUTION

Software update information

A supported software update is now available from Microsoft as Windows CE 5.0 Platform Builder Monthly Update (October 2007). You can confirm this by scrolling to the "File information" section of this article. The package file name contains the product version, date, Knowledge Base article number, and processor type. The package file name format is:
Product version-yymmdd-kbnnnnnn-processor type
For example: Wincepb50-060503-kb917590-armv4i.msi is the ARMV4i Windows CE 5.0 Platform Builder fix that is documented in KB article 917590 and that is contained in the May 2006 monthly update. To resolve this problem immediately, click the following article number for information about obtaining Windows CE Platform Builder and core operating system software updates:
837392  (http://support.microsoft.com/kb/837392/ ) How to locate core operating system fixes for Microsoft Windows CE Platform Builder products

Prerequisites

This update is supported only if all previously issued updates for this product have also been installed.

Restart requirement

After you apply this software update, you must perform a clean build of the whole platform. To clean the platform, click Clean on the Build menu. To build the platform, click Build Platform on the Build menu. You do not have to restart the computer after you apply this software update.

Update replacement information

This update does not replace any other updates.

File information

The English version of this software update package has the file attributes or the later file attributes that are listed in the following table.
Collapse this tableExpand this table
File nameFile sizeDateTime
Wincepb50-071024-kb942918-common.msi990,20824-Oct-200720:22
The English version of this software update package has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
Collapse this tableExpand this table
File nameFile sizeDateTimePath
C2.dll1,142,78422-Oct-200723:15sdk\bin\i386\sh

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684  (http://support.microsoft.com/kb/824684/ ) Description of the standard terminology that is used to describe Microsoft software updates

APPLIES TO
  • Microsoft Windows CE 5.0
Keywords: 
kbexpertiseadvanced kbfix kbpubtypekc kbqfe KB942918
 

Article Translations

 

Related Support Centers