public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: What is -gtoggle useful for?
@ 2009-09-03 16:21 Dominique Dhumieres
  0 siblings, 0 replies; 4+ messages in thread
From: Dominique Dhumieres @ 2009-09-03 16:21 UTC (permalink / raw)
  To: gcc; +Cc: dnovillo

Diego,

> In fact, it'd be nice to hide some other flags, but that's another problem.

Absolutely, I think the user flags should be well separated from the 
developer ones.

Cheers

Dominique

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: What is -gtoggle useful for?
  2009-09-03 19:18 ` Alexandre Oliva
@ 2009-09-06 21:41   ` Diego Novillo
  0 siblings, 0 replies; 4+ messages in thread
From: Diego Novillo @ 2009-09-06 21:41 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc

On Thu, Sep 3, 2009 at 15:17, Alexandre Oliva<aoliva@redhat.com> wrote:

> Would the above serve as motivation for -fcompare-debug (and thus for
> -gtoggle)?

Absolutely.  Thanks for the explanation.

Its usefulness is pretty limited outside of gcc developers.  We should
start hiding these developer flags more.


Diego.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: What is -gtoggle useful for?
  2009-09-03 15:08 Diego Novillo
@ 2009-09-03 19:18 ` Alexandre Oliva
  2009-09-06 21:41   ` Diego Novillo
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Oliva @ 2009-09-03 19:18 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 2767 bytes --]

On Sep  3, 2009, Diego Novillo <dnovillo@google.com> wrote:

> With your VTA merge, you added the -gtoggle switch.

Not really:

gcc/ChangeLog:
2009-06-08  Alexandre Oliva  <aoliva@redhat.com>
^^^^^^^^^^
	* common.opt (fcompare-debug=, fcompare-debug-second): New.
	(fdump-final-insns=, gtoggle): New.
	* doc/invoke.texi: Document them.

While looking into this, I realized I messed up the ChangeLog for the
latest config/bootstrap-debug-*.mk changes (wrong ChangeLog dir), fixed
with the patch below.

> I've read the documentation for it and while I can parse what it says,
> I have no idea what this flag is useful for.

It's mostly useful as one of the options for -fcompare-debug testing.
Say, you can set GCC_COMPARE_DEBUG=-gtoggle in your environment, and
from then on, anything you compile with a -fcompare-debug-capable
compiler will be compiled twice, with and without -g, and compared to
check for codegen differences.  Having -gtoggle means you can set it
once, rather than having to figure out whether a compilation would be
performed with -g, and should thus be recompiled with -g0, or
vice-versa.  In theory, a wrapper could implement this, but it would
have to duplicate all the complex -g* handling that GCC performs,
emulating all the overriding, overlapping and even the extraneous -g*
flags that GNAT uses for purposes unrelated with -g.

Sure enough, this is not the only use for -fcompare-debug, otherwise we
could do away with the -gtoggle option and just use
-fcompare-debug-second for this purpose.  But there is
-fvar-tracking-assignments-toggle, and one could use various other
debug-info-related options (debug info level, kind, etc) or even other
debug info-unrelated options (say warnings), to check for codegen
stability, or even nothing whatsoever (to check for stability against
randomized address spaces).

> I've seen it used during bootstraps and the documentation claims
> something about -fcompare-debug.  But I cannot imagine this being
> useful in general.

Imagine you're trying to debug an optimized program.  You had no debug
info at first, and it failed.  So you recompile, and then you can't
duplicate the problem any more.  This shouldn't happen, because GDB is
supposed to generate the same code with and without -g.  However, we've
neglected this property for too long.  Now, -fcompare-debug=-gtoggle
provides you with a way to pinpoint exactly where the bug in GCC is that
causes codegen differences, that presumably hide the bug you're looking
into.  Once you know that, besides filing a GCC bug report, you might
have better luck tracking your own bug down.

> If it's really useful, could you add a rationale in the documentation?

Would the above serve as motivation for -fcompare-debug (and thus for
-gtoggle)?



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vta-bootstrap-debug-default-test-adjust-changelogs.patch --]
[-- Type: text/x-diff, Size: 1010 bytes --]

Index: config/ChangeLog
===================================================================
--- config/ChangeLog	(revision 151387)
+++ config/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2009-09-03  Alexandre Oliva  <aoliva@redhat.com>
+
+	* bootstrap-debug-big.mk (STAGE2_CFLAGS): Drop -gtoggle.
+	* bootstrap-debug-lean.mk: Update comments.
+	(STAGE2_CFLAGS): Likewise.
+	(do-compare): Don't override.
+
 2009-09-01  Alexandre Oliva  <aoliva@redhat.com>
 
 	* bootstrap-debug.mk: Add comments.
Index: contrib/ChangeLog
===================================================================
--- contrib/ChangeLog	(revision 151387)
+++ contrib/ChangeLog	(working copy)
@@ -1,10 +1,3 @@
-2009-09-03  Alexandre Oliva  <aoliva@redhat.com>
-
-	* bootstrap-debug-big.mk (STAGE2_CFLAGS): Drop -gtoggle.
-	* bootstrap-debug-lean.mk: Update comments.
-	(STAGE2_CFLAGS): Likewise.
-	(do-compare): Don't override.
-
 2009-09-01  Alexandre Oliva  <aoliva@redhat.com>
 
 	* compare-debug: Look for .gkd files and compare them.

[-- Attachment #3: Type: text/plain, Size: 257 bytes --]


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

^ permalink raw reply	[flat|nested] 4+ messages in thread

* What is -gtoggle useful for?
@ 2009-09-03 15:08 Diego Novillo
  2009-09-03 19:18 ` Alexandre Oliva
  0 siblings, 1 reply; 4+ messages in thread
From: Diego Novillo @ 2009-09-03 15:08 UTC (permalink / raw)
  To: lxo, gcc

Alex,

With your VTA merge, you added the -gtoggle switch.  I've read the
documentation for it and while I can parse what it says, I have no
idea what this flag is useful for.  I've seen it used during
bootstraps and the documentation claims something about
-fcompare-debug.  But I cannot imagine this being useful in general.

If it's really useful, could you add a rationale in the documentation?
 If it's only useful for the very limited application of
-fcompare-debug, I'd say we should toss both out and make them
internal and/or --param.  Anything that hides them from users.

In fact, it'd be nice to hide some other flags, but that's another problem.


Diego.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-06 21:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-03 16:21 What is -gtoggle useful for? Dominique Dhumieres
  -- strict thread matches above, loose matches on Subject: below --
2009-09-03 15:08 Diego Novillo
2009-09-03 19:18 ` Alexandre Oliva
2009-09-06 21:41   ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).