public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Qing Zhao <qing.zhao@oracle.com>,
	Jakub Jelinek <jakub@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Nick Clifton <nickc@redhat.com>
Subject: Re: [stage1][PATCH] Change semantics of -frecord-gcc-switches and add -frecord-gcc-switches-format.
Date: Thu, 26 Nov 2020 14:55:10 +0100	[thread overview]
Message-ID: <b0db6f93-d064-acae-71c8-6dcac7fdd70e@suse.cz> (raw)
In-Reply-To: <CAFiYyc2JbGt8nwA2GgSWJWkY_hiwH-9qNw8WBAgb+S_S079bQQ@mail.gmail.com>

On 11/25/20 2:48 PM, Richard Biener wrote:
> On Mon, Nov 23, 2020 at 2:02 PM Martin Liška <mliska@suse.cz> wrote:
>>
>> On 11/23/20 12:00 PM, Richard Biener wrote:
>>> Can you split out the unifying of -[gf]record-gcc-switches processing
>>> and the target hook adjustment from the change introducing
>>> -frecord-gcc-switches-format?
>>
>> Sure.
>>
>>>
>>> dwarf2out.c seems to retain its gen_producer_string () even though
>>> you duplicate it elsewhere and it is now unused?  Please retain
>>> the gen_producer_string name since the function does actual
>>> processing and not just fetch a precomputed string from somewhere.
>>
>> Yep, please take a look at the attached patch.
>>
>>>
>>> I'd like somebody else chime in on the -frecord-gcc-switches-format
>>> driver handling but will happily work with getting the unification part merged.
>>
>> May I apply the patch after it finishes regression tests and bootstrap?
> 
> @@ -1523,8 +1378,9 @@ process_options (void)
>     if (version_flag)
>       {
>         print_version (stderr, "", true);
> -      if (! quiet_flag)
> -       print_switch_values (print_to_stderr);
> +      if (!quiet_flag)
> +       fputs (gen_producer_string (lang_hooks.name, save_decoded_options,
> +                                   save_decoded_options_count), stderr);
>       }
> 
> 
> so I wonder whether this regresses (no newlines anymore, no separate
> printing of options passed/enabled).  Previously with -Q -v you'll get sth
> like
> 
> options passed:  -v
>   -iprefix /home/rguenther/obj-gcc2-g/gcc/../lib64/gcc/x86_64-pc-linux-gnu/11.0.0/
>   -isystem ./include -isystem ./include-fixed t.c -mtune=generic
>   -march=x86-64 -O2
> options enabled:  -faggressive-loop-optimizations -falign-functions
>   -falign-jumps -falign-labels -falign-loops -fallocation-dce
>   -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
>   -fcaller-saves -fcode-hoisting -fcombine-stack-adjustments -fcompare-elim
>   -fcprop-registers -fcrossjumping -fcse-follow-jumps -fdefer-pop
>   -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively
>   -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-symbols
> ...

Oh, you are right that there's a significant change (I fixed the newline):

BEFORE:
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
options passed:  -v a.c -mtune=generic -march=x86-64
options enabled:  -faggressive-loop-optimizations -fallocation-dce
  -fasynchronous-unwind-tables -fauto-inc-dec -fdelete-null-pointer-checks
  -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-symbols
  -feliminate-unused-debug-types -ffp-int-builtin-inexact -ffunction-cse
  -fgcse-lm -fgnu-unique -fident -finline-atomics -fipa-stack-alignment
  -fira-hoist-pressure -fira-share-save-slots -fira-share-spill-slots
  -fivopts -fkeep-static-consts -fleading-underscore -flifetime-dse
  -fmath-errno -fmerge-debug-strings -fpeephole -fplt -fprefetch-loop-arrays
  -freg-struct-return -fsched-critical-path-heuristic
  -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
  -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
  -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-fusion
  -fsemantic-interposition -fshow-column -fshrink-wrap-separate
  -fsigned-zeros -fsplit-ivs-in-unroller -fssa-backprop -fstdarg-opt
  -fstrict-volatile-bitfields -fsync-libcalls -ftrapping-math -ftree-cselim
  -ftree-forwprop -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon
  -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop
  -ftree-reassoc -ftree-scev-cprop -funit-at-a-time -funwind-tables
  -fvar-tracking -fvar-tracking-assignments -fzero-initialized-in-bss
  -m128bit-long-double -m64 -m80387 -malign-stringops
  -mavx256-split-unaligned-load -mavx256-split-unaligned-store
  -mfancy-math-387 -mfp-ret-in-387 -mfxsr -mglibc -mieee-fp -mlong-double-80
  -mmmx -mno-sse4 -mpush-args -mred-zone -msse -msse2 -mstv
  -mtls-direct-seg-refs -mvzeroupper
