public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] lto/109263 - lto-wrapper and -g0 -ggdb
@ 2023-03-23 16:00 Richard Biener
  2023-04-02 21:16 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2023-03-23 16:00 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek

The following makes lto-wrapper deal with non-combined debug
disabling / enabling option combinations properly.  Interestingly
-gno-dwarf also enables debug.

Bootstrap / regtest running on x86_64-unknown-linux-gnu.

OK?  Or do we want to try harder to zap earlier -g0 when later
-g* appear?

	PR lto/109263
	* lto-wrapper.c (run_gcc): Parse alternate debug options
	as well, they always enable debug.
---
 gcc/lto-wrapper.cc | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc
index fe8c5f6e80d..5186d040ce0 100644
--- a/gcc/lto-wrapper.cc
+++ b/gcc/lto-wrapper.cc
@@ -1564,6 +1564,16 @@ run_gcc (unsigned argc, char *argv[])
 	  skip_debug = option->arg && !strcmp (option->arg, "0");
 	  break;
 
+	case OPT_gbtf:
+	case OPT_gctf:
+	case OPT_gdwarf:
+	case OPT_gdwarf_:
+	case OPT_ggdb:
+	case OPT_gvms:
+	  /* Negative forms, if allowed, enable debug info as well.  */
+	  skip_debug = false;
+	  break;
+
 	case OPT_dumpdir:
 	  incoming_dumppfx = dumppfx = option->arg;
 	  break;
-- 
2.35.3

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

* Re: [PATCH] lto/109263 - lto-wrapper and -g0 -ggdb
  2023-03-23 16:00 [PATCH] lto/109263 - lto-wrapper and -g0 -ggdb Richard Biener
@ 2023-04-02 21:16 ` Jeff Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Law @ 2023-04-02 21:16 UTC (permalink / raw)
  To: Richard Biener, gcc-patches; +Cc: Jakub Jelinek



On 3/23/23 10:00, Richard Biener via Gcc-patches wrote:
> The following makes lto-wrapper deal with non-combined debug
> disabling / enabling option combinations properly.  Interestingly
> -gno-dwarf also enables debug.
> 
> Bootstrap / regtest running on x86_64-unknown-linux-gnu.
> 
> OK?  Or do we want to try harder to zap earlier -g0 when later
> -g* appear?
> 
> 	PR lto/109263
> 	* lto-wrapper.c (run_gcc): Parse alternate debug options
> 	as well, they always enable debug.
So I think the agreement was that later -g options override, but don't 
completely disable.  So OK.

Jeff

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

* Re: [PATCH] lto/109263 - lto-wrapper and -g0 -ggdb
@ 2023-03-27  6:46 Richard Biener
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2023-03-27  6:46 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek

On Thu, 23 Mar 2023, Richard Biener wrote:

> The following makes lto-wrapper deal with non-combined debug
> disabling / enabling option combinations properly.  Interestingly
> -gno-dwarf also enables debug.
> 
> Bootstrap / regtest running on x86_64-unknown-linux-gnu.
> 
> OK?  Or do we want to try harder to zap earlier -g0 when later
> -g* appear?

I pushed this to fix the regression, the patch stays valid even
when the patches rejecting negative variants of -ggdb and friends
is approved.

Richard.

> 	PR lto/109263
> 	* lto-wrapper.c (run_gcc): Parse alternate debug options
> 	as well, they always enable debug.
> ---
>  gcc/lto-wrapper.cc | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc
> index fe8c5f6e80d..5186d040ce0 100644
> --- a/gcc/lto-wrapper.cc
> +++ b/gcc/lto-wrapper.cc
> @@ -1564,6 +1564,16 @@ run_gcc (unsigned argc, char *argv[])
>  	  skip_debug = option->arg && !strcmp (option->arg, "0");
>  	  break;
>  
> +	case OPT_gbtf:
> +	case OPT_gctf:
> +	case OPT_gdwarf:
> +	case OPT_gdwarf_:
> +	case OPT_ggdb:
> +	case OPT_gvms:
> +	  /* Negative forms, if allowed, enable debug info as well.  */
> +	  skip_debug = false;
> +	  break;
> +
>  	case OPT_dumpdir:
>  	  incoming_dumppfx = dumppfx = option->arg;
>  	  break;
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg,
Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman;
HRB 36809 (AG Nuernberg)

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

end of thread, other threads:[~2023-04-02 21:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 16:00 [PATCH] lto/109263 - lto-wrapper and -g0 -ggdb Richard Biener
2023-04-02 21:16 ` Jeff Law
2023-03-27  6:46 Richard Biener

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).