summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-26 00:59:45 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-26 00:59:45 +0000
commit4cf22dc69cc5cad4300cb5a39f7e74c76a16919d (patch)
treeb1a7af4f1a0dff04534881700349a413cb512496
parent4f2a52ba5a7f9dfec7b51747f948349fc565fe62 (diff)
downloadppe42-gcc-4cf22dc69cc5cad4300cb5a39f7e74c76a16919d.tar.gz
ppe42-gcc-4cf22dc69cc5cad4300cb5a39f7e74c76a16919d.zip
PR c/11459
* gcc.c (cpp_options, cc1_options): Preserve relative order of -std and -ansi options. testsuite: * gcc.dg/pr11459-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88121 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gcc.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr11459-1.c6
4 files changed, 19 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7db9dc66d8d..31f059cdd7f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-26 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c/11459
+ * gcc.c (cpp_options, cc1_options): Preserve relative order of
+ -std and -ansi options.
+
2004-09-26 Jan Hubicka <jh@suse.cz>
* dwarf2out.c (dwarf2out_finish): Set parent to comp_unit_die
diff --git a/gcc/gcc.c b/gcc/gcc.c
index e6f72bf3cdf..ca510f99f3b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -783,7 +783,7 @@ static const char *cpp_unique_options =
options used to set target flags. Those special target flags settings may
in turn cause preprocessor symbols to be defined specially. */
static const char *cpp_options =
-"%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*}\
+"%(cpp_unique_options) %1 %{m*} %{std*&ansi} %{W*&pedantic*} %{w} %{f*}\
%{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}\
%{save-temps:-fpch-preprocess}";
@@ -796,7 +796,7 @@ static const char *cc1_options =
"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}\
- %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi}\
+ %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi}\
%{v:-version} %{pg:-p} %{p} %{f*} %{undef}\
%{Qn:-fno-ident} %{--help:--help}\
%{--target-help:--target-help}\
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2dff62bb8c9..32c3d51a555 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-26 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c/11459
+ * gcc.dg/pr11459-1.c: New test.
+
2004-09-25 Ulrich Weigand <uweigand@de.ibm.com>
* gcc.dg/tree-ssa/loop-2.c: Avoid matching new-line in regexp.
diff --git a/gcc/testsuite/gcc.dg/pr11459-1.c b/gcc/testsuite/gcc.dg/pr11459-1.c
new file mode 100644
index 00000000000..1edd94f814b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr11459-1.c
@@ -0,0 +1,6 @@
+/* -ansi -std=c99 should mean -std=c99, but the specs reordered the
+ options. Bug 11459. */
+/* { dg-do compile } */
+/* { dg-options "-ansi -std=c99 -pedantic" } */
+
+long long i;
OpenPOWER on IntegriCloud