aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2016-07-04 07:41:32 +0000
committerJan Beulich <jbeulich@gcc.gnu.org>2016-07-04 07:41:32 +0000
commit793350758c5c88b29b1c9459f3b3fb1bb00bc0c0 (patch)
treef8b49d82d85f4ae0e59c56067b88910af9eb7702 /gcc
parentb32086d3f0e778eacedca4bdfb2d6a1b8ea20a34 (diff)
downloadgcc-793350758c5c88b29b1c9459f3b3fb1bb00bc0c0.zip
gcc-793350758c5c88b29b1c9459f3b3fb1bb00bc0c0.tar.gz
gcc-793350758c5c88b29b1c9459f3b3fb1bb00bc0c0.tar.bz2
fix interaction of -S and -x {c,c++}-header
Irrespective of the use of -o this so far resulted in "error: output filename specified twice", since cc1_options already produces a -o option when -S was specified. gcc/ 2016-07-04 Jan Beulich <jbeulich@suse.com> * gcc.c (default_compilers["@c-header"]): Conditionalize "-o". gcc/cp/ 2016-07-04 Jan Beulich <jbeulich@suse.com> * lang-specs.h ("@c++-header"): Conditionalize "-o". gcc/testsuite/ 2016-07-04 Jan Beulich <jbeulich@suse.com> * g++.dg/header.c: New. * gcc.dg/header.c: New. From-SVN: r237955
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/lang-specs.h2
-rw-r--r--gcc/gcc.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/header.C9
-rw-r--r--gcc/testsuite/gcc.dg/header.c9
7 files changed, 33 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b8fd1f1..7ad4135 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2016-07-04 Jan Beulich <jbeulich@suse.com>
+
+ * gcc.c (default_compilers["@c-header"]): Conditionalize "-o".
+
2016-07-01 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/71720
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 327391b..7da1c55 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2016-07-04 Jan Beulich <jbeulich@suse.com>
+
+ * lang-specs.h ("@c++-header"): Conditionalize "-o".
+
2016-06-29 Thomas Schwinge <thomas@codesourcery.com>
* parser.c (cp_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
index 9707fac..9217950 100644
--- a/gcc/cp/lang-specs.h
+++ b/gcc/cp/lang-specs.h
@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
%(cc1_options) %2\
- %{!fsyntax-only:-o %g.s \
+ %{!fsyntax-only:%{!S:-o %g.s} \
%{!fdump-ada-spec*:%{!o*:--output-pch=%i.gch}\
%W{o*:--output-pch=%*}}%V}}}}",
CPLUSPLUS_CPP_SPEC, 0, 0},
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 634f8e6..7460f6a 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1330,7 +1330,7 @@ static const struct compiler default_compilers[] =
%W{o*:--output-pch=%*}}%V}}\
%{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\
cc1 %(cpp_unique_options) %(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}}}}}}}", 0, 0, 0},
{".i", "@cpp-output", 0, 0, 0},
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ced6ca7..86c1b5d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-04 Jan Beulich <jbeulich@suse.com>
+
+ * g++.dg/header.c: New.
+ * gcc.dg/header.c: New.
+
2016-07-02 Jakub Jelinek <jakub@redhat.com>
PR c/71719
diff --git a/gcc/testsuite/g++.dg/header.C b/gcc/testsuite/g++.dg/header.C
new file mode 100644
index 0000000..41a6dcb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/header.C
@@ -0,0 +1,9 @@
+/* This really should use "dg-do compile" without the -S in dg-options,
+ but the extra options get put after the input file in that case, and
+ hence the test would fail. */
+/* { dg-do assemble } */
+/* { dg-options "-S -x c++-header" } */
+
+struct s {
+ unsigned field;
+};
diff --git a/gcc/testsuite/gcc.dg/header.c b/gcc/testsuite/gcc.dg/header.c
new file mode 100644
index 0000000..3241a96
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/header.c
@@ -0,0 +1,9 @@
+/* This really should use "dg-do compile" without the -S in dg-options,
+ but the extra options get put after the input file in that case, and
+ hence the test would fail. */
+/* { dg-do assemble } */
+/* { dg-options "-S -x c-header" } */
+
+struct s {
+ unsigned field;
+};