gcc: fix gcc --help -v opertion with linker flags and input files [PR108328]

Message ID CAGA7tdvVLbySE0i=YjV7GT-ArgFyaJAb0-k8XzwNqhowDDZrvw@mail.gmail.com
State Not Applicable
Headers
Series gcc: fix gcc --help -v opertion with linker flags and input files [PR108328] |

Checks

Context Check Description
snail/gcc-patch-check fail Git am fail log

Commit Message

Sagi Mor Jan. 7, 2023, 12:01 p.m. UTC
  PR gcc/108328

gcc/ChangeLog:

* gcc/gcc.cc: print help once and only once
---
 gcc/gcc.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index d629ca5e424..bd468a6a254 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -5414,9 +5414,9 @@  process_command (unsigned int decoded_options_count,
     }

   /* Ensure we only invoke each subprocess once.  */
-  if (n_infiles == 0
-      && (print_subprocess_help || print_help_list || print_version))
+  if (print_subprocess_help || print_help_list || print_version)
     {
+      n_infiles = 0;
       /* Create a dummy input file, so that we can pass
  the help option on to the various sub-processes.  */
       add_infile ("help-dummy", "c");