This is the mail archive of the
mailing list for the GCC project.
Re: optimization question
- From: mark maule <mark dot maule at oracle dot com>
- To: Martin Sebor <msebor at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 19 May 2015 10:14:12 -0500
- Subject: Re: optimization question
- Authentication-results: sourceware.org; auth=none
- References: <555A44FC dot 1020506 at oracle dot com> <555A7E48 dot 9080202 at redhat dot com> <555B5244 dot 8020505 at redhat dot com>
On 5/19/2015 10:09 AM, Martin Sebor wrote:
I'm not very familiar with the optimizations that are done in O2 vs O1,
or even what happens in these optimizations.
So, I'm wondering if this is a bug, or a subtle valid optimization that
I don't understand. Any help would be appreciated.
Another approach to debugging a suspected optimization bug is
to look at the optimization dumps produced in response to one
or more of the -fdump-tree-xxx and -fdump-rtl-xxx options.
There are many of them and they tend to be verbose but not
as much as the raw assembly and are usually easier to follow.
The dumps make it possible to identify the buggy optimization
pass and avoid the bug by disabling just the problematic
optimization while leaving all the others enabled. With
attribute optimize and/or #pragma GCC optimize, you can then
control specify which optimization to disable for subsets of
functions in a file.
See the following sections in the manual for more:
Thanks again Martin. I started going down that road yesterday, and got
lost in the forest of options. What I was looking for was some option
that would tell me what was being done with dgHandle specifically. I
played around with -fopt-info-all but didn't get very far ...