https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91011

--- Comment #2 from Vladislav Ivanishin <vlad at ispras dot ru> ---
I already did some debugging (Adam asked on Stackoverflow prior to opening this
PR: https://stackoverflow.com/q/56753102/2104472). Re-posting here what I've
found out.

For the trunk, the problem is that in the absence of input files, a dummy file
is always created with C extension

gcc.c:

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

consequently, cc1 is called:

driver::do_spec_on_infiles () const
{
  ...
  for (i = 0; (int) i < n_infiles; i++)
    {
      ...
      /* Figure out which compiler from the file's suffix.  */

      input_file_compiler
        = lookup_compiler (infiles[i].name, input_filename_length,
                           infiles[i].language);

      if (input_file_compiler)
        {
          ...
              value = do_spec (input_file_compiler->spec);

Reply via email to