re PR c++/72813 (atomic header cannot be compiled into translation unit with -fkeep...
authorJakub Jelinek <jakub@redhat.com>
Wed, 11 Jan 2017 18:08:57 +0000 (19:08 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 11 Jan 2017 18:08:57 +0000 (19:08 +0100)
PR c++/72813
* gcc.c (default_compilers): Don't add -o %g.s for -S -save-temps
of c-header.

* c-decl.c (pop_file_scope): Set flag_syntax_only to 1 after writing
PCH file.

* decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
writing PCH file.

From-SVN: r244328

gcc/ChangeLog
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/gcc.c

index db74169e9df418a102dfc9031fc763495e32a173..e46392c295329f4dede37038be716c065947bd50 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/72813
+       * gcc.c (default_compilers): Don't add -o %g.s for -S -save-temps
+       of c-header.
+
 2017-01-11  David Malcolm  <dmalcolm@redhat.com>
 
        PR driver/78877
index a47e10c06ea690b591b60aad27c0c145317b2f02..341407a21def24b8afddf950d7f1a6e3e5e49061 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/72813
+       * c-decl.c (pop_file_scope): Set flag_syntax_only to 1 after writing
+       PCH file.
+
 2017-01-11  Richard Biener  <rguenther@suse.de>
 
        PR bootstrap/79052
index a15903ac11b4a117e616c6c2e885397e4392aea9..2f91e706b4c54ac48ca7e2585d84b7dfee8a88ae 100644 (file)
@@ -1420,6 +1420,8 @@ pop_file_scope (void)
   if (pch_file)
     {
       c_common_write_pch ();
+      /* Ensure even the callers don't try to finalize the CU.  */
+      flag_syntax_only = 1;
       return;
     }
 
index 892651a7eeb98b9ab56844be6e3e71ccd7e8cecb..2b229f2aae71bd29d7845f4f612dff055038988f 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/72813
+       * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
+       writing PCH file.
+
 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
 
        PR c++/77949
index 435f51fe5644f9360c0123d349fdda9a19ab9aee..0a4c5671df16a09ad6667acecc585a27492dc52f 100644 (file)
@@ -4461,6 +4461,8 @@ c_parse_final_cleanups (void)
          DECL_ASSEMBLER_NAME (node->decl);
       c_common_write_pch ();
       dump_tu ();
+      /* Ensure even the callers don't try to finalize the CU.  */
+      flag_syntax_only = 1;
       return;
     }
 
index 98568bc10792cc9035d9fff5003948ca2afbfbd4..1c5e42802c5ee5cb5701c7a351f4da881538352a 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1328,7 +1328,7 @@ static const struct compiler default_compilers[] =
                %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\
                    cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \
                        %(cc1_options)\
-                       %{!fsyntax-only:-o %g.s \
+                       %{!fsyntax-only:%{!S:-o %g.s} \
                            %{!fdump-ada-spec*:%{!o*:--output-pch=%i.gch}\
                                               %W{o*:--output-pch=%*}}%V}}\
          %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\