473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Porting embedded code in c/c++ from GHS v1.8.8 to GHS v4.2.4

Hi All,

We are trying to port the embedded code in C/C++. It is currently compiled and linked using GHS compiler v1.8.8. Now we want to move to GHS compiler v4.2.4. There is huge gap between the compilers here. When we are trying to use the new compiler it is doing lot of optimizations, and changing the way the memory map is getting generated w.r.to old compiler. I want to know if someone has worked on such an activity and it would be great if they could share their thoughts. Any suggestions are welcome to resolve the same?

Thanks and Regards,
Rahul
Sep 1 '10 #1
2 1556
Oralloy
988 Expert 512MB
Rahul,

First off, I'm not familiar with GHS - Greenhills, perhaps?

Do you have a test suite? That's the best way to determine if your port worked reasonably well.

If need be, you can start off by writing a series of unit tests. Unit testing is perhaps the best way to determine if a port worked reasonably well. In general they won't find subtle behavioral issues, but they will at least cover most of the bases.

As you know, optimizers can be the death of embedded code. If there are new optimizations in the newer version, make sure you understand them before using them. Or, if you want them, make sure you understand them well enough to know how they will affect your code.

As for race conditions and similar problems that can occur in multi-threaded or other shared-memory code, all you can really do is test or try to prove analytically that they are robust.

Good luck!
Sep 1 '10 #2
donbock
2,426 Expert 2GB
There are typically ways to control how much optimization takes place (such as command line switches). It might be useful to compare the output of the two compilers when both are instructed to suppress all optimizations. If this comparison is promising then you could repeat the exercise with more and more optimizations enabled.

You might want to invest in a good static analyzer (lint) to see how portable your original source code is.
Sep 2 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Lucas Raab | last post by:
I am currently in the process of porting some C code into Python and am stuck. I don't claim to be the greatest C/C++ programmer; in fact, my skills at C are rudimentary at best. My question is I...
1
by: Anupam | last post by:
Hi, I have some existing code in VB.NET and have to port it to Managed C++. Is there any existing tool which lets me do this job? If not, hwat would be a better approach to doing this, line by...
2
by: Fergal | last post by:
Hi, im recently new to embedded development. Im using an embedded system with Windows CE5 installed and trying to communicate with some hardware with a PC104 interface. The processor is an ARMV...
2
by: malicula | last post by:
I copy and pasted the YouTube embedded code to my web page and I can't view the video in Internet Explorer. I can view it with FireFox and Safari but not with IE (I tested it on several PCs and it's...
1
by: ichiban | last post by:
Hi, I'm new to this forum and to the python language, but I do have previous experience programming in java and in C+. My aim is to port a GPS navigation program called "Map This!"...
7
by: zman77 | last post by:
Hi. I have a project (multiple header and source files) that was written in C, in unix. I made a new C++ project in MSVS 2005 (blank project), and am trying to simply copy the C code to my new C++...
11
by: Jordan | last post by:
I am trying to rewrite some C source code for a poker hand evaluator in Python. Putting aside all of the comments such as just using the C code, or using SWIG, etc. I have been having problems...
1
NeoPa
by: NeoPa | last post by:
Actually, the question's a little more involved than that. Let me try to explain as succinctly as I can. I want to know how to execute code that is held within the project I'm trying to open...
2
by: tvnaidu | last post by:
Lot of Windows code (dll) need to port to Linux, can somebody gives some clues, what to takecare mainly. not sure whether similar cals available in Linux: 1) LoadLibrary.
0
by: vmunjal | last post by:
Hi, I have an application in which a small part is written in C++. The C++ dll is referred in C# (2.0) projects. I want to port this application to 64 bit environment. After moving to 64 bit...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.