system.h (HAVE_DESIGNATED_UNION_INITIALIZERS): New.
authorJason Merrill <jason@redhat.com>
Thu, 21 Jul 2011 14:48:03 +0000 (10:48 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 21 Jul 2011 14:48:03 +0000 (10:48 -0400)
* 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

gcc/ChangeLog
gcc/genoutput.c
gcc/recog.h
gcc/system.h

index a6904e524ea771f3a56cdf2c1b159faea443adbb..ccfcfeeb1fce36c327d6a065d9c1833798b8d980 100644 (file)
@@ -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
index 621439f479acb4bf31cb45641ca7293ce252c30b..bc41b7bc7f581fb5e65a9917dcdcb14ba944595d 100644 (file)
@@ -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);
index cce1321ad09d605e68963066f29039062b41f58a..71dfe2a68a94b494405f8c6d3d62857e30e505f1 100644 (file)
@@ -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;
index e02cbcd012cdeb5f37a2ac395043f613fe0adda9..ce027b2ea1e7b4e4b82673206321abc0efbebca8 100644 (file)
@@ -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