public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] S/390: Avoid confusing error message for wrong -march= values
@ 2010-11-08 15:53 Andreas Krebbel
  0 siblings, 0 replies; only message in thread
From: Andreas Krebbel @ 2010-11-08 15:53 UTC (permalink / raw)
  To: gcc-patches

Hi,

if s390 GCC is invoked with a wrong -march= option GCC produces a
somewhat confusing error message:

gcc t.c -march=foo

cc1: error: unrecognized command line option "-march=foo"
/root/t.c:1: error: z/Architecture mode not supported on foo

Although the second part is correct as well this is probably not what
the user would like to know in that case.  The attached patch fixes
this by canceling further processing of the options in case the march
option wasn't recognized successfully.

This fixes the gcc.dg/march.c testcase.

Committed to mainline.

Bye,

-Andreas-
<

2010-11-08  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* config/s390/s390.c (s390_handle_arch_option): Set type and flags
	to defined values in case of an error.
	(s390_option_override): Skip further processing if the -march
	parameter wasn't recognized.


Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig
--- gcc/config/s390/s390.c
*************** s390_handle_arch_option (const char *arg
*** 1554,1559 ****
--- 1554,1562 ----
  	*flags = processor_alias_table[i].flags;
  	return true;
        }
+ 
+   *type = PROCESSOR_max;
+   *flags = 0;
    return false;
  }
  
*************** s390_option_override (void)
*** 1614,1619 ****
--- 1617,1628 ----
        s390_handle_arch_option (s390_arch_string, &s390_arch, &s390_arch_flags);
      }
  
+   /* This check is triggered when the user specified a wrong -march=
+      string and prevents subsequent error messages from being
+      issued.  */
+   if (s390_arch == PROCESSOR_max)
+     return;
+ 
    /* Determine processor to tune for.  */
    if (s390_tune == PROCESSOR_max)
      {

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

only message in thread, other threads:[~2010-11-08 15:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-08 15:53 [Committed] S/390: Avoid confusing error message for wrong -march= values Andreas Krebbel

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).