This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
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: http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Debugging-Options.html#index-fdump-tree-673 http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Function-Specific-Option-Pragmas.html Martin
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |