Topic : Raisonance compiler seems to skip case in a switch

Forum : ST7/STM8

Original Post
Post Information Post
June 6, 2012 - 9:13am
Guest

Hi

I have been working with Raisonance STM8 for a while and have found a few times that the compiler just seem to skip a specific case within a switch. That is, the entire case is ignored, or in some cases just a section of the case is ignored.

By ignored I mean that in debug it is not possible to place a breakpoint in this code and by stepping through the

Replies
Post Information Post
+1
0
-1
June 6, 2012 - 1:58pm
Guest

Hi,

We would like to help you as quickly as possible on this issue, but we need to have more informations about the problem before we can help further.

In order to understand the issue you are facing, we need the following information about your configuration:
- Version of Windows: At a command prompt type the following command: "systeminfo.exe", which gives you a system report. We need the full "Operating System" and "Version" from the report.
- Version of Ride7 and RKit that you are using. You can get these from the Ride7 "Help | About" dialog box.
Please check from the Raisonance downloads page at http://support-raisonance.com that you are using the latest version of the tools.

Regards,
The Raisonance support team.

+1
0
-1
June 6, 2012 - 5:11pm
Guest

Hi

Thank you for the reply!
I am currently running RKit-STM8 for Ride7 v2.42.12.0083,
with Ride 7 v7.38.12.0097
which is also the latest I see on the support site.

Operating system: Windows XP
version 5.1.2600 service pack 3 build 2600

Regards
Gerhard

+1
0
-1
June 7, 2012 - 10:13am
Guest

Hi,

Your problem may be an optimization problem. Did you try to shut down code optimization ?

If you need more information about your problem, you can send us your code at

Regards

+1
0
-1
June 7, 2012 - 10:33am
Guest

Hi

Well, I have tried to change optimization settings, but the problem persisted.

The thing that gets to me about this is that I haven't really seen it happening in isolated sections of code. I will take a switch and if I isolate it and compile it will execute without any issues, but when I integrate it in the bigger project then suddenly some of the cases may be skipped (but I haven't been able to pin down really as to what affects it).

What might be of value is that I found this problem while using a global u8 as my switch variable.

I get the feeling the compiler sees the case as irrelevant code and skips it (almost like skipping a if(0) situation)

At the moment I work around the problem by adding a seperate if statement after the switch to handle the skipped case, but I will see if I can put together a smaller code section to send in which can reproduce the problem.

Thanks for the support!

Gerhard

+1
0
-1
June 15, 2012 - 10:15am
Guest

Did you try to declare the 'offending' variable as 'volatile' ?
This is the usual way to keep the compiler from optimizing it out.

By the way, I had some encounters with toolchains that were more descriptive in this case.
One toolchain (ARM Cortex M3) told me "variable optimized out" when trying view the content or stepping on C instructions accessing this variable