public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6012] For -foffload= suggest also 'disable' and 'default' [PR103644]
@ 2021-12-16 10:19 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2021-12-16 10:19 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2c1ac0bf3d44e4ca6e32533d8b498c7d1dbd2425

commit r12-6012-g2c1ac0bf3d44e4ca6e32533d8b498c7d1dbd2425
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Thu Dec 16 11:19:37 2021 +0100

    For -foffload= suggest also 'disable' and 'default' [PR103644]
    
    gcc/ChangeLog:
    
            PR driver/103644
            * gcc.c (check_offload_target_name): Add 'default' and 'disable'
            to the candidate list.

Diff:
---
 gcc/gcc.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/gcc/gcc.c b/gcc/gcc.c
index 694c2573109..b75b50b87b2 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4017,26 +4017,25 @@ check_offload_target_name (const char *target, ptrdiff_t len)
       memcpy (cand, OFFLOAD_TARGETS, olen);
       for (c = strtok (cand, ","); c; c = strtok (NULL, ","))
 	candidates.safe_push (c);
+      candidates.safe_push ("default");
+      candidates.safe_push ("disable");
 
       char *target2 = XALLOCAVEC (char, len + 1);
       memcpy (target2, target, len);
       target2[len] = '\0';
 
-      error ("GCC is not configured to support %qs as offload target", target2);
+      error ("GCC is not configured to support %qs as %<-foffload=%> argument",
+	     target2);
 
-      if (candidates.is_empty ())
-	inform (UNKNOWN_LOCATION, "no offloading targets configured");
+      char *s;
+      const char *hint = candidates_list_and_hint (target2, s, candidates);
+      if (hint)
+	inform (UNKNOWN_LOCATION,
+		"valid %<-foffload=%> arguments are: %s; "
+		"did you mean %qs?", s, hint);
       else
-	{
-	  char *s;
-	  const char *hint = candidates_list_and_hint (target2, s, candidates);
-	  if (hint)
-	    inform (UNKNOWN_LOCATION,
-		    "valid offload targets are: %s; did you mean %qs?", s, hint);
-	  else
-	    inform (UNKNOWN_LOCATION, "valid offload targets are: %s", s);
-	  XDELETEVEC (s);
-	}
+	inform (UNKNOWN_LOCATION, "valid %<-foffload=%> arguments are: %s", s);
+      XDELETEVEC (s);
       return false;
     }
   return true;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-16 10:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 10:19 [gcc r12-6012] For -foffload= suggest also 'disable' and 'default' [PR103644] Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).