ARM Technical Support Knowledge Articles

PROBLEMS WITH REGISTER OPTIMIZATION IN V6.22

Applies to: C51 C Compiler

Answer


Information in this article applies to:


SYMPTOMS

In my source code, some expressions that use optimized variables in registers don't execute the desired code when using Optimization level 8 and 9. For example:

.
.
.
unsigned char new_string[14];  // new_string was placed in R7
unsigned char count = 0;    // count was placed in R6
.
.
.
new_string[count++] = 'A';
.
.
.

The compiler copies the desired character, but it does not increment the count array index.

CAUSE

This is caused by a problem with register optimization in C51 V6.22.

RESOLUTION

This problem is resolved in C51 V6.23. You may download the latest updates from the Keil Website.

ATTACHED FILES

Request the files attached to this knowledgebase article.

Article last edited on: 2002-05-07 00:00:00

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential