aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-07-21 10:48:03 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-07-21 10:48:03 -0400
commit9ca1483b52373166e0aaa3ab9c1c0bdd67f7bff3 (patch)
tree3060f77dc0b0ef97b4b40bde2e4dd30ff267e372 /gcc
parentb017c70a27acaf4f5d9dfe9b91d8b6db5ab75324 (diff)
downloadgcc-9ca1483b52373166e0aaa3ab9c1c0bdd67f7bff3.zip
gcc-9ca1483b52373166e0aaa3ab9c1c0bdd67f7bff3.tar.gz
gcc-9ca1483b52373166e0aaa3ab9c1c0bdd67f7bff3.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/genoutput.c10
-rw-r--r--gcc/recog.h2
-rw-r--r--gcc/system.h6
4 files changed, 19 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a6904e5..ccfcfee 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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>
PR tree-optimization/49770
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 621439f..bc41b7b 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -340,7 +340,7 @@ output_insn_data (void)
switch (d->output_format)
{
case INSN_OUTPUT_FORMAT_NONE:
- printf ("#if HAVE_DESIGNATED_INITIALIZERS\n");
+ printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { 0 },\n");
printf ("#else\n");
printf (" { 0, 0, 0 },\n");
@@ -351,7 +351,7 @@ output_insn_data (void)
const char *p = d->template_code;
char prev = 0;
- printf ("#if HAVE_DESIGNATED_INITIALIZERS\n");
+ printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" { .single =\n");
printf ("#else\n");
printf (" {\n");
@@ -372,7 +372,7 @@ output_insn_data (void)
++p;
}
printf ("\",\n");
- printf ("#if HAVE_DESIGNATED_INITIALIZERS\n");
+ printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
printf (" },\n");
printf ("#else\n");
printf (" 0, 0 },\n");
@@ -380,14 +380,14 @@ output_insn_data (void)
}
break;
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 ("#else\n");
printf (" { 0, output_%d, 0 },\n", d->code_number);
printf ("#endif\n");
break;
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 ("#else\n");
printf (" { 0, 0, output_%d },\n", d->code_number);
diff --git a/gcc/recog.h b/gcc/recog.h
index cce1321..71dfe2a 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -286,7 +286,7 @@ struct insn_operand_data
struct insn_data_d
{
const char *const name;
-#if HAVE_DESIGNATED_INITIALIZERS
+#if HAVE_DESIGNATED_UNION_INITIALIZERS
union {
const char *single;
const char *const *multi;
diff --git a/gcc/system.h b/gcc/system.h
index e02cbcd..ce027b2 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -500,6 +500,12 @@ extern int vsnprintf(char *, size_t, const char *, va_list);
&& !defined(__cplusplus))
#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
# include <sys/stat.h>
#endif