Commit 9ca1483b by Jason Merrill Committed by Jason Merrill

system.h (HAVE_DESIGNATED_UNION_INITIALIZERS): New.

	* system.h (HAVE_DESIGNATED_UNION_INITIALIZERS): New.
	* recog.h (struct insn_data_d): Check it instead of
	HAVE_DESIGNATED_INITIALIZERS.
	* genoutput.c (output_insn_data): Likewise.

From-SVN: r176572
parent b017c70a
2011-07-21 Jason Merrill <jason@redhat.com>
* system.h (HAVE_DESIGNATED_UNION_INITIALIZERS): New.
* recog.h (struct insn_data_d): Check it instead of
HAVE_DESIGNATED_INITIALIZERS.
* genoutput.c (output_insn_data): Likewise.
2011-07-21 Richard Guenther <rguenther@suse.de> 2011-07-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49770 PR tree-optimization/49770
......
...@@ -340,7 +340,7 @@ output_insn_data (void) ...@@ -340,7 +340,7 @@ output_insn_data (void)
switch (d->output_format) switch (d->output_format)
{ {
case INSN_OUTPUT_FORMAT_NONE: case INSN_OUTPUT_FORMAT_NONE:
printf ("#if HAVE_DESIGNATED_INITIALIZERS\n"); printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { 0 },\n"); printf (" { 0 },\n");
printf ("#else\n"); printf ("#else\n");
printf (" { 0, 0, 0 },\n"); printf (" { 0, 0, 0 },\n");
...@@ -351,7 +351,7 @@ output_insn_data (void) ...@@ -351,7 +351,7 @@ output_insn_data (void)
const char *p = d->template_code; const char *p = d->template_code;
char prev = 0; char prev = 0;
printf ("#if HAVE_DESIGNATED_INITIALIZERS\n"); printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { .single =\n"); printf (" { .single =\n");
printf ("#else\n"); printf ("#else\n");
printf (" {\n"); printf (" {\n");
...@@ -372,7 +372,7 @@ output_insn_data (void) ...@@ -372,7 +372,7 @@ output_insn_data (void)
++p; ++p;
} }
printf ("\",\n"); printf ("\",\n");
printf ("#if HAVE_DESIGNATED_INITIALIZERS\n"); printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" },\n"); printf (" },\n");
printf ("#else\n"); printf ("#else\n");
printf (" 0, 0 },\n"); printf (" 0, 0 },\n");
...@@ -380,14 +380,14 @@ output_insn_data (void) ...@@ -380,14 +380,14 @@ output_insn_data (void)
} }
break; break;
case INSN_OUTPUT_FORMAT_MULTI: case INSN_OUTPUT_FORMAT_MULTI:
printf ("#if HAVE_DESIGNATED_INITIALIZERS\n"); printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { .multi = output_%d },\n", d->code_number); printf (" { .multi = output_%d },\n", d->code_number);
printf ("#else\n"); printf ("#else\n");
printf (" { 0, output_%d, 0 },\n", d->code_number); printf (" { 0, output_%d, 0 },\n", d->code_number);
printf ("#endif\n"); printf ("#endif\n");
break; break;
case INSN_OUTPUT_FORMAT_FUNCTION: case INSN_OUTPUT_FORMAT_FUNCTION:
printf ("#if HAVE_DESIGNATED_INITIALIZERS\n"); printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { .function = output_%d },\n", d->code_number); printf (" { .function = output_%d },\n", d->code_number);
printf ("#else\n"); printf ("#else\n");
printf (" { 0, 0, output_%d },\n", d->code_number); printf (" { 0, 0, output_%d },\n", d->code_number);
......
...@@ -286,7 +286,7 @@ struct insn_operand_data ...@@ -286,7 +286,7 @@ struct insn_operand_data
struct insn_data_d struct insn_data_d
{ {
const char *const name; const char *const name;
#if HAVE_DESIGNATED_INITIALIZERS #if HAVE_DESIGNATED_UNION_INITIALIZERS
union { union {
const char *single; const char *single;
const char *const *multi; const char *const *multi;
......
...@@ -500,6 +500,12 @@ extern int vsnprintf(char *, size_t, const char *, va_list); ...@@ -500,6 +500,12 @@ extern int vsnprintf(char *, size_t, const char *, va_list);
&& !defined(__cplusplus)) && !defined(__cplusplus))
#endif #endif
#if !defined(HAVE_DESIGNATED_UNION_INITIALIZERS)
#define HAVE_DESIGNATED_UNION_INITIALIZERS \
(((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)) \
&& (!defined(__cplusplus) || (GCC_VERSION >= 4007)))
#endif
#if HAVE_SYS_STAT_H #if HAVE_SYS_STAT_H
# include <sys/stat.h> # include <sys/stat.h>
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment