From 6806469dbed7e2613fad5468a94830c2cc817c95 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 18 May 2021 11:17:56 +0200 Subject: startswith: Fix offloading targets. gcc/ChangeLog: * config/gcn/mkoffload.c (STR): Redefine. * config/i386/intelmic-mkoffload.c (STR): Likewise. * config/nvptx/mkoffload.c (STR): Likewise. --- gcc/config/gcn/mkoffload.c | 4 +++- gcc/config/i386/intelmic-mkoffload.c | 4 +++- gcc/config/nvptx/mkoffload.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/config/gcn/mkoffload.c b/gcc/config/gcn/mkoffload.c index 5432f95..1469a68 100644 --- a/gcc/config/gcn/mkoffload.c +++ b/gcc/config/gcn/mkoffload.c @@ -825,7 +825,8 @@ main (int argc, char **argv) bool fpic = false; for (int i = 1; i < argc; i++) { - if (startswith (argv[i], "-foffload-abi=")) +#define STR "-foffload-abi=" + if (startswith (argv[i], STR)) { if (strcmp (argv[i] + strlen (STR), "lp64") == 0) offload_abi = OFFLOAD_ABI_LP64; @@ -835,6 +836,7 @@ main (int argc, char **argv) fatal_error (input_location, "unrecognizable argument of option " STR); } +#undef STR else if (strcmp (argv[i], "-fopenmp") == 0) fopenmp = true; else if (strcmp (argv[i], "-fopenacc") == 0) diff --git a/gcc/config/i386/intelmic-mkoffload.c b/gcc/config/i386/intelmic-mkoffload.c index cb946d6..03858e6 100644 --- a/gcc/config/i386/intelmic-mkoffload.c +++ b/gcc/config/i386/intelmic-mkoffload.c @@ -613,7 +613,8 @@ main (int argc, char **argv) /* Scan the argument vector. */ for (int i = 1; i < argc; i++) { - if (startswith (argv[i], "-foffload-abi=")) +#define STR "-foffload-abi=" + if (startswith (argv[i], STR)) { if (strcmp (argv[i] + strlen (STR), "lp64") == 0) offload_abi = OFFLOAD_ABI_LP64; @@ -623,6 +624,7 @@ main (int argc, char **argv) fatal_error (input_location, "unrecognizable argument of option " STR); } +#undef STR else if (strcmp (argv[i], "-save-temps") == 0) save_temps = true; else if (strcmp (argv[i], "-v") == 0) diff --git a/gcc/config/nvptx/mkoffload.c b/gcc/config/nvptx/mkoffload.c index c46c85d..17f17e5 100644 --- a/gcc/config/nvptx/mkoffload.c +++ b/gcc/config/nvptx/mkoffload.c @@ -481,7 +481,8 @@ main (int argc, char **argv) bool fpic = false; for (int i = 1; i < argc; i++) { - if (startswith (argv[i], "-foffload-abi=")) +#define STR "-foffload-abi=" + if (startswith (argv[i], STR)) { if (strcmp (argv[i] + strlen (STR), "lp64") == 0) offload_abi = OFFLOAD_ABI_LP64; @@ -491,6 +492,7 @@ main (int argc, char **argv) fatal_error (input_location, "unrecognizable argument of option " STR); } +#undef STR else if (strcmp (argv[i], "-fopenmp") == 0) fopenmp = true; else if (strcmp (argv[i], "-fopenacc") == 0) -- cgit v1.1