473,405 Members | 2,300 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,405 software developers and data experts.

Effect of optimization on debugging

For a rather obscure reason, I have to compile at least
part of my application with at least some level of
optimization -- a certain behavior I rely on is only
enabled by the optimizer. I'm concerned about the effect
that optimization may have on debuggability.

1) Looking over the options, it appears that the least-
disruptive optimization is probably -Og, global
optimization. According to the documentation, this
option enables common subexpression elimination,
variable and expression enregistering, and
loop-invariant removal. Is this, in fact, the option
that will result in the least degradation of debugging?

2) I'm guessing that the impact of using this option
would primarily be felt in the movement of loop-invariant
code -- for example, in single-stepping into a loop, you
might find the cursor in the middle of the loop, then
back at the top as you step into code that was moved, or
a breakpoint in a loop might be hit once instead of each
time through the loop. Is there anything else I should
watch out for? For example, will I get the wrong answer
displaying the value of a variable that's in a register?
Is there anything I can do to mitigate these effects?

Thanks for any comments or suggestions.

-- William M. Miller
Nov 16 '05 #1
0 859

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: evanescent.lurker | last post by:
Hi there, I was wondering is there a point in optimization in code style... I have used to put parenthesis around some php keywords, but they are not needed. For example, I always use: echo(...
7
by: | last post by:
Hey Does the JIT perform this optimization? old unoptimised even or odd test using modulo if ((someVal % 2) == 0) // even else // odd
3
by: Bryan Parkoff | last post by:
.....I try to reduce un-necessary temporal variables so it can be optimized for best performance. I try to assign only one register storage so two variables can access to only one register storage...
8
by: pertheli | last post by:
I am in a situation where only "goto" seems to be the answer for my program logic where I have to retry calling some repeated functions. Can anybody help in the usage of goto and its effect in...
22
by: NigelW | last post by:
This is really a question for the development team. Are there plans to improve the optimization of C# to MSIL? I ask this, as inspection with ILDASM of the MSIL code shows that, even with the...
1
by: Will Ware | last post by:
I am trying to build a Pyrex module on Mac OS X version 10.3.9 (don't know which big cat that is). It already builds fine on Mandrake Linux and Windows XP. I have one source file where gcc hangs if...
2
by: active | last post by:
During debugging I tried to display the value of a variable and was told it couldn't be displayed because the code had been optimized. Can I turn off optimization? Thanks
6
by: weidongtom | last post by:
Hi, I was submitting a solution of a certain problem to the online judge, but it says my program is exceeding the time limit, I've been doing some tweaks to my codes but still it didn't get me...
20
by: Ravikiran | last post by:
Hi Friends, I wanted know about whatt is ment by zero optimization and sign optimization and its differences.... Thank you...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.