[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between < 4.9 and 4.9
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #17 from Jakub Jelinek --- As mentioned in PR77454, do we want to treat -gdwarf-N the same as -g (in addition to setting the dwarf version), or should it be treated just like setting of the DWARF version only if some debug info level is already enabled? In particular, the questionable option order is -g1 -gdwarf-4 which is now treated like -g1 -g2 -gdwarf-4 rather than -gdwarf-4 -g1
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 Tom Tromey tromey at gcc dot gnu.org changed: What|Removed |Added CC||tromey at gcc dot gnu.org --- Comment #11 from Tom Tromey tromey at gcc dot gnu.org --- FWIW this regresses a few gdb tests. It's easy to fix the gdb test suite, but if this is going to be fixed before the next gcc release, I'd rather not bother. Any word on that?
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #12 from ccoutant at google dot com --- FWIW this regresses a few gdb tests. It's easy to fix the gdb test suite, but if this is going to be fixed before the next gcc release, I'd rather not bother. Any word on that? I'm planning to fix it as proposed above, and backport to the 4.9 branch -- I was just waiting to hear back from rth. -cary
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #13 from Richard Henderson rth at gcc dot gnu.org --- (In reply to ccoutant from comment #10) Sorry, I'm not sure what both points are. Does that mean that you would support changing -g so that -g1 -g means -g2, but -g3 -g means -g3? (I.e., -g will raise the level to 2 but will not lower it.) Yes, that's what I meant.
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #14 from Cary Coutant ccoutant at gcc dot gnu.org --- Author: ccoutant Date: Wed May 14 21:48:47 2014 New Revision: 210442 URL: http://gcc.gnu.org/viewcvs?rev=210442root=gccview=rev Log: Change -g so that it will override -g1 but not -g3. gcc/ PR debug/61013 * opts.c (common_handle_option): Don't special-case -g. (set_debug_level): Default to at least level 2 with -g. Modified: trunk/gcc/ChangeLog trunk/gcc/opts.c
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #15 from Cary Coutant ccoutant at gcc dot gnu.org --- Author: ccoutant Date: Thu May 15 00:34:20 2014 New Revision: 210456 URL: http://gcc.gnu.org/viewcvs?rev=210456root=gccview=rev Log: Change -g so that it will override -g1 but not -g3. Backported from trunk r210442. gcc/ PR debug/61013 * opts.c (common_handle_option): Don't special-case -g. (set_debug_level): Default to at least level 2 with -g. Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/opts.c
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 Cary Coutant ccoutant at gcc dot gnu.org changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |FIXED Assignee|unassigned at gcc dot gnu.org |ccoutant at gcc dot gnu.org --- Comment #16 from Cary Coutant ccoutant at gcc dot gnu.org --- Fixed on trunk and on 4.9 branch.
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Status|RESOLVED|REOPENED Last reconfirmed||2014-04-30 CC||ccoutant at gcc dot gnu.org, ||jakub at gcc dot gnu.org Resolution|INVALID |--- Summary|Option parsing difference |[4.9/4.10 Regression] |between 4.9 and 4.9 |Option parsing difference ||between 4.9 and 4.9 Ever confirmed|0 |1 --- Comment #3 from Jakub Jelinek jakub at gcc dot gnu.org --- It has changed with r205235, and I think that part of the change is undesirable, -g never stood for -g2 before, it stood for enable debug info, at whatever level is default or has been previously selected.
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #4 from Andrew Pinski pinskia at gcc dot gnu.org --- It was not on accident, see http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00260.html and http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02077.html And even where I said http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02078.html This was all discussed on the list and there was no objections.
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #5 from Andres Freund andres at anarazel dot de --- Hi, On 2014-04-30 15:48:33 +, pinskia at gcc dot gnu.org wrote: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #4 from Andrew Pinski pinskia at gcc dot gnu.org --- It was not on accident, see http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00260.html and http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02077.html And even where I said http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02078.html This was all discussed on the list and there was no objections. Meh. At the very least you should document such changes in the release notes. I'd be surprised if I am the only one that wasted time on debugging this change. Greetings, Andres Freund
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org --- I certainly haven't noticed that discussion, if I did, I would object already by that time.
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #7 from Cary Coutant ccoutant at gcc dot gnu.org --- (In reply to Andres Freund from comment #2) The point is that this has changed between 4.8 and 4.9... And I don't see anything relevant in http://gcc.gnu.org/gcc-4.9/changes.html Yes, you're right. This change should have been documented there. Sorry! I did ask twice for consensus, and got no objections either time. Our build system adds -g1 to the compile options, before user-supplied options, and if a user adds -g, it's surprising to only get -g1. I wonder if it would be reasonable for -g to set the debug level to max(2, previous level)? I still think the simplicity of -g === -g2 is much better, and it's also much better to be consistent with the -O option. What should the following combinations do? -g1 -g -g1 -g0 -g -g3 -g -g3 -g0 -g -cary
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org --- I don't see why there should be any consistency with -O, it is a very different option, with a very different usage and history. The 4.8 behavior was that -g set debug level to 2 if the debug level was 0, so -g1 -g used to be the same as -g1 -g1 -g0 -g used to be the same as -g2 -g3 -g used to be the same as -g3 -g3 -g0 -g used to be the same as -g2 Now, if you want to change a default for your builds, I'd say you'd just tweak specs so that -g1 is provided if no -g appears on the command line; either that can be done by changing the default specs, or you simply add a short specs file which will do that and change say CC to gcc -specs=whatever. E.g. in Fedora we use: -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 and the specs file ensures that -fPIE is supplied by default if no other option is used on the command line: *cc1_options: + %{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE} So, my preference would be to revert to the 4.8 and older behavior, or if there really is consensus that -g1 -g should mean -g2 rather than -g1, at least change it so that -g3 -g means -g3 (so revert your change and for *arg == '\0' instead of the 4.8: if (!opts-x_debug_info_level) opts-x_debug_info_level = DINFO_LEVEL_NORMAL; do: if (opts-x_debug_info_level DINFO_LEVEL_NORMAL) opts-x_debug_info_level = DINFO_LEVEL_NORMAL; What I'd say would be helpful would be add support for inline specs overrides which you could specify on the command line rather than having to resort to loading a file. So -specsinline='*cc1_options:\n+ %{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}' or so.
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 Richard Henderson rth at gcc dot gnu.org changed: What|Removed |Added CC||rth at gcc dot gnu.org --- Comment #9 from Richard Henderson rth at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #8) So, my preference would be to revert to the 4.8 and older behavior, or if there really is consensus that -g1 -g should mean -g2 rather than -g1, at least change it so that -g3 -g means -g3 (so revert your change and for *arg == '\0' instead of the 4.8: if (!opts-x_debug_info_level) opts-x_debug_info_level = DINFO_LEVEL_NORMAL; do: if (opts-x_debug_info_level DINFO_LEVEL_NORMAL) opts-x_debug_info_level = DINFO_LEVEL_NORMAL; I agree on both points.
[Bug debug/61013] [4.9/4.10 Regression] Option parsing difference between 4.9 and 4.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61013 --- Comment #10 from ccoutant at google dot com --- So, my preference would be to revert to the 4.8 and older behavior, or if there really is consensus that -g1 -g should mean -g2 rather than -g1, at least change it so that -g3 -g means -g3 (so revert your change and for *arg == '\0' instead of the 4.8: if (!opts-x_debug_info_level) opts-x_debug_info_level = DINFO_LEVEL_NORMAL; do: if (opts-x_debug_info_level DINFO_LEVEL_NORMAL) opts-x_debug_info_level = DINFO_LEVEL_NORMAL; I agree on both points. Sorry, I'm not sure what both points are. Does that mean that you would support changing -g so that -g1 -g means -g2, but -g3 -g means -g3? (I.e., -g will raise the level to 2 but will not lower it.) That seems reasonable to me, and it would support both build scenarios mentioned above (Andres' and mine). It'll leave the meaning of -g3 -g the same as 4.8, but change the meaning of -g1 -g (which shouldn't be much of a problem since everyone here seemed to think that -g1 usage was rare). -cary