This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Spurious .s with -fdump-ada-spec


Hello,

Currently, GCC outputs ".s" assembly files when running on C/C++ header files with -fdump-ada-spec. This is unexpected, since -fdump-ada-spec is used only to output an Ada binding.

This patch fixes the spec-strings for C/C++ header files in order to pass a "-o %g.s" flag to cc1/cc1plus, so that output assembly files are cleaned at exit. It also fixes the processing of the -fsyntax-only flag for C header file so that the "-o ..." argument is passed only once, as the spec-string for C++ header files does.

I could bootstrap the patch and it triggered no regression on x86_64-linux. I've written a simple test that checks that no assembly file/object file is produced when compiling C/C++ header files with -fdump-ada-spec. In order to do this, I had to create a new *.exp file so that the testsuite processes my C header files (the regular dg.exp file skips *.h files).

I also noticed that using -S and -o options at the same time currently doesn't work on header files (even without -fdump-ada-spec): cc1 is spawned with two "-o" arguments. That's why in the dump-ada-spec-2.h file I've specified "dg-do assemble" instead of "dg-do compile".

Many thanks in advance for your comments!


2014-06-02  Eric Botcazou  <botcazou@adacore.com>
            Pierre-Marie de Rodat  <derodat@adacore.com>

gcc/
        * gcc.dg/dump-ada-spec/dump-ada-spec.exp: New.
        * gcc.dg/dump-ada-spec-1.c: Move to dump-ada-spec.
        * gcc.dg/dump-ada-spec/dump-ada-spec-2.h: New.
        * g++.dg/dump-ada-spec: New.

gcc/testsuite/
        * lib/gcc-dg.exp (file-exists, file-exists-not): New.
        * gcc.c (default_compilers): Prevent creation of .s files with
        -fdump-ada-spec and -fdump-xref.
        * cp/lang-specs.h: Likewise.

--
Pierre-Marie de Rodat

Attachment: p.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]