From 740ca4b2b10f7b6bd13568988b659b436143b1a9 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 2 Feb 2005 23:01:11 +0000 Subject: [PATCH] re PR c/18502 (trigraphs don't work with -std=gnu99) PR c/18502 * gcc.c (cpp_unique_options): Remove %{trigraphs}. (cpp_options, cc1_options): Change %{std*&ansi} to %{std*&ansi&trigraphs}. testsuite: * gcc.dg/pr18502-1.c: New test. From-SVN: r94632 --- gcc/ChangeLog | 7 +++++++ gcc/gcc.c | 10 +++++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr18502-1.c | 7 +++++++ 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr18502-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ae56c6e1eef..21fe9baf915 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-02-02 Joseph S. Myers + + PR c/18502 + * gcc.c (cpp_unique_options): Remove %{trigraphs}. + (cpp_options, cc1_options): Change %{std*&ansi} to + %{std*&ansi&trigraphs}. + 2005-02-02 Kazu Hirata * cse.c: Update comments. diff --git a/gcc/gcc.c b/gcc/gcc.c index 99d92f95438..7f0322d2bb1 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -773,7 +773,7 @@ static const char *cpp_unique_options = %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\ %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\ %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}}\ - %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\ + %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\ %{fmudflap:-D_MUDFLAP -include mf-runtime.h}\ %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\ %{E|M|MM:%W{o*}}"; @@ -784,9 +784,9 @@ 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*}\ - %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}\ - %{save-temps:-fpch-preprocess}"; +"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ + %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*}\ + %{undef} %{save-temps:-fpch-preprocess}"; /* This contains cpp options which are not passed when the preprocessor output will be used by another program. */ @@ -797,7 +797,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&trigraphs}\ %{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 e83ff1a7800..06a18e4e1f6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-02-02 Joseph S. Myers + + PR c/18502 + * gcc.dg/pr18502-1.c: New test. + 2005-02-02 Volker Reichelt PR c++/17413 diff --git a/gcc/testsuite/gcc.dg/pr18502-1.c b/gcc/testsuite/gcc.dg/pr18502-1.c new file mode 100644 index 00000000000..038c8104aa8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr18502-1.c @@ -0,0 +1,7 @@ +/* Test that -trigraphs isn't reordered before -std=gnu99. Bug + 18502. */ +/* Origin: Joseph Myers */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 -trigraphs" } */ + +int a??(2??); -- 2.30.2