Compiler executable checksum: 00000000000000000000000000000000

AFTER:
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C17 11.0.0 20201123 (experimental) -dumpbase-ext .c -mtune=generic -march=x86-64
Compiler executable checksum: 36558a9ca3607b6821d78562377c56da

For -fverbose-asm we get something similar:

BEFORE:
# GNU C17 (SUSE Linux) version 10.2.1 20201117 [revision 98ba03ffe0b9f37b4916ce6238fad754e00d720b] (x86_64-suse-linux)
#	compiled by GNU C version 10.2.1 20201117 [revision 98ba03ffe0b9f37b4916ce6238fad754e00d720b], GMP version 6.2.0, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.22.1-GMP

# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  a.c -mtune=generic -march=x86-64 -auxbase-strip before.s
# -fverbose-asm
# options enabled:  -faggressive-loop-optimizations -fallocation-dce
# -fasynchronous-unwind-tables -fauto-inc-dec -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-symbols
# -feliminate-unused-debug-types -ffp-int-builtin-inexact -ffunction-cse

AFTER:
# GNU C17 (GCC) version 11.0.0 20201123 (experimental) (x86_64-pc-linux-gnu)
#	compiled by GNU C version 10.2.1 20201117 [revision 98ba03ffe0b9f37b4916ce6238fad754e00d720b], GMP version 6.2.0, MPFR version 4.1.0, MPC version 1.2.1, isl version none
# GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
# GNU C17 11.0.0 20201123 (experimental) -dumpbase-ext .c -mtune=generic -march=x86-64

