aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2011-02-27 12:23:14 +0000
committerDenis Chertykov <denisc@gcc.gnu.org>2011-02-27 15:23:14 +0300
commit593fca4be8f07373eeb4b54225f3ec35724bdbe9 (patch)
tree2ed1955f9cd6da44574b9e4b934e64497fec9a3e
parent113a53c14290fae0b8769675cc1dff8d0140c54f (diff)
downloadgcc-593fca4be8f07373eeb4b54225f3ec35724bdbe9.zip
gcc-593fca4be8f07373eeb4b54225f3ec35724bdbe9.tar.gz
gcc-593fca4be8f07373eeb4b54225f3ec35724bdbe9.tar.bz2
re PR target/45261 (Doesn't indicate failure status when it doesn't support (attiny2313A))
2011-02-23 Georg-Johann Lay <avr@gjlay.de> PR target/45261 * config/avr/avr.c (avr_option_override): Use error on bad options. (avr_help): New function. (TARGET_HELP): Define. From-SVN: r170536
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/avr/avr.c46
2 files changed, 49 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 88d3edd..1d6f9a5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2011-02-23 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/45261
+ * config/avr/avr.c (avr_option_override): Use error on bad options.
+ (avr_help): New function.
+ (TARGET_HELP): Define.
+
2011-02-22 Georg-Johann Lay <avr@gjlay.de>
PR target/42240
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index c6f60b4..465de46 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -97,6 +97,7 @@ static rtx avr_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
static void avr_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
+static void avr_help (void);
/* Allocate registers from r25 to r8 for parameters for function calls. */
#define FIRST_CUM_REG 26
@@ -221,6 +222,9 @@ static const struct default_options avr_option_optimization_table[] =
#undef TARGET_CANNOT_MODIFY_JUMPS_P
#define TARGET_CANNOT_MODIFY_JUMPS_P avr_cannot_modify_jumps_p
+#undef TARGET_HELP
+#define TARGET_HELP avr_help
+
struct gcc_target targetm = TARGET_INITIALIZER;
static void
@@ -236,10 +240,8 @@ avr_option_override (void)
if (!t->name)
{
- fprintf (stderr, "unknown MCU '%s' specified\nKnown MCU names:\n",
- avr_mcu_name);
- for (t = avr_mcu_types; t->name; t++)
- fprintf (stderr," %s\n", t->name);
+ error ("unrecognized argument to -mmcu= option: %qs", avr_mcu_name);
+ inform (input_location, "See --target-help for supported MCUs");
}
avr_current_device = t;
@@ -252,6 +254,42 @@ avr_option_override (void)
init_machine_status = avr_init_machine_status;
}
+/* Implement TARGET_HELP */
+/* Report extra information for --target-help */
+
+static void
+avr_help (void)
+{
+ const struct mcu_type_s *t;
+ const char * const indent = " ";
+ int len;
+
+ /* Give a list of MCUs that are accepted by -mmcu=* .
+ Note that MCUs supported by the compiler might differ from
+ MCUs supported by binutils. */
+
+ len = strlen (indent);
+ printf ("Known MCU names:\n%s", indent);
+
+ /* Print a blank-separated list of all supported MCUs */
+
+ for (t = avr_mcu_types; t->name; t++)
+ {
+ printf ("%s ", t->name);
+ len += 1 + strlen (t->name);
+
+ /* Break long lines */
+
+ if (len > 66 && (t+1)->name)
+ {
+ printf ("\n%s", indent);
+ len = strlen (indent);
+ }
+ }
+
+ printf ("\n\n");
+}
+
/* return register class from register number. */
static const enum reg_class reg_class_tab[]={