Ticket #64316: patch-genconditions.diff

File patch-genconditions.diff, 1.3 KB (added by i0ntempest, 3 years ago)
  • gcc/genconditions.c

    write_header (void) 
    5757\n\
    5858/* It is necessary, but not entirely safe, to include the headers below\n\
    5959   in a generator program.  As a defensive measure, don't do so when the\n\
    60    table isn't going to have anything in it.  */\n\
    61 #if GCC_VERSION >= 3001\n\
     60   table isn't going to have anything in it.\n\
     61   Clang 9 is buggy and doesn't handle __builtin_constant_p correctly.  */\n\
     62#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\
    6263\n\
    6364/* Do not allow checking to confuse the issue.  */\n\
    6465#undef CHECKING_P\n\
    struct c_test\n\ 
    170171   vary at run time.  It works in 3.0.1 and later; 3.0 only when not\n\
    171172   optimizing.  */\n\
    172173\n\
    173 #if GCC_VERSION >= 3001\n\
     174#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\
    174175static const struct c_test insn_conditions[] = {\n");
    175176
    176177  traverse_c_tests (write_one_condition, 0);
    write_writer (void) 
    191192        "  unsigned int i;\n"
    192193        "  const char *p;\n"
    193194        "  puts (\"(define_conditions [\");\n"
    194         "#if GCC_VERSION >= 3001\n"
     195        "#if GCC_VERSION >= 3001 && __clang_major__ < 9\n"
    195196        "  for (i = 0; i < ARRAY_SIZE (insn_conditions); i++)\n"
    196197        "    {\n"
    197198        "      printf (\"  (%d \\\"\", insn_conditions[i].value);\n"