> 
> but after the change it will most definitely _not_ include all the -f options
> implied by -O2?  So how does a standard -O2 -fverbose-asm compare?
> How does -Q -v compare?  How does the producer string in dwarf
> compare (I guess that's actually equal since we now use that reporting style).

Yes, dwarf output is the same:

BEFORE:
     <c>   DW_AT_producer    : (indirect string, offset: 0x0): GNU C17 11.0.0 20201123 (experimental) -dumpbase-ext .c -mtune=generic -march=x86-64 -g

AFTER:
     <c>   DW_AT_producer    : (indirect string, offset: 0x0): GNU C17 10.2.1 20201117 [revision 98ba03ffe0b9f37b4916ce6238fad754e00d720b] -mtune=generic -march=x86-64 -g

So the question is: do we really need to preserve the "options enabled" report? It's far from being complete
as it e.g. ignores enum options like:

   -fsched-stalled-insns-dep=<number> 	
   -fsched-stalled-insns=<number> 	
   -fsimd-cost-model=[unlimited|dynamic|cheap|very-cheap] 	unlimited
   -fstack-check=[no|generic|specific] 	
   -fstack-reuse=[all|named_vars|none] 	all
...

Well, gcc -Q -help=optimize <options_used> seems a better hint for me.

Thoughts?
Thanks,
Martin

> 
> Thanks,
> Richard.
> 
>> Thanks,
>> Martin
>>
>>>
>>> Richard.
>>


  reply	other threads:[~2020-11-26 13:55 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 16:41 [PATCH v2 0/3] Introduce a new GCC option, --record-gcc-command-line Egeyar Bagcioglu
2020-03-03 16:41 ` [PATCH v2 2/3] Introduce the gcc option --record-gcc-command-line Egeyar Bagcioglu
2020-03-03 16:41 ` [PATCH v2 1/3] Introduce dg-require-target-object-format Egeyar Bagcioglu
2020-03-03 16:41 ` [PATCH v2 3/3] Keep .GCC.command.line sections of LTO objetcs Egeyar Bagcioglu
2020-03-04  9:01   ` Richard Biener
2020-03-04 15:26     ` Egeyar Bagcioglu
2020-03-04 17:23       ` Martin Liška
2020-03-04 17:33         ` Jakub Jelinek
2020-03-04 17:42           ` Martin Liška
2020-03-04 17:47             ` Jakub Jelinek
2020-03-04 22:43           ` Egeyar Bagcioglu
2020-03-05  8:54             ` Martin Liška
2020-03-05 13:17               ` Egeyar Bagcioglu
2020-03-17 13:53               ` [stage1][PATCH] Change semantics of -frecord-gcc-switches and add -frecord-gcc-switches-format Martin Liška
2020-03-17 18:43                 ` Egeyar Bagcioglu
2020-03-18  9:05                   ` Martin Liška
2020-04-03 18:15                     ` Egeyar Bagcioglu
2020-04-06  7:09                       ` Martin Liška
2020-05-15  9:58                       ` Martin Liška
2020-06-02  9:16                         ` Martin Liška
2020-06-16 12:49                           ` Martin Liška
2020-07-21 16:24                             ` Qing Zhao
2020-07-23 10:07                               ` Martin Liška
2020-07-23 15:01                                 ` Qing Zhao
2020-07-24 13:43                                   ` Martin Liška
2020-09-25 14:55                               ` Martin Liška
2020-09-25 19:36                                 ` Qing Zhao
2020-10-27 10:56                                 ` Martin Liška
2020-11-10 20:53                                   ` Qing Zhao
2020-11-13 16:19                                     ` Jose E. Marchesi
2020-11-16 10:29                                     ` Martin Liška
2020-11-16 17:03                                       ` Qing Zhao
2020-11-20  9:49                       ` Richard Biener
2020-11-23  8:59                         ` Martin Liška
2020-11-23 11:00                           ` Richard Biener
2020-11-23 13:02                             ` Martin Liška
2020-11-23 14:52                               ` Martin Liška
2020-11-25 13:48                               ` Richard Biener
2020-11-26 13:55                                 ` Martin Liška [this message]
2020-12-02 10:46                                   ` Martin Liška
2020-12-03 13:12                                   ` Richard Biener
2020-12-04  8:08                                     ` Martin Liška
2020-12-04  9:03                                       ` Richard Biener
2020-12-04 13:30                                         ` Martin Liška
2020-12-04 13:34                                           ` Jakub Jelinek
2020-12-04 13:50                                             ` Richard Biener
2020-12-15  8:01                                               ` [PATCH 1/2] Remove Report keyword for options Martin Liška
2020-12-15  8:02                                                 ` [PATCH 2/2] opts: Remove all usages of Report keyword Martin Liška
2020-12-15 19:43                                                   ` Jeff Law
2020-12-15 21:21                                                     ` Martin Liška
2020-12-15 19:42                                                 ` [PATCH 1/2] Remove Report keyword for options Jeff Law
2020-12-16 11:46                                                   ` Martin Liška
2021-01-06 14:21                                           ` [stage1][PATCH] Change semantics of -frecord-gcc-switches and add -frecord-gcc-switches-format Martin Liška
2021-01-14  9:03                                             ` Martin Liška
2021-01-22 13:33                                               ` Martin Liška
2021-01-29 13:35                                                 ` Martin Liška
2021-02-05  9:34                                                   ` [PATCH] " Martin Liška
2021-02-16 21:17                                                     ` Qing Zhao
2021-02-18  9:18                                                       ` Martin Liška
2021-03-01 12:07                                                         ` Martin Liška
2021-03-12 12:39                                                           ` Martin Liška
2021-01-15 19:14                                       ` [stage1][PATCH] " Alexandre Oliva
2021-01-18  9:03                                         ` Martin Liška
2020-03-04 19:39         ` [PATCH v2 3/3] Keep .GCC.command.line sections of LTO objetcs Egeyar Bagcioglu
2020-03-05  7:40           ` Richard Biener
2020-03-04 15:34     ` Andreas Schwab
2020-03-04 15:58       ` Egeyar Bagcioglu
2020-03-03 17:43 ` [PATCH v2 0/3] Introduce a new GCC option, --record-gcc-command-line Egeyar Bagcioglu
2020-03-03 22:57 ` Joseph Myers
2020-03-04  0:18   ` Fangrui Song
2020-03-04 16:28     ` Egeyar Bagcioglu
2020-03-04 16:51       ` Egeyar Bagcioglu
2020-03-05  7:36       ` Richard Biener
2020-03-05 13:43         ` Egeyar Bagcioglu
2020-03-04  9:07 ` Martin Liška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0db6f93-d064-acae-71c8-6dcac7fdd70e@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=nickc@redhat.com \
    --cc=qing.zhao@oracle.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).