aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2020-05-26 11:02:21 -0300
committerAlexandre Oliva <oliva@gnu.org>2020-05-26 11:02:21 -0300
commit6232d02b4fce4c67d39815aa8fb956e4b10a4e1b (patch)
tree10272b2b66191d25d85ed047c780df380714cacc /gcc/ada/gcc-interface
parent1d72079ba3a370d6751953312f0de76d1a1c555d (diff)
downloadgcc-6232d02b4fce4c67d39815aa8fb956e4b10a4e1b.zip
gcc-6232d02b4fce4c67d39815aa8fb956e4b10a4e1b.tar.gz
gcc-6232d02b4fce4c67d39815aa8fb956e4b10a4e1b.tar.bz2
do not skip validation of switch after %<opt
After the patch that revamped dump and aux outputs, GCC compilation drivers built without Ada would reject -d* options. Such options would only be validated because of the %{d*} in Ada lang specs, though other languages had it as well. Other languages had %< specs that had to be there before %{d*} %:dumps(), while Ada was missing them. Adding them to Ada brought the same problem to compilers that had Ada enabled. The reason validation failed was that they mishandled %< specs, advancing past the beginning of the next spec, causing it not to be handled. Since %{d*} appeared after an odd %<, it was thus ignored. The logic of validate_switches originally skipped the closing brace that matched the opening brace, but this shouldn't happen for %<. Fixed by letting validate_switches know whether it is handling a braced group or a single atom, and behaving accordingly. gcc/ChangeLog: * gcc.c (validate_switches): Add braced parameter. Adjust all callers. Expected and skip trailing brace only if braced. Return after handling one atom otherwise. (DUMPS_OPTIONS): New. (cpp_debug_options): Define in terms of it. gcc/ada/ChangeLog: * gcc-interface/lang-specs.h (ADA_DUMPS_OPTIONS): Define in terms of DUMPS_OPTIONS. Replace occurrences of %{d*} %:dumps with it.
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/lang-specs.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/lang-specs.h b/gcc/ada/gcc-interface/lang-specs.h
index 12b7cf5..f0ef3b92 100644
--- a/gcc/ada/gcc-interface/lang-specs.h
+++ b/gcc/ada/gcc-interface/lang-specs.h
@@ -23,6 +23,10 @@
* *
****************************************************************************/
+/* Pass -d* flags to the actual compiler, but mapping non-Ada
+ extensions to .ada in dump file names. */
+#define ADA_DUMPS_OPTIONS DUMPS_OPTIONS ("%{!.adb:%{!.ads:.ada}}")
+
/* This is the contribution to the `default_compilers' array in gcc.c for
GNAT. */
@@ -35,7 +39,7 @@
gnat1 %{I*} %{k8:-gnatk8} %{Wall:-gnatwa} %{w:-gnatws} %{!Q:-quiet}\
%{nostdinc*} %{nostdlib*}\
%{fcompare-debug-second:-gnatd_A} \
- %{O*} %{W*} %{w} %{p} %{pg:-p} %{d*} %:dumps(%{!.adb:%{!.ads:.ada}}) \
+ %{O*} %{W*} %{w} %{p} %{pg:-p} " ADA_DUMPS_OPTIONS " \
%{coverage:-fprofile-arcs -ftest-coverage} "
#if defined(TARGET_VXWORKS_RTP)
"%{fRTS=rtp|fRTS=rtp-smp|fRTS=ravenscar-cert-rtp:-mrtp} "
@@ -51,7 +55,7 @@
%{!c:%e-c required for gnat2why}\
gnat1why %{I*} %{k8:-gnatk8} %{!Q:-quiet}\
%{nostdinc*} %{nostdlib*}\
- %{a} %{d*} %:dumps(%{!.adb:%{!.ads:.ada}}) \
+ %{a} " ADA_DUMPS_OPTIONS " \
%{gnatea:-gnatez} %{g*&m*&f*} \
%1 %{o*:%w%*-gnatO} \
%i \
@@ -62,7 +66,7 @@
%{!c:%e-c required for gnat2scil}\
gnat1scil %{I*} %{k8:-gnatk8} %{!Q:-quiet}\
%{nostdinc*} %{nostdlib*}\
- %{a} %{d*} %:dumps(%{!.adb:%{!.ads:.ada}}) \
+ %{a} " ADA_DUMPS_OPTIONS " \
%{gnatea:-gnatez} %{g*&m*&f*} \
%1 %{o*:%w%*-gnatO} \
%i \