From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111040 invoked by alias); 9 May 2015 04:31:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 111030 invoked by uid 89); 9 May 2015 04:30:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_50,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 09 May 2015 04:30:52 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 15A8E2931FE for ; Sat, 9 May 2015 04:30:51 +0000 (UTC) Received: from [10.3.112.30] (ovpn-112-30.phx2.redhat.com [10.3.112.30]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t494UngM001572 for ; Sat, 9 May 2015 00:30:50 -0400 Message-ID: <554D8D79.9080502@redhat.com> Date: Sat, 09 May 2015 04:31:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: gcc-patches List Subject: PATCHes to help with C++11 bootstrap Content-Type: multipart/mixed; boundary="------------040303020102000804030901" X-SW-Source: 2015-05/txt/msg00808.txt.bz2 This is a multi-part message in MIME format. --------------040303020102000804030901 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 675 One C++11 compatibility issue that turns up a lot in the GCC sources is that in C++98, #define BAR "bar" const char *p = "foo"BAR; is well-formed, giving p the value "foobar". But in C++11 this is a user-defined literal with the suffix BAR, which is ill-formed because there is no BAR suffix defined. -Wc++11-compat didn't warn about this, which I'm fixing with the first patch. The second patch fixes all the occurrences in GCC. The third patch fixes the warning to say "-Wc++11-compat" rather than "-Wc++0x-compat". The fourth patch fixes a few G++ tests that were failing with the compiler defaulting to C++11. Tested x86_64-cp-linux-gnu, applying to trunk. --------------040303020102000804030901 Content-Type: text/x-patch; name="strmac-warn.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="strmac-warn.patch" Content-length: 3074 commit 448d6065bcfb24d5d5aa904d93a740b552855aa5 Author: Jason Merrill Date: Fri May 8 22:55:30 2015 -0500 libcpp/ * lex.c (lex_string): Add -Wc++11-compat warning. * include/cpplib.h: Add CPP_W_CXX11_COMPAT. (struct cpp_options): Add cpp_warn_cxx11_compat. * init.c (cpp_create_reader): Initialize it. gcc/c-family/ * c.opt (Wc++0x-compat): Set it. diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 3774a89..8f48d84 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -312,7 +312,7 @@ C ObjC Var(warn_cxx_compat) CPP(warn_cxx_operator_names) CppReason(CPP_W_CXX_OPE Warn about C constructs that are not in the common subset of C and C++ Wc++0x-compat -C++ ObjC++ Var(warn_cxx0x_compat) Warning LangEnabledBy(C++ ObjC++,Wall) +C++ ObjC++ Var(warn_cxx0x_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx11_compat) CppReason(CPP_W_CXX11_COMPAT) Deprecated in favor of -Wc++11-compat Wc++11-compat diff --git a/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x4.C b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x4.C new file mode 100644 index 0000000..c3f0cf5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x4.C @@ -0,0 +1,4 @@ +// { dg-options "-Wall" } + +#define FOO "foo" +const char *p = "bar"FOO; // { dg-warning "macro" } diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 5e08014..0152ec8 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -484,6 +484,9 @@ struct cpp_options /* True if warn about differences between C90 and C99. */ signed char cpp_warn_c90_c99_compat; + /* True if warn about differences between C++98 and C++11. */ + bool cpp_warn_cxx11_compat; + /* Dependency generation. */ struct { @@ -960,7 +963,8 @@ enum { CPP_W_LITERAL_SUFFIX, CPP_W_DATE_TIME, CPP_W_PEDANTIC, - CPP_W_C90_C99_COMPAT + CPP_W_C90_C99_COMPAT, + CPP_W_CXX11_COMPAT }; /* Output a diagnostic of some kind. */ diff --git a/libcpp/init.c b/libcpp/init.c index 45a4d13..1ebd709 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -180,6 +180,7 @@ cpp_create_reader (enum c_lang lang, cpp_hash_table *table, CPP_OPTION (pfile, warn_trigraphs) = 2; CPP_OPTION (pfile, warn_endif_labels) = 1; CPP_OPTION (pfile, cpp_warn_c90_c99_compat) = -1; + CPP_OPTION (pfile, cpp_warn_cxx11_compat) = 0; CPP_OPTION (pfile, cpp_warn_deprecated) = 1; CPP_OPTION (pfile, cpp_warn_long_long) = 0; CPP_OPTION (pfile, dollars_in_ident) = 1; diff --git a/libcpp/lex.c b/libcpp/lex.c index ac96ff8..c7296a1 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1905,6 +1905,12 @@ lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base) ++cur; } } + else if (CPP_OPTION (pfile, cpp_warn_cxx11_compat) + && is_macro (pfile, cur) + && !pfile->state.skipping) + cpp_warning_with_line (pfile, CPP_W_CXX11_COMPAT, + token->src_loc, 0, "C++11 requires a space " + "between string literal and macro"); pfile->buffer->cur = cur; create_literal (pfile, token, base, cur - base, type); --------------040303020102000804030901 Content-Type: text/x-patch; name="gcc-strmac.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gcc-strmac.patch" Content-length: 65068 commit 48a8ea6553809e0cf7bc4af33f56281fa3908b91 Author: Jason Merrill Date: Fri May 8 09:11:19 2015 -0500 * bitmap.c, c/c-aux-info.c, cfg.c, cfghooks.c, cgraph.c, config/aarch64/aarch64.md config/alpha/vms.h, config/darwin.c, config/darwin.h, config/darwin9.h, config/elfos.h, config/i386/bsd.h, config/ia64/ia64.c, config/lm32/lm32.h, config/microblaze/microblaze.h, config/mips/mips.h, config/mmix/mmix.c, config/msp430/msp430.c, config/nios2/nios2.h, config/nvptx/nvptx.c, config/nvptx/nvptx.h, config/pa/pa.c, config/pa/pa.h, config/rs6000/rs6000.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/rx/rx.h, config/s390/s390.h, config/sparc/sol2.h, config/sparc/sparc.h, config/visium/visium.h, cppbuiltin.c, defaults.h, doc/invoke.texi, dwarf2cfi.c, dwarf2out.c, final.c, gcc.c, gcov-dump.c, gcov.c, ipa-cp.c, ipa-inline.c, ipa-polymorphic-call.c, ipa-profile.c, ipa-prop.c, ira-color.c, ira.c, loop-doloop.c, loop-iv.c, mcf.c, modulo-sched.c, predict.c, profile.c, stor-layout.c, toplev.c, tree-ssa-reassoc.c, value-prof.c, wide-int-print.cc: Add space between string literal and macro name. diff --git a/gcc/bitmap.c b/gcc/bitmap.c index 71d5b11..66066a6 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -2170,8 +2170,8 @@ print_statistics (bitmap_descriptor_d **slot, bitmap_output_info *i) sprintf (s, "%s:%i (%s)", s1, d->line, d->function); s[41] = 0; fprintf (stderr, - "%-41s %9u %15"PRId64" %15"PRId64" %15"PRId64 - " %10"PRId64" %10"PRId64"\n", + "%-41s %9u %15" PRId64" %15" PRId64" %15" PRId64 + " %10" PRId64" %10" PRId64"\n", s, d->created, d->allocated, d->peak, d->current, d->nsearches, d->search_iter); @@ -2204,7 +2204,7 @@ dump_bitmap_statistics (void) bitmap_desc_hash->traverse (&info); fprintf (stderr, "---------------------------------------------------------------------------------\n"); fprintf (stderr, - "%-41s %9"PRId64" %15"PRId64"\n", + "%-41s %9" PRId64" %15" PRId64"\n", "Total", info.count, info.size); fprintf (stderr, "---------------------------------------------------------------------------------\n"); } diff --git a/gcc/c/c-aux-info.c b/gcc/c/c-aux-info.c index fcefcae..d80418e 100644 --- a/gcc/c/c-aux-info.c +++ b/gcc/c/c-aux-info.c @@ -319,7 +319,7 @@ gen_type (const char *ret_val, tree t, formals_style style) else { char buff[23]; - sprintf (buff, "["HOST_WIDE_INT_PRINT_DEC"]", + sprintf (buff, "[" HOST_WIDE_INT_PRINT_DEC"]", int_size_in_bytes (t) / int_size_in_bytes (TREE_TYPE (t))); ret_val = gen_type (concat (ret_val, buff, NULL), diff --git a/gcc/cfg.c b/gcc/cfg.c index 3074500..cdcc01c 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -508,7 +508,7 @@ dump_edge_info (FILE *file, edge e, int flags, int do_succ) if (e->count && do_details) { fputs (" count:", file); - fprintf (file, "%"PRId64, e->count); + fprintf (file, "%" PRId64, e->count); } if (e->flags && do_details) @@ -756,7 +756,7 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, int flags, if (flags & TDF_DETAILS) { struct function *fun = DECL_STRUCT_FUNCTION (current_function_decl); - fprintf (outf, ", count " "%"PRId64, + fprintf (outf, ", count " "%" PRId64, (int64_t) bb->count); fprintf (outf, ", freq %i", bb->frequency); if (maybe_hot_bb_p (fun, bb)) diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index fc23edb..02fc1ae 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -330,7 +330,7 @@ dump_bb_for_graph (pretty_printer *pp, basic_block bb) internal_error ("%s does not support dump_bb_for_graph", cfg_hooks->name); if (bb->count) - pp_printf (pp, "COUNT:" "%"PRId64, bb->count); + pp_printf (pp, "COUNT:" "%" PRId64, bb->count); pp_printf (pp, " FREQ:%i |", bb->frequency); pp_write_text_to_stream (pp); if (!(dump_flags & TDF_SLIM)) diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 7f83ccc..dc7d3a7 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1325,7 +1325,7 @@ cgraph_edge::redirect_call_stmt_to_callee (void) if (dump_file) fprintf (dump_file, "Expanding speculative call of %s/%i -> %s/%i count:" - "%"PRId64"\n", + "%" PRId64"\n", xstrdup_for_dump (e->caller->name ()), e->caller->order, xstrdup_for_dump (e->callee->name ()), @@ -1943,7 +1943,7 @@ cgraph_edge::dump_edge_flags (FILE *f) if (indirect_inlining_edge) fprintf (f, "(indirect_inlining) "); if (count) - fprintf (f, "(%"PRId64"x) ", (int64_t)count); + fprintf (f, "(%" PRId64"x) ", (int64_t)count); if (frequency) fprintf (f, "(%.2f per call) ", frequency / (double)CGRAPH_FREQ_BASE); if (can_throw_external) @@ -1979,7 +1979,7 @@ cgraph_node::dump (FILE *f) fprintf (f, " First run: %i\n", tp_first_run); fprintf (f, " Function flags:"); if (count) - fprintf (f, " executed %"PRId64"x", + fprintf (f, " executed %" PRId64"x", (int64_t)count); if (origin) fprintf (f, " nested in: %s", origin->asm_name ()); diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index b715f17..1dbadc0 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -531,7 +531,7 @@ char buf[64]; uint64_t val = ((uint64_t ) 1) << (GET_MODE_SIZE (mode) * BITS_PER_UNIT - 1); - sprintf (buf, "tst\t%%0, %"PRId64, val); + sprintf (buf, "tst\t%%0, %" PRId64, val); output_asm_insn (buf, operands); return "\t%l1"; } diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h index 9cfb441..884b41f 100644 --- a/gcc/config/alpha/vms.h +++ b/gcc/config/alpha/vms.h @@ -219,7 +219,7 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info; /* This is how to advance the location counter by SIZE bytes. */ #define ASM_OUTPUT_SKIP(FILE,SIZE) \ - fprintf (FILE, "\t.space "HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) + fprintf (FILE, "\t.space " HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) /* This says how to output an assembler line to define a global common symbol. */ @@ -227,7 +227,7 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info; #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \ ( fputs ("\t.lcomm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE))) + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE))) /* Switch into a generic section. */ #define TARGET_ASM_NAMED_SECTION vms_asm_named_section diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index ef4d163..5ea7088 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -2251,7 +2251,7 @@ fprintf (file, "# dadon: %s %s (%llu, %u) local %d weak %d" ASM_OUTPUT_LABEL (file, xname); size = 1; - fprintf (file, "\t.space\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); + fprintf (file, "\t.space\t" HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); /* Check that we've correctly picked up the zero-sized item and placed it properly. */ @@ -2392,7 +2392,7 @@ darwin_emit_local_bss (FILE *fp, tree decl, const char *name, fprintf (fp, "\t.align\t%u\n", l2align); assemble_name (fp, name); - fprintf (fp, ":\n\t.space\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); + fprintf (fp, ":\n\t.space\t" HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); } else { @@ -2413,10 +2413,10 @@ darwin_emit_local_bss (FILE *fp, tree decl, const char *name, size = 1; if (l2align) - fprintf (fp, ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", + fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", size, (unsigned) l2align); else - fprintf (fp, ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); + fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); } (*targetm.encode_section_info) (decl, DECL_RTL (decl), false); @@ -2564,7 +2564,7 @@ fprintf (fp, "# albss: %s (%lld,%d) ro %d cst %d stat %d com %d" fprintf (fp, "\t.align\t%u\n", l2align); assemble_name (fp, name); - fprintf (fp, ":\n\t.space\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); + fprintf (fp, ":\n\t.space\t" HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); } else { @@ -2585,9 +2585,9 @@ fprintf (fp, "# albss: %s (%lld,%d) ro %d cst %d stat %d com %d" size = 1; if (l2align) - fprintf (fp, ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", size, l2align); + fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", size, l2align); else - fprintf (fp, ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); + fprintf (fp, "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); } (* targetm.encode_section_info) (decl, DECL_RTL (decl), false); } diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index b61dbb5..66f504e 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -532,7 +532,7 @@ extern GTY(()) int darwin_ms_struct; #define TARGET_ASM_LTO_END darwin_asm_lto_end #define ASM_OUTPUT_SKIP(FILE,SIZE) \ - fprintf (FILE, "\t.space "HOST_WIDE_INT_PRINT_UNSIGNED"\n", SIZE) + fprintf (FILE, "\t.space " HOST_WIDE_INT_PRINT_UNSIGNED"\n", SIZE) /* Give ObjC methods pretty symbol names. */ diff --git a/gcc/config/darwin9.h b/gcc/config/darwin9.h index 03fb045..4204825 100644 --- a/gcc/config/darwin9.h +++ b/gcc/config/darwin9.h @@ -54,7 +54,7 @@ along with GCC; see the file COPYING3. If not see fprintf ((FILE), "\t.comm "); \ assemble_name ((FILE), (NAME)); \ if (_new_size == 0) _new_size = 1; \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ _new_size, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \ } while (0) diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h index 2224961..bcc3870 100644 --- a/gcc/config/elfos.h +++ b/gcc/config/elfos.h @@ -99,7 +99,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef ASM_OUTPUT_SKIP #define ASM_OUTPUT_SKIP(FILE, SIZE) \ - fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ + fprintf ((FILE), "%s" HOST_WIDE_INT_PRINT_UNSIGNED "\n",\ SKIP_ASM_OP, (SIZE)) /* This is how to store into the string LABEL @@ -167,7 +167,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see { \ fprintf ((FILE), "%s", COMMON_ASM_OP); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", \ (SIZE), (ALIGN) / BITS_PER_UNIT); \ } \ while (0) diff --git a/gcc/config/i386/bsd.h b/gcc/config/i386/bsd.h index 8733f6a..2c2c085 100644 --- a/gcc/config/i386/bsd.h +++ b/gcc/config/i386/bsd.h @@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see that says to advance the location counter by SIZE bytes. */ #define ASM_OUTPUT_SKIP(FILE,SIZE) \ - fprintf (FILE, "\t.space "HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) + fprintf (FILE, "\t.space " HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) /* Define the syntax of labels and symbol definitions/declarations. */ diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index c3ed9bb..380088e 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -858,7 +858,7 @@ ia64_vms_output_aligned_decl_common (FILE *file, tree decl, const char *name, /* Code from elfos.h. */ assemble_name (file, name); - fprintf (file, ","HOST_WIDE_INT_PRINT_UNSIGNED",%u", + fprintf (file, "," HOST_WIDE_INT_PRINT_UNSIGNED",%u", size, align / BITS_PER_UNIT); fputc ('\n', file); @@ -10018,7 +10018,7 @@ process_cfa_adjust_cfa (FILE *asm_out_file, rtx pat, rtx insn, gcc_assert (!frame_pointer_needed); if (unwind) fprintf (asm_out_file, - "\t.fframe "HOST_WIDE_INT_PRINT_DEC"\n", + "\t.fframe " HOST_WIDE_INT_PRINT_DEC"\n", -INTVAL (op1)); } else diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h index 04ff7c8..d284703 100644 --- a/gcc/config/lm32/lm32.h +++ b/gcc/config/lm32/lm32.h @@ -437,7 +437,7 @@ do \ switch_to_section (bss_section); \ fprintf ((FILE), "%s", COMMON_ASM_OP); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ (SIZE), (ALIGN) / BITS_PER_UNIT); \ } \ } \ diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h index faeb780..fa53848 100644 --- a/gcc/config/microblaze/microblaze.h +++ b/gcc/config/microblaze/microblaze.h @@ -657,7 +657,7 @@ do { \ } \ fprintf (FILE, "%s", COMMON_ASM_OP); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ (SIZE), (ALIGN) / BITS_PER_UNIT); \ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ } while (0) @@ -677,7 +677,7 @@ do { \ } \ fprintf (FILE, "%s", LCOMMON_ASM_OP); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ (SIZE), (ALIGN) / BITS_PER_UNIT); \ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ } while (0) diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 4bd83f5..0ea4e6d 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -2910,7 +2910,7 @@ do { \ #undef ASM_OUTPUT_SKIP #define ASM_OUTPUT_SKIP(STREAM,SIZE) \ - fprintf (STREAM, "\t.space\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) + fprintf (STREAM, "\t.space\t" HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) /* This is how to output a string. */ #undef ASM_OUTPUT_ASCII diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index faedd43..6e99120 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -1654,7 +1654,7 @@ mmix_print_operand (FILE *stream, rtx x, int code) fatal_insn ("MMIX Internal: Bad value for 'm', not a CONST_INT", x); } - fprintf (stream, "%"PRId64, + fprintf (stream, "%" PRId64, (int64_t) (mmix_intval (x) - 1)); return; @@ -2326,7 +2326,7 @@ mmix_output_register_setting (FILE *stream, fprintf (stream, "\t"); if (insn_const_int_ok_for_constraint (value, CONSTRAINT_K)) - fprintf (stream, "NEGU %s,0,%"PRId64, reg_names[regno], -value); + fprintf (stream, "NEGU %s,0,%" PRId64, reg_names[regno], -value); else if (mmix_shiftable_wyde_value ((uint64_t) value)) { /* First, the one-insn cases. */ diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index 1956427..bec168c 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -1696,7 +1696,7 @@ msp430_output_aligned_decl_common (FILE * stream, { fprintf (stream, COMMON_ASM_OP); assemble_name (stream, name); - fprintf (stream, ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", + fprintf (stream, "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", size, align / BITS_PER_UNIT); } else diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h index 193845b..510ab5f 100644 --- a/gcc/config/nios2/nios2.h +++ b/gcc/config/nios2/nios2.h @@ -435,7 +435,7 @@ do \ { \ fprintf ((FILE), "%s", COMMON_ASM_OP); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", (SIZE), \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", (SIZE), \ (ALIGN) / BITS_PER_UNIT); \ } \ while (0) diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index a434bde..e7fc666 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -600,7 +600,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl) sz = 1; if (cfun->machine->has_call_with_varargs) fprintf (file, "\t.reg.u%d %%outargs;\n" - "\t.local.align 8 .b8 %%outargs_ar["HOST_WIDE_INT_PRINT_DEC"];\n", + "\t.local.align 8 .b8 %%outargs_ar[" HOST_WIDE_INT_PRINT_DEC"];\n", BITS_PER_WORD, sz); if (cfun->machine->punning_buffer_size > 0) fprintf (file, "\t.reg.u%d %%punbuffer;\n" @@ -612,7 +612,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl) if (sz > 0 || cfun->machine->has_call_with_sc) { fprintf (file, "\t.reg.u%d %%frame;\n" - "\t.local.align 8 .b8 %%farray["HOST_WIDE_INT_PRINT_DEC"];\n", + "\t.local.align 8 .b8 %%farray[" HOST_WIDE_INT_PRINT_DEC"];\n", BITS_PER_WORD, sz == 0 ? 1 : sz); fprintf (file, "\tcvta.local.u%d %%frame, %%farray;\n", BITS_PER_WORD); @@ -1472,7 +1472,7 @@ nvptx_assemble_undefined_decl (FILE *file, const char *name, const_tree decl) fprintf (file, ".extern %s .b8 ", section); assemble_name_raw (file, name); if (size > 0) - fprintf (file, "["HOST_WIDE_INT_PRINT_DEC"]", size); + fprintf (file, "[" HOST_WIDE_INT_PRINT_DEC"]", size); fprintf (file, ";\n\n"); } diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h index e4e58dd..8835906 100644 --- a/gcc/config/nvptx/nvptx.h +++ b/gcc/config/nvptx/nvptx.h @@ -317,7 +317,7 @@ struct GTY(()) machine_function (ALIGN) / BITS_PER_UNIT); \ assemble_name ((FILE), (NAME)); \ if ((SIZE) > 0) \ - fprintf (FILE, "["HOST_WIDE_INT_PRINT_DEC"]", (SIZE)); \ + fprintf (FILE, "[" HOST_WIDE_INT_PRINT_DEC"]", (SIZE)); \ fprintf (FILE, ";\n"); \ } \ while (0) @@ -334,7 +334,7 @@ struct GTY(()) machine_function (ALIGN) / BITS_PER_UNIT); \ assemble_name ((FILE), (NAME)); \ if ((SIZE) > 0) \ - fprintf (FILE, "["HOST_WIDE_INT_PRINT_DEC"]", (SIZE)); \ + fprintf (FILE, "[" HOST_WIDE_INT_PRINT_DEC"]", (SIZE)); \ fprintf (FILE, ";\n"); \ } \ while (0) diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 42ead8f..cfdafa6 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -8612,7 +8612,7 @@ pa_asm_output_aligned_bss (FILE *stream, fprintf (stream, "\t.align %u\n", align / BITS_PER_UNIT); ASM_OUTPUT_LABEL (stream, name); - fprintf (stream, "\t.block "HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); + fprintf (stream, "\t.block " HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); } /* Both the HP and GNU assemblers under HP-UX provide a .comm directive @@ -8642,7 +8642,7 @@ pa_asm_output_aligned_common (FILE *stream, switch_to_section (bss_section); assemble_name (stream, name); - fprintf (stream, "\t.comm "HOST_WIDE_INT_PRINT_UNSIGNED"\n", + fprintf (stream, "\t.comm " HOST_WIDE_INT_PRINT_UNSIGNED"\n", MAX (size, align / BITS_PER_UNIT)); } @@ -8669,7 +8669,7 @@ pa_asm_output_aligned_local (FILE *stream, #endif ASM_OUTPUT_LABEL (stream, name); - fprintf (stream, "\t.block "HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); + fprintf (stream, "\t.block " HOST_WIDE_INT_PRINT_UNSIGNED"\n", size); } /* Returns 1 if the 6 operands specified in OPERANDS are suitable for diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index f9107bc..4259a07 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -1210,7 +1210,7 @@ do { \ fprintf (FILE, "\t.align %d\n", (1<<(LOG))) #define ASM_OUTPUT_SKIP(FILE,SIZE) \ - fprintf (FILE, "\t.blockz "HOST_WIDE_INT_PRINT_UNSIGNED"\n", \ + fprintf (FILE, "\t.blockz " HOST_WIDE_INT_PRINT_UNSIGNED"\n", \ (unsigned HOST_WIDE_INT)(SIZE)) /* This says how to output an assembler line to define an uninitialized diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 7c59ac8..9818036 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -11316,8 +11316,8 @@ rs6000_va_start (tree valist, rtx nextarg) FP_ARG_NUM_REG); if (TARGET_DEBUG_ARG) - fprintf (stderr, "va_start: words = "HOST_WIDE_INT_PRINT_DEC", n_gpr = " - HOST_WIDE_INT_PRINT_DEC", n_fpr = "HOST_WIDE_INT_PRINT_DEC"\n", + fprintf (stderr, "va_start: words = " HOST_WIDE_INT_PRINT_DEC", n_gpr = " + HOST_WIDE_INT_PRINT_DEC", n_fpr = " HOST_WIDE_INT_PRINT_DEC"\n", words, n_gpr, n_fpr); if (cfun->va_list_gpr_size) @@ -22161,11 +22161,11 @@ debug_stack_info (rs6000_stack_t *info) fprintf (stderr, "\tvarargs_save_offset = %5d\n", info->varargs_save_offset); if (info->total_size) - fprintf (stderr, "\ttotal_size = "HOST_WIDE_INT_PRINT_DEC"\n", + fprintf (stderr, "\ttotal_size = " HOST_WIDE_INT_PRINT_DEC"\n", info->total_size); if (info->vars_size) - fprintf (stderr, "\tvars_size = "HOST_WIDE_INT_PRINT_DEC"\n", + fprintf (stderr, "\tvars_size = " HOST_WIDE_INT_PRINT_DEC"\n", info->vars_size); if (info->parm_size) diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index 9917c2f..41ed4ef 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -408,7 +408,7 @@ do { \ { \ fprintf (FILE, "%s", LCOMM_ASM_OP); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ (SIZE), (ALIGN) / BITS_PER_UNIT); \ } \ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h index 152320b..0bfe9d9 100644 --- a/gcc/config/rs6000/xcoff.h +++ b/gcc/config/rs6000/xcoff.h @@ -208,7 +208,7 @@ #define SKIP_ASM_OP "\t.space " #define ASM_OUTPUT_SKIP(FILE,SIZE) \ - fprintf (FILE, "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n", SKIP_ASM_OP, (SIZE)) + fprintf (FILE, "%s" HOST_WIDE_INT_PRINT_UNSIGNED"\n", SKIP_ASM_OP, (SIZE)) /* This says how to output an assembler line to define a global common symbol. */ @@ -219,12 +219,12 @@ do { fputs (COMMON_ASM_OP, (FILE)); \ RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ if ((ALIGN) > 32) \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", (SIZE), \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", (SIZE), \ floor_log2 ((ALIGN) / BITS_PER_UNIT)); \ else if ((SIZE) > 4) \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",3\n", (SIZE)); \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",3\n", (SIZE)); \ else \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)); \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)); \ } while (0) /* This says how to output an assembler line @@ -241,15 +241,15 @@ do { fputs (LOCAL_COMMON_ASM_OP, (FILE)); \ RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ if ((ALIGN) > 32) \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s%u_,%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%s%u_,%u\n", \ (SIZE), xcoff_bss_section_name, \ floor_log2 ((ALIGN) / BITS_PER_UNIT), \ floor_log2 ((ALIGN) / BITS_PER_UNIT)); \ else if ((SIZE) > 4) \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s3_,3\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%s3_,3\n", \ (SIZE), xcoff_bss_section_name); \ else \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s,2\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%s,2\n", \ (SIZE), xcoff_bss_section_name); \ } while (0) #endif @@ -257,7 +257,7 @@ #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ do { fputs (LOCAL_COMMON_ASM_OP, (FILE)); \ RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%s\n", \ (TARGET_32BIT ? (SIZE) : (ROUNDED)), \ xcoff_bss_section_name); \ } while (0) @@ -266,7 +266,7 @@ #define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \ do { fputs(COMMON_ASM_OP, (FILE)); \ RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ - fprintf ((FILE), "[UL],"HOST_WIDE_INT_PRINT_UNSIGNED"\n", \ + fprintf ((FILE), "[UL]," HOST_WIDE_INT_PRINT_UNSIGNED"\n", \ (SIZE)); \ } while (0) #endif diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h index 238f340..8391b5b 100644 --- a/gcc/config/rx/rx.h +++ b/gcc/config/rx/rx.h @@ -562,15 +562,15 @@ typedef unsigned int CUMULATIVE_ARGS; switch ((ALIGN) / BITS_PER_UNIT) \ { \ case 4: \ - fprintf ((FILE), ":\t.BLKL\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ + fprintf ((FILE), ":\t.BLKL\t" HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ (SIZE) / 4); \ break; \ case 2: \ - fprintf ((FILE), ":\t.BLKW\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ + fprintf ((FILE), ":\t.BLKW\t" HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ (SIZE) / 2); \ break; \ default: \ - fprintf ((FILE), ":\t.BLKB\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ + fprintf ((FILE), ":\t.BLKB\t" HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ (SIZE)); \ break; \ } \ @@ -579,7 +579,7 @@ typedef unsigned int CUMULATIVE_ARGS; { \ fprintf ((FILE), "%s", COMMON_ASM_OP); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ (SIZE), (ALIGN) / BITS_PER_UNIT); \ } \ } \ diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index f887409..2984aa1 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -807,7 +807,7 @@ do { \ /* Advance the location counter by SIZE bytes. */ #define ASM_OUTPUT_SKIP(FILE, SIZE) \ - fprintf ((FILE), "\t.set\t.,.+"HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) + fprintf ((FILE), "\t.set\t.,.+" HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) /* The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */ #define LOCAL_LABEL_PREFIX "." diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h index 5a21442..c169e7c 100644 --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -359,7 +359,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); switch_to_section (bss_section); \ fprintf ((FILE), "%s", COMMON_ASM_OP); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ (SIZE), (ALIGN) / BITS_PER_UNIT); \ } \ while (0) diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 9b64ff4..2fae9e8 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1694,7 +1694,7 @@ do { \ fprintf (FILE, "\t.align %d\n", (1<<(LOG))) #define ASM_OUTPUT_SKIP(FILE,SIZE) \ - fprintf (FILE, "\t.skip "HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) + fprintf (FILE, "\t.skip " HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) /* This says how to output an assembler line to define a global common symbol. */ @@ -1702,7 +1702,7 @@ do { \ #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ ( fputs ("\t.common ", (FILE)), \ assemble_name ((FILE), (NAME)), \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",\"bss\"\n", (SIZE))) + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",\"bss\"\n", (SIZE))) /* This says how to output an assembler line to define a local common symbol. */ @@ -1710,7 +1710,7 @@ do { \ #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGNED) \ ( fputs ("\t.reserve ", (FILE)), \ assemble_name ((FILE), (NAME)), \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",\"bss\",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",\"bss\",%u\n", \ (SIZE), ((ALIGNED) / BITS_PER_UNIT))) /* A C statement (sans semicolon) to output to the stdio stream diff --git a/gcc/config/visium/visium.h b/gcc/config/visium/visium.h index 50202a3..a2ab61c 100644 --- a/gcc/config/visium/visium.h +++ b/gcc/config/visium/visium.h @@ -1715,14 +1715,14 @@ do \ #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ ( fputs ("\n\t.comm ", (STREAM)), \ assemble_name ((STREAM), (NAME)), \ - fprintf ((STREAM), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", ROUNDED)) + fprintf ((STREAM), "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", ROUNDED)) /* This says how to output assembler code to declare an unitialised internal linkage data object. */ #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \ ( fputs ("\n\t.lcomm ", (STREAM)), \ assemble_name ((STREAM), (NAME)), \ - fprintf ((STREAM), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", ROUNDED)) + fprintf ((STREAM), "," HOST_WIDE_INT_PRINT_UNSIGNED"\n", ROUNDED)) /* Prettify the assembly. */ extern int visium_indent_opcode; diff --git a/gcc/cppbuiltin.c b/gcc/cppbuiltin.c index aae6217..d9e9ab4 100644 --- a/gcc/cppbuiltin.c +++ b/gcc/cppbuiltin.c @@ -143,7 +143,7 @@ static void define_builtin_macros_for_type_sizes (cpp_reader *pfile) { #define define_type_sizeof(NAME, TYPE) \ - cpp_define_formatted (pfile, NAME"="HOST_WIDE_INT_PRINT_DEC, \ + cpp_define_formatted (pfile, NAME"=" HOST_WIDE_INT_PRINT_DEC, \ tree_to_uhwi (TYPE_SIZE_UNIT (TYPE))) define_type_sizeof ("__SIZEOF_INT__", integer_type_node); diff --git a/gcc/defaults.h b/gcc/defaults.h index 47fdcf4..b3edcc9 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -123,7 +123,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see { \ fprintf ((FILE), "\t%s\t", TLS_COMMON_ASM_OP); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ (SIZE), DECL_ALIGN (DECL) / BITS_PER_UNIT); \ } \ while (0) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 9169731..c332f88 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2689,7 +2689,7 @@ For example: int main() @{ int64_t i64 = 123; - printf("My int64: %"PRId64"\n", i64); + printf("My int64: %" PRId64"\n", i64); @} @end smallexample diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index 7bcbd6c..f8b641d 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -3260,7 +3260,7 @@ output_cfi_directive (FILE *f, dw_cfi_ref cfi) case DW_CFA_offset_extended: case DW_CFA_offset_extended_sf: r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 1); - fprintf (f, "\t.cfi_offset %lu, "HOST_WIDE_INT_PRINT_DEC"\n", + fprintf (f, "\t.cfi_offset %lu, " HOST_WIDE_INT_PRINT_DEC"\n", r, cfi->dw_cfi_oprnd2.dw_cfi_offset); break; @@ -3283,7 +3283,7 @@ output_cfi_directive (FILE *f, dw_cfi_ref cfi) case DW_CFA_def_cfa: case DW_CFA_def_cfa_sf: r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 1); - fprintf (f, "\t.cfi_def_cfa %lu, "HOST_WIDE_INT_PRINT_DEC"\n", + fprintf (f, "\t.cfi_def_cfa %lu, " HOST_WIDE_INT_PRINT_DEC"\n", r, cfi->dw_cfi_oprnd2.dw_cfi_offset); break; @@ -3318,13 +3318,13 @@ output_cfi_directive (FILE *f, dw_cfi_ref cfi) fprintf (f, "\t.cfi_escape %#x,", DW_CFA_GNU_args_size); dw2_asm_output_data_uleb128_raw (cfi->dw_cfi_oprnd1.dw_cfi_offset); if (flag_debug_asm) - fprintf (f, "\t%s args_size "HOST_WIDE_INT_PRINT_DEC, + fprintf (f, "\t%s args_size " HOST_WIDE_INT_PRINT_DEC, ASM_COMMENT_START, cfi->dw_cfi_oprnd1.dw_cfi_offset); fputc ('\n', f); } else { - fprintf (f, "\t.cfi_GNU_args_size "HOST_WIDE_INT_PRINT_DEC "\n", + fprintf (f, "\t.cfi_GNU_args_size " HOST_WIDE_INT_PRINT_DEC "\n", cfi->dw_cfi_oprnd1.dw_cfi_offset); } break; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index cb2656c..a1394ef 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -5446,7 +5446,7 @@ print_dw_val (dw_val_node *val, bool recurse, FILE *outfile) fprintf (outfile, HOST_WIDE_INT_PRINT_UNSIGNED, val->v.val_unsigned); break; case dw_val_class_const_double: - fprintf (outfile, "constant ("HOST_WIDE_INT_PRINT_DEC","\ + fprintf (outfile, "constant (" HOST_WIDE_INT_PRINT_DEC","\ HOST_WIDE_INT_PRINT_UNSIGNED")", val->v.val_double.high, val->v.val_double.low); diff --git a/gcc/final.c b/gcc/final.c index 2b9846e..0c91095 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1987,7 +1987,7 @@ dump_basic_block_info (FILE *file, rtx_insn *insn, basic_block *start_to_bb, if (bb->frequency) fprintf (file, " freq:%d", bb->frequency); if (bb->count) - fprintf (file, " count:%"PRId64, + fprintf (file, " count:%" PRId64, bb->count); fprintf (file, " seq:%d", (*bb_seqn)++); fprintf (file, "\n%s PRED:", ASM_COMMENT_START); diff --git a/gcc/gcc.c b/gcc/gcc.c index d956c36..8f01e42 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -771,12 +771,12 @@ proper position among the other output files. */ #define PLUGIN_COND_CLOSE "" #endif #define LINK_PLUGIN_SPEC \ - "%{"PLUGIN_COND": \ + "%{" PLUGIN_COND": \ -plugin %(linker_plugin_file) \ -plugin-opt=%(lto_wrapper) \ -plugin-opt=-fresolution=%u.res \ %{!nostdlib:%{!nodefaultlibs:%:pass-through-libs(%(link_gcc_c_sequence))}} \ - }"PLUGIN_COND_CLOSE + }" PLUGIN_COND_CLOSE #else /* The linker used doesn't support -plugin, reject -fuse-linker-plugin. */ #define LINK_PLUGIN_SPEC "%{fuse-linker-plugin:\ diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c index ec4b28a..d72a17f 100644 --- a/gcc/gcov-dump.c +++ b/gcc/gcov-dump.c @@ -448,7 +448,7 @@ tag_counters (const char *filename ATTRIBUTE_UNUSED, count = gcov_read_counter (); printf (" "); - printf ("%"PRId64, count); + printf ("%" PRId64, count); } } } @@ -471,11 +471,11 @@ tag_summary (const char *filename ATTRIBUTE_UNUSED, printf ("\t\tcounts=%u, runs=%u", summary.ctrs[ix].num, summary.ctrs[ix].runs); - printf (", sum_all=%"PRId64, + printf (", sum_all=%" PRId64, (int64_t)summary.ctrs[ix].sum_all); - printf (", run_max=%"PRId64, + printf (", run_max=%" PRId64, (int64_t)summary.ctrs[ix].run_max); - printf (", sum_max=%"PRId64, + printf (", sum_max=%" PRId64, (int64_t)summary.ctrs[ix].sum_max); if (ix != GCOV_COUNTER_ARCS) continue; @@ -490,8 +490,8 @@ tag_summary (const char *filename ATTRIBUTE_UNUSED, printf ("\n"); print_prefix (filename, 0, 0); printf ("\t\t%d: num counts=%u, min counter=" - "%"PRId64 ", cum_counter=" - "%"PRId64, + "%" PRId64 ", cum_counter=" + "%" PRId64, h_ix, histo_bucket->num_counters, (int64_t)histo_bucket->min_value, (int64_t)histo_bucket->cum_value); @@ -526,7 +526,7 @@ dump_working_sets (const char *filename ATTRIBUTE_UNUSED, printf ("\n"); print_prefix (filename, 0, 0); printf ("\t\t%u.%02u%%: num counts=%u, min counter=" - "%"PRId64, + "%" PRId64, pct / 100, pct - (pct / 100 * 100), ws_info->num_counters, (int64_t)ws_info->min_counter); diff --git a/gcc/gcov.c b/gcc/gcov.c index 796b1b9..60a9d4a 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -1846,7 +1846,7 @@ format_gcov (gcov_type top, gcov_type bottom, int dp) } } else - sprintf (buffer, "%"PRId64, (int64_t)top); + sprintf (buffer, "%" PRId64, (int64_t)top); return buffer; } diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 3824029..356f402 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -2193,7 +2193,7 @@ good_cloning_opportunity_p (struct cgraph_node *node, int time_benefit, if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " good_cloning_opportunity_p (time: %i, " "size: %i, count_sum: " HOST_WIDE_INT_PRINT_DEC - "%s%s) -> evaluation: " "%"PRId64 + "%s%s) -> evaluation: " "%" PRId64 ", threshold: %i\n", time_benefit, size_cost, (HOST_WIDE_INT) count_sum, info->node_within_scc ? ", scc" : "", @@ -2211,7 +2211,7 @@ good_cloning_opportunity_p (struct cgraph_node *node, int time_benefit, if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " good_cloning_opportunity_p (time: %i, " "size: %i, freq_sum: %i%s%s) -> evaluation: " - "%"PRId64 ", threshold: %i\n", + "%" PRId64 ", threshold: %i\n", time_benefit, size_cost, freq_sum, info->node_within_scc ? ", scc" : "", info->node_calling_single_call ? ", single_call" : "", diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 1427761..017f3a5 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1171,8 +1171,8 @@ edge_badness (struct cgraph_edge *edge, bool dump) if (dump) { fprintf (dump_file, - " %f: guessed profile. frequency %f, count %"PRId64 - " caller count %"PRId64 + " %f: guessed profile. frequency %f, count %" PRId64 + " caller count %" PRId64 " time w/o inlining %f, time w inlining %f" " overall growth %i (current) %i (original)" " %i (compensated)\n", @@ -1954,7 +1954,7 @@ inline_small_functions (void) badness.to_double (), edge->frequency / (double)CGRAPH_FREQ_BASE); if (edge->count) - fprintf (dump_file," Called %"PRId64"x\n", + fprintf (dump_file," Called %" PRId64"x\n", edge->count); if (dump_flags & TDF_DETAILS) edge_badness (edge, true); @@ -2241,8 +2241,8 @@ dump_overall_stats (void) sum_weighted += time * node->count; } fprintf (dump_file, "Overall time estimate: " - "%"PRId64" weighted by profile: " - "%"PRId64"\n", sum, sum_weighted); + "%" PRId64" weighted by profile: " + "%" PRId64"\n", sum, sum_weighted); } /* Output some useful stats about inlining. */ @@ -2320,31 +2320,31 @@ dump_inline_stats (void) if (max_count) { fprintf (dump_file, - "Inlined %"PRId64 " + speculative " - "%"PRId64 " + speculative polymorphic " - "%"PRId64 " + previously indirect " - "%"PRId64 " + virtual " - "%"PRId64 " + virtual and previously indirect " - "%"PRId64 "\n" "Not inlined " - "%"PRId64 " + previously indirect " - "%"PRId64 " + virtual " - "%"PRId64 " + virtual and previously indirect " - "%"PRId64 " + stil indirect " - "%"PRId64 " + still indirect polymorphic " - "%"PRId64 "\n", inlined_cnt, + "Inlined %" PRId64 " + speculative " + "%" PRId64 " + speculative polymorphic " + "%" PRId64 " + previously indirect " + "%" PRId64 " + virtual " + "%" PRId64 " + virtual and previously indirect " + "%" PRId64 "\n" "Not inlined " + "%" PRId64 " + previously indirect " + "%" PRId64 " + virtual " + "%" PRId64 " + virtual and previously indirect " + "%" PRId64 " + stil indirect " + "%" PRId64 " + still indirect polymorphic " + "%" PRId64 "\n", inlined_cnt, inlined_speculative, inlined_speculative_ply, inlined_indir_cnt, inlined_virt_cnt, inlined_virt_indir_cnt, noninlined_cnt, noninlined_indir_cnt, noninlined_virt_cnt, noninlined_virt_indir_cnt, indirect_cnt, indirect_poly_cnt); fprintf (dump_file, - "Removed speculations %"PRId64 "\n", + "Removed speculations %" PRId64 "\n", spec_rem); } dump_overall_stats (); fprintf (dump_file, "\nWhy inlining failed?\n"); for (i = 0; i < CIF_N_REASONS; i++) if (reason[i][2]) - fprintf (dump_file, "%-50s: %8i calls, %8i freq, %"PRId64" count\n", + fprintf (dump_file, "%-50s: %8i calls, %8i freq, %" PRId64" count\n", cgraph_inline_failed_string ((cgraph_inline_failed_t) i), (int) reason[i][2], (int) reason[i][1], reason[i][0]); } diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c index e0fd31a..41d5687 100644 --- a/gcc/ipa-polymorphic-call.c +++ b/gcc/ipa-polymorphic-call.c @@ -652,7 +652,7 @@ ipa_polymorphic_call_context::dump (FILE *f, bool newline) const fprintf (f, " (or a derived type)"); if (maybe_in_construction) fprintf (f, " (maybe in construction)"); - fprintf (f, " offset "HOST_WIDE_INT_PRINT_DEC, + fprintf (f, " offset " HOST_WIDE_INT_PRINT_DEC, offset); } if (speculative_outer_type) @@ -663,7 +663,7 @@ ipa_polymorphic_call_context::dump (FILE *f, bool newline) const print_generic_expr (f, speculative_outer_type, TDF_SLIM); if (speculative_maybe_derived_type) fprintf (f, " (or a derived type)"); - fprintf (f, " at offset "HOST_WIDE_INT_PRINT_DEC, + fprintf (f, " at offset " HOST_WIDE_INT_PRINT_DEC, speculative_offset); } } diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c index 96fb810..e0d4266 100644 --- a/gcc/ipa-profile.c +++ b/gcc/ipa-profile.c @@ -186,7 +186,7 @@ dump_histogram (FILE *file, vec histogram) { cumulated_time += histogram[i]->count * histogram[i]->time; cumulated_size += histogram[i]->size; - fprintf (file, " %"PRId64": time:%i (%2.2f) size:%i (%2.2f)\n", + fprintf (file, " %" PRId64": time:%i (%2.2f) size:%i (%2.2f)\n", (int64_t) histogram[i]->count, histogram[i]->time, cumulated_time * 100.0 / overall_time, @@ -543,7 +543,7 @@ ipa_profile (void) { gcov_type min, cumulated_time = 0, cumulated_size = 0; - fprintf (dump_file, "Overall time: %"PRId64"\n", + fprintf (dump_file, "Overall time: %" PRId64"\n", (int64_t)overall_time); min = get_hot_bb_threshold (); for (i = 0; i < (int)histogram.length () && histogram[i]->count >= min; @@ -552,7 +552,7 @@ ipa_profile (void) cumulated_time += histogram[i]->count * histogram[i]->time; cumulated_size += histogram[i]->size; } - fprintf (dump_file, "GCOV min count: %"PRId64 + fprintf (dump_file, "GCOV min count: %" PRId64 " Time:%3.2f%% Size:%3.2f%%\n", (int64_t)min, cumulated_time * 100.0 / overall_time, @@ -578,7 +578,7 @@ ipa_profile (void) cumulated_time += histogram[i]->count * histogram[i]->time; cumulated_size += histogram[i]->size; } - fprintf (dump_file, "Determined min count: %"PRId64 + fprintf (dump_file, "Determined min count: %" PRId64 " Time:%3.2f%% Size:%3.2f%%\n", (int64_t)threshold, cumulated_time * 100.0 / overall_time, diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index dc8f360..26be5f2 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -351,7 +351,7 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs) else if (type == IPA_JF_ANCESTOR) { fprintf (f, "ANCESTOR: "); - fprintf (f, "%d, offset "HOST_WIDE_INT_PRINT_DEC, + fprintf (f, "%d, offset " HOST_WIDE_INT_PRINT_DEC, jump_func->value.ancestor.formal_id, jump_func->value.ancestor.offset); if (jump_func->value.ancestor.agg_preserved) diff --git a/gcc/ira-color.c b/gcc/ira-color.c index 0ed9edd..17a6d29 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -549,7 +549,7 @@ print_hard_regs_subforest (FILE *f, allocno_hard_regs_node_t roots, fprintf (f, " "); fprintf (f, "%d:(", node->preorder_num); print_hard_reg_set (f, node->hard_regs->set, false); - fprintf (f, ")@%"PRId64"\n", node->hard_regs->cost); + fprintf (f, ")@%" PRId64"\n", node->hard_regs->cost); print_hard_regs_subforest (f, node->first, level + 1); } } diff --git a/gcc/ira.c b/gcc/ira.c index bba26e5..7762387 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -2506,12 +2506,12 @@ calculate_allocation_cost (void) if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL) { fprintf (ira_dump_file, - "+++Costs: overall %"PRId64 - ", reg %"PRId64 - ", mem %"PRId64 - ", ld %"PRId64 - ", st %"PRId64 - ", move %"PRId64, + "+++Costs: overall %" PRId64 + ", reg %" PRId64 + ", mem %" PRId64 + ", ld %" PRId64 + ", st %" PRId64 + ", move %" PRId64, ira_overall_cost, ira_reg_cost, ira_mem_cost, ira_load_cost, ira_store_cost, ira_shuffle_cost); fprintf (ira_dump_file, "\n+++ move loops %d, new jumps %d\n", @@ -5442,7 +5442,7 @@ do_reload (void) if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL && overall_cost_before != ira_overall_cost) - fprintf (ira_dump_file, "+++Overall after reload %"PRId64 "\n", + fprintf (ira_dump_file, "+++Overall after reload %" PRId64 "\n", ira_overall_cost); flag_ira_share_spill_slots = saved_flag_ira_share_spill_slots; diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c index 4607867..b5adbac 100644 --- a/gcc/loop-doloop.c +++ b/gcc/loop-doloop.c @@ -446,7 +446,7 @@ doloop_modify (struct loop *loop, struct niter_desc *desc, { fprintf (dump_file, "Doloop: Inserting doloop pattern ("); if (desc->const_iter) - fprintf (dump_file, "%"PRId64, desc->niter); + fprintf (dump_file, "%" PRId64, desc->niter); else fputs ("runtime", dump_file); fputs (" iterations).\n", dump_file); diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index d2cd66e..bf6359d 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -2360,7 +2360,7 @@ determine_max_iter (struct loop *loop, struct niter_desc *desc, rtx old_niter) if (andmax) nmax = MIN (nmax, andmax); if (dump_file) - fprintf (dump_file, ";; Determined upper bound %"PRId64".\n", + fprintf (dump_file, ";; Determined upper bound %" PRId64".\n", nmax); return nmax; } diff --git a/gcc/mcf.c b/gcc/mcf.c index db96eb1..9dacde2 100644 --- a/gcc/mcf.c +++ b/gcc/mcf.c @@ -214,12 +214,12 @@ dump_fixup_edge (FILE *file, fixup_graph_type *fixup_graph, fixup_edge_p fedge) if (fedge->type) { - fprintf (file, "flow/capacity=%"PRId64 "/", + fprintf (file, "flow/capacity=%" PRId64 "/", fedge->flow); if (fedge->max_capacity == CAP_INFINITY) fputs ("+oo,", file); else - fprintf (file, "%"PRId64 ",", fedge->max_capacity); + fprintf (file, "%" PRId64 ",", fedge->max_capacity); } if (fedge->is_rflow_valid) @@ -227,10 +227,10 @@ dump_fixup_edge (FILE *file, fixup_graph_type *fixup_graph, fixup_edge_p fedge) if (fedge->rflow == CAP_INFINITY) fputs (" rflow=+oo.", file); else - fprintf (file, " rflow=%"PRId64 ",", fedge->rflow); + fprintf (file, " rflow=%" PRId64 ",", fedge->rflow); } - fprintf (file, " cost=%"PRId64 ".", fedge->cost); + fprintf (file, " cost=%" PRId64 ".", fedge->cost); fprintf (file, "\t(%d->%d)", fedge->src, fedge->dest); @@ -637,9 +637,9 @@ create_fixup_graph (fixup_graph_type *fixup_graph) if (dump_file) { fprintf (dump_file, "\nAdjust supply and demand:\n"); - fprintf (dump_file, "supply_value=%"PRId64 "\n", + fprintf (dump_file, "supply_value=%" PRId64 "\n", supply_value); - fprintf (dump_file, "demand_value=%"PRId64 "\n", + fprintf (dump_file, "demand_value=%" PRId64 "\n", demand_value); } @@ -909,10 +909,10 @@ cancel_negative_cycle (fixup_graph_type *fixup_graph, { fprintf (dump_file, "%d", cycle[k]); fprintf (dump_file, - ": (%"PRId64 ", %"PRId64 + ": (%" PRId64 ", %" PRId64 ")\n", sum_cost, cycle_flow); fprintf (dump_file, - "Augment cycle with %"PRId64 "\n", + "Augment cycle with %" PRId64 "\n", cycle_flow); } @@ -1104,10 +1104,10 @@ find_max_flow (fixup_graph_type *fixup_graph, int source, int sink) fprintf (dump_file, "<-"); } fprintf (dump_file, - "ENTRY (path_capacity=%"PRId64 ")\n", + "ENTRY (path_capacity=%" PRId64 ")\n", increment); fprintf (dump_file, - "Network flow is %"PRId64 ".\n", + "Network flow is %" PRId64 ".\n", max_flow); } } @@ -1144,7 +1144,7 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) /* Fixup BB. */ if (dump_file) fprintf (dump_file, - "BB%d: %"PRId64 "", bb->index, bb->count); + "BB%d: %" PRId64 "", bb->index, bb->count); pfedge = find_fixup_edge (fixup_graph, i, i + 1); if (pfedge->flow) @@ -1152,7 +1152,7 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) bb->count += pfedge->flow; if (dump_file) { - fprintf (dump_file, " + %"PRId64 "(", + fprintf (dump_file, " + %" PRId64 "(", pfedge->flow); print_edge (dump_file, fixup_graph, i, i + 1); fprintf (dump_file, ")"); @@ -1167,7 +1167,7 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) bb->count -= pfedge_n->flow; if (dump_file) { - fprintf (dump_file, " - %"PRId64 "(", + fprintf (dump_file, " - %" PRId64 "(", pfedge_n->flow); print_edge (dump_file, fixup_graph, i + 1, pfedge->norm_vertex_index); @@ -1175,7 +1175,7 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) } } if (dump_file) - fprintf (dump_file, " = %"PRId64 "\n", bb->count); + fprintf (dump_file, " = %" PRId64 "\n", bb->count); /* Fixup edge. */ FOR_EACH_EDGE (e, ei, bb->succs) @@ -1186,7 +1186,7 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) j = 2 * e->dest->index; if (dump_file) - fprintf (dump_file, "%d->%d: %"PRId64 "", + fprintf (dump_file, "%d->%d: %" PRId64 "", bb->index, e->dest->index, e->count); pfedge = find_fixup_edge (fixup_graph, i + 1, j); @@ -1199,7 +1199,7 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) e->count += pfedge->flow; if (dump_file) { - fprintf (dump_file, " + %"PRId64 "(", + fprintf (dump_file, " + %" PRId64 "(", pfedge->flow); print_edge (dump_file, fixup_graph, i + 1, j); fprintf (dump_file, ")"); @@ -1214,7 +1214,7 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) e->count -= pfedge_n->flow; if (dump_file) { - fprintf (dump_file, " - %"PRId64 "(", + fprintf (dump_file, " - %" PRId64 "(", pfedge_n->flow); print_edge (dump_file, fixup_graph, j, pfedge->norm_vertex_index); @@ -1234,7 +1234,7 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) if (dump_file) { fprintf (dump_file, "(self edge)"); - fprintf (dump_file, " + %"PRId64 "(", + fprintf (dump_file, " + %" PRId64 "(", pfedge_n->flow); print_edge (dump_file, fixup_graph, i + 1, pfedge->norm_vertex_index); @@ -1245,7 +1245,7 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) if (bb->count) e->probability = REG_BR_PROB_BASE * e->count / bb->count; if (dump_file) - fprintf (dump_file, " = %"PRId64 "\t(%.1f%%)\n", + fprintf (dump_file, " = %" PRId64 "\t(%.1f%%)\n", e->count, e->probability * 100.0 / REG_BR_PROB_BASE); } } @@ -1298,14 +1298,14 @@ adjust_cfg_counts (fixup_graph_type *fixup_graph) || (bb->count != sum_edge_counts (bb->succs))) { fprintf (dump_file, - "BB%d(%"PRId64 ") **INVALID**: ", + "BB%d(%" PRId64 ") **INVALID**: ", bb->index, bb->count); fprintf (stderr, - "******** BB%d(%"PRId64 + "******** BB%d(%" PRId64 ") **INVALID**: \n", bb->index, bb->count); - fprintf (dump_file, "in_edges=%"PRId64 " ", + fprintf (dump_file, "in_edges=%" PRId64 " ", sum_edge_counts (bb->preds)); - fprintf (dump_file, "out_edges=%"PRId64 "\n", + fprintf (dump_file, "out_edges=%" PRId64 "\n", sum_edge_counts (bb->succs)); } } diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index 8b0b0d4..ca1ef83 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -1482,15 +1482,15 @@ sms_schedule (void) if (profile_info && flag_branch_probabilities) { fprintf (dump_file, "SMS loop-count "); - fprintf (dump_file, "%"PRId64, + fprintf (dump_file, "%" PRId64, (int64_t) bb->count); fprintf (dump_file, "\n"); fprintf (dump_file, "SMS trip-count "); - fprintf (dump_file, "%"PRId64, + fprintf (dump_file, "%" PRId64, (int64_t) trip_count); fprintf (dump_file, "\n"); fprintf (dump_file, "SMS profile-sum-max "); - fprintf (dump_file, "%"PRId64, + fprintf (dump_file, "%" PRId64, (int64_t) profile_info->sum_max); fprintf (dump_file, "\n"); } @@ -1604,11 +1604,11 @@ sms_schedule (void) if (profile_info && flag_branch_probabilities) { fprintf (dump_file, "SMS loop-count "); - fprintf (dump_file, "%"PRId64, + fprintf (dump_file, "%" PRId64, (int64_t) bb->count); fprintf (dump_file, "\n"); fprintf (dump_file, "SMS profile-sum-max "); - fprintf (dump_file, "%"PRId64, + fprintf (dump_file, "%" PRId64, (int64_t) profile_info->sum_max); fprintf (dump_file, "\n"); } @@ -1635,7 +1635,7 @@ sms_schedule (void) if (dump_file && count_init) { fprintf (dump_file, "SMS const-doloop "); - fprintf (dump_file, "%"PRId64, + fprintf (dump_file, "%" PRId64, loop_count); fprintf (dump_file, "\n"); } @@ -1696,9 +1696,9 @@ sms_schedule (void) fprintf (dump_file, "SMS failed... \n"); fprintf (dump_file, "SMS sched-failed (stage-count=%d," " loop-count=", stage_count); - fprintf (dump_file, "%"PRId64, loop_count); + fprintf (dump_file, "%" PRId64, loop_count); fprintf (dump_file, ", trip-count="); - fprintf (dump_file, "%"PRId64, trip_count); + fprintf (dump_file, "%" PRId64, trip_count); fprintf (dump_file, ")\n"); } break; diff --git a/gcc/predict.c b/gcc/predict.c index 67d5d20..1568633 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -714,10 +714,10 @@ dump_prediction (FILE *file, enum br_predictor predictor, int probability, if (bb->count) { - fprintf (file, " exec %"PRId64, bb->count); + fprintf (file, " exec %" PRId64, bb->count); if (e) { - fprintf (file, " hit %"PRId64, e->count); + fprintf (file, " hit %" PRId64, e->count); fprintf (file, " (%.1f%%)", e->count * 100.0 / bb->count); } } diff --git a/gcc/profile.c b/gcc/profile.c index a178a1b..abc1aad 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -276,7 +276,7 @@ get_working_sets (void) ws_info = &gcov_working_sets[ws_ix]; /* Print out the percentage using int arithmatic to avoid float. */ fprintf (dump_file, "\t\t%u.%02u%%: num counts=%u, min counter=" - "%"PRId64 "\n", + "%" PRId64 "\n", pct / 100, pct - (pct / 100 * 100), ws_info->num_counters, (int64_t)ws_info->min_counter); @@ -357,7 +357,7 @@ is_edge_inconsistent (vec *edges) if (dump_file) { fprintf (dump_file, - "Edge %i->%i is inconsistent, count%"PRId64, + "Edge %i->%i is inconsistent, count%" PRId64, e->src->index, e->dest->index, e->count); dump_bb (dump_file, e->src, 0, TDF_DETAILS); dump_bb (dump_file, e->dest, 0, TDF_DETAILS); @@ -406,7 +406,7 @@ is_inconsistent (void) if (dump_file) { fprintf (dump_file, "BB %i count is negative " - "%"PRId64, + "%" PRId64, bb->index, bb->count); dump_bb (dump_file, bb, 0, TDF_DETAILS); @@ -418,7 +418,7 @@ is_inconsistent (void) if (dump_file) { fprintf (dump_file, "BB %i count does not match sum of incoming edges " - "%"PRId64" should be %"PRId64, + "%" PRId64" should be %" PRId64, bb->index, bb->count, sum_edge_counts (bb->preds)); @@ -433,7 +433,7 @@ is_inconsistent (void) if (dump_file) { fprintf (dump_file, "BB %i count does not match sum of outgoing edges " - "%"PRId64" should be %"PRId64, + "%" PRId64" should be %" PRId64, bb->index, bb->count, sum_edge_counts (bb->succs)); @@ -510,7 +510,7 @@ read_profile_edge_counts (gcov_type *exec_counts) { fprintf (dump_file, "\nRead edge from %i to %i, count:", bb->index, e->dest->index); - fprintf (dump_file, "%"PRId64, + fprintf (dump_file, "%" PRId64, (int64_t) e->count); } } diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 38760b2..006ec5d 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -265,7 +265,7 @@ self_referential_size (tree size) fntype = build_function_type (return_type, param_type_list); /* Build the function declaration. */ - sprintf (buf, "SZ"HOST_WIDE_INT_PRINT_UNSIGNED, fnno++); + sprintf (buf, "SZ" HOST_WIDE_INT_PRINT_UNSIGNED, fnno++); fnname = get_file_function_name (buf); fndecl = build_decl (input_location, FUNCTION_DECL, fnname, fntype); for (t = param_decl_list; t; t = DECL_CHAIN (t)) diff --git a/gcc/toplev.c b/gcc/toplev.c index 38de36b..27736c2 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1114,7 +1114,7 @@ output_stack_usage (void) } fprintf (stack_usage_file, - "%s:%d:%d:%s\t"HOST_WIDE_INT_PRINT_DEC"\t%s\n", + "%s:%d:%d:%s\t" HOST_WIDE_INT_PRINT_DEC"\t%s\n", lbasename (loc.file), loc.line, loc.column, diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index ae9d631..f79303b 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -4549,7 +4549,7 @@ attempt_builtin_powi (gimple stmt, vec *ops) if (elt < vec_len - 1) fputs (" * ", dump_file); } - fprintf (dump_file, ")^"HOST_WIDE_INT_PRINT_DEC"\n", + fprintf (dump_file, ")^" HOST_WIDE_INT_PRINT_DEC"\n", power); } } @@ -4583,7 +4583,7 @@ attempt_builtin_powi (gimple stmt, vec *ops) if (elt < vec_len - 1) fputs (" * ", dump_file); } - fprintf (dump_file, ")^"HOST_WIDE_INT_PRINT_DEC"\n", power); + fprintf (dump_file, ")^" HOST_WIDE_INT_PRINT_DEC"\n", power); } reassociate_stats.pows_created++; diff --git a/gcc/value-prof.c b/gcc/value-prof.c index b16bce8..7252449 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -296,10 +296,10 @@ dump_histogram_value (FILE *dump_file, histogram_value hist) unsigned int i; fprintf (dump_file, " ["); for (i = 0; i < hist->hdata.intvl.steps; i++) - fprintf (dump_file, " %d:%"PRId64, + fprintf (dump_file, " %d:%" PRId64, hist->hdata.intvl.int_start + i, (int64_t) hist->hvalue.counters[i]); - fprintf (dump_file, " ] outside range:%"PRId64, + fprintf (dump_file, " ] outside range:%" PRId64, (int64_t) hist->hvalue.counters[i]); } fprintf (dump_file, ".\n"); @@ -309,8 +309,8 @@ dump_histogram_value (FILE *dump_file, histogram_value hist) fprintf (dump_file, "Pow2 counter "); if (hist->hvalue.counters) { - fprintf (dump_file, "pow2:%"PRId64 - " nonpow2:%"PRId64, + fprintf (dump_file, "pow2:%" PRId64 + " nonpow2:%" PRId64, (int64_t) hist->hvalue.counters[0], (int64_t) hist->hvalue.counters[1]); } @@ -321,9 +321,9 @@ dump_histogram_value (FILE *dump_file, histogram_value hist) fprintf (dump_file, "Single value "); if (hist->hvalue.counters) { - fprintf (dump_file, "value:%"PRId64 - " match:%"PRId64 - " wrong:%"PRId64, + fprintf (dump_file, "value:%" PRId64 + " match:%" PRId64 + " wrong:%" PRId64, (int64_t) hist->hvalue.counters[0], (int64_t) hist->hvalue.counters[1], (int64_t) hist->hvalue.counters[2]); @@ -335,8 +335,8 @@ dump_histogram_value (FILE *dump_file, histogram_value hist) fprintf (dump_file, "Average value "); if (hist->hvalue.counters) { - fprintf (dump_file, "sum:%"PRId64 - " times:%"PRId64, + fprintf (dump_file, "sum:%" PRId64 + " times:%" PRId64, (int64_t) hist->hvalue.counters[0], (int64_t) hist->hvalue.counters[1]); } @@ -347,7 +347,7 @@ dump_histogram_value (FILE *dump_file, histogram_value hist) fprintf (dump_file, "IOR value "); if (hist->hvalue.counters) { - fprintf (dump_file, "ior:%"PRId64, + fprintf (dump_file, "ior:%" PRId64, (int64_t) hist->hvalue.counters[0]); } fprintf (dump_file, ".\n"); @@ -357,9 +357,9 @@ dump_histogram_value (FILE *dump_file, histogram_value hist) fprintf (dump_file, "Constant delta "); if (hist->hvalue.counters) { - fprintf (dump_file, "value:%"PRId64 - " match:%"PRId64 - " wrong:%"PRId64, + fprintf (dump_file, "value:%" PRId64 + " match:%" PRId64 + " wrong:%" PRId64, (int64_t) hist->hvalue.counters[0], (int64_t) hist->hvalue.counters[1], (int64_t) hist->hvalue.counters[2]); @@ -370,9 +370,9 @@ dump_histogram_value (FILE *dump_file, histogram_value hist) fprintf (dump_file, "Indirect call "); if (hist->hvalue.counters) { - fprintf (dump_file, "value:%"PRId64 - " match:%"PRId64 - " all:%"PRId64, + fprintf (dump_file, "value:%" PRId64 + " match:%" PRId64 + " all:%" PRId64, (int64_t) hist->hvalue.counters[0], (int64_t) hist->hvalue.counters[1], (int64_t) hist->hvalue.counters[2]); @@ -383,7 +383,7 @@ dump_histogram_value (FILE *dump_file, histogram_value hist) fprintf (dump_file, "Time profile "); if (hist->hvalue.counters) { - fprintf (dump_file, "time:%"PRId64, + fprintf (dump_file, "time:%" PRId64, (int64_t) hist->hvalue.counters[0]); } fprintf (dump_file, ".\n"); @@ -394,10 +394,10 @@ dump_histogram_value (FILE *dump_file, histogram_value hist) { int i; - fprintf (dump_file, "accu:%"PRId64, hist->hvalue.counters[0]); + fprintf (dump_file, "accu:%" PRId64, hist->hvalue.counters[0]); for (i = 1; i < (GCOV_ICALL_TOPN_VAL << 2); i += 2) { - fprintf (dump_file, " target:%"PRId64 " value:%"PRId64, + fprintf (dump_file, " target:%" PRId64 " value:%" PRId64, (int64_t) hist->hvalue.counters[i], (int64_t) hist->hvalue.counters[i+1]); } @@ -1666,8 +1666,8 @@ gimple_ic_transform (gimple_stmt_iterator *gsi) print_generic_expr (dump_file, direct_call->decl, TDF_SLIM); fprintf (dump_file, " transformation on insn postponned to ipa-profile"); print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); - fprintf (dump_file, "hist->count %"PRId64 - " hist->all %"PRId64"\n", count, all); + fprintf (dump_file, "hist->count %" PRId64 + " hist->all %" PRId64"\n", count, all); } return true; diff --git a/gcc/wide-int-print.cc b/gcc/wide-int-print.cc index 7b81fc2..ead6771 100644 --- a/gcc/wide-int-print.cc +++ b/gcc/wide-int-print.cc @@ -127,7 +127,7 @@ print_hex (const wide_int_ref &wi, char *buf) } else - buf += sprintf (buf, "0x"HOST_WIDE_INT_PRINT_HEX_PURE, wi.elt (--i)); + buf += sprintf (buf, "0x" HOST_WIDE_INT_PRINT_HEX_PURE, wi.elt (--i)); while (--i >= 0) buf += sprintf (buf, HOST_WIDE_INT_PRINT_PADDED_HEX, wi.elt (i)); --------------040303020102000804030901 Content-Type: text/x-patch; name="cxx11_compat.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cxx11_compat.patch" Content-length: 4619 commit 27b7f7f36111ddd6c9cabb5aa499ea37a3523335 Author: Jason Merrill Date: Fri May 8 22:56:26 2015 -0500 gcc/c-family/ * c.opt (Wc++11-compat): Make primary. Rename var warn_cxx11_compat. * c-opts.c: Adjust. gcc/cp/ * cp-gimplify.c, parser.c: Adjust. diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index a61d6a8..8b17674 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -900,7 +900,7 @@ c_common_post_options (const char **pfilename) { /* If we're allowing C++0x constructs, don't warn about C++98 identifiers which are keywords in C++0x. */ - warn_cxx0x_compat = 0; + warn_cxx11_compat = 0; if (warn_narrowing == -1) warn_narrowing = 1; diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 8f48d84..e244a6d 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -312,11 +312,10 @@ C ObjC Var(warn_cxx_compat) CPP(warn_cxx_operator_names) CppReason(CPP_W_CXX_OPE Warn about C constructs that are not in the common subset of C and C++ Wc++0x-compat -C++ ObjC++ Var(warn_cxx0x_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx11_compat) CppReason(CPP_W_CXX11_COMPAT) -Deprecated in favor of -Wc++11-compat +C++ ObjC++ Warning Alias(Wc++11-compat) Undocumented Wc++11-compat -C++ ObjC++ Warning Alias(Wc++0x-compat) +C++ ObjC++ Var(warn_cxx11_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx11_compat) CppReason(CPP_W_CXX11_COMPAT) Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011 Wc++14-compat @@ -627,7 +626,7 @@ C ObjC C++ ObjC++ CPP(warn_multichar) CppReason(CPP_W_MULTICHAR) Var(cpp_warn_mu Warn about use of multi-character character constants Wnarrowing -C ObjC C++ ObjC++ Warning Var(warn_narrowing) Init(-1) LangEnabledBy(C++ ObjC++,Wall || Wc++0x-compat) +C ObjC C++ ObjC++ Warning Var(warn_narrowing) Init(-1) LangEnabledBy(C++ ObjC++,Wall || Wc++11-compat) Warn about narrowing conversions within { } that are ill-formed in C++11 Wnested-externs diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 35749ef..d5a64fc 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -1231,13 +1231,13 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data) } else { - if (warn_cxx0x_compat && cxx_dialect < cxx11 + if (warn_cxx11_compat && cxx_dialect < cxx11 && DECL_DESTRUCTOR_P (current_function_decl) && (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl)) == NULL_TREE) && (get_defaulted_eh_spec (current_function_decl) == empty_except_spec)) - warning_at (loc, OPT_Wc__0x_compat, + warning_at (loc, OPT_Wc__11_compat, "in C++11 this throw will terminate because " "destructors default to noexcept"); } diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 3d165da..6f746a1 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -802,13 +802,13 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token) } else { - if (warn_cxx0x_compat + if (warn_cxx11_compat && C_RID_CODE (token->u.value) >= RID_FIRST_CXX0X && C_RID_CODE (token->u.value) <= RID_LAST_CXX0X) { /* Warn about the C++0x keyword (but still treat it as an identifier). */ - warning (OPT_Wc__0x_compat, + warning (OPT_Wc__11_compat, "identifier %qE is a keyword in C++11", token->u.value); @@ -8162,11 +8162,11 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, /* Get an operator token. */ token = cp_lexer_peek_token (parser->lexer); - if (warn_cxx0x_compat + if (warn_cxx11_compat && token->type == CPP_RSHIFT && !parser->greater_than_is_operator_p) { - if (warning_at (token->location, OPT_Wc__0x_compat, + if (warning_at (token->location, OPT_Wc__11_compat, "%<>>%> operator is treated" " as two right angle brackets in C++11")) inform (token->location, @@ -11873,7 +11873,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser, /* Complain about `auto' as a storage specifier, if we're complaining about C++0x compatibility. */ - warning_at (token->location, OPT_Wc__0x_compat, "%" + warning_at (token->location, OPT_Wc__11_compat, "%" " changes meaning in C++11; please remove it"); /* Set the storage class anyway. */ --------------040303020102000804030901 Content-Type: text/x-patch; name="cxx11-tests.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cxx11-tests.patch" Content-length: 2870 commit 5c3e6d14bf4e559758b098b39e364f1baec00957 Author: Jason Merrill Date: Fri May 8 16:29:58 2015 -0500 gcc/testsuite/ * c-c++-common/asan/memcmp-1.c: Fix narrowing. * c-c++-common/asan/no-asan-stack.c: Fix narrowing. * c-c++-common/torture/vector-shift1.c: Fix narrowing. * c-c++-common/torture/vshuf-2.inc: Fix narrowing. * g++.dg/torture/pr33572.C: Compile with -std=c++98. diff --git a/gcc/testsuite/c-c++-common/asan/memcmp-1.c b/gcc/testsuite/c-c++-common/asan/memcmp-1.c index c582e3d..21033f7 100644 --- a/gcc/testsuite/c-c++-common/asan/memcmp-1.c +++ b/gcc/testsuite/c-c++-common/asan/memcmp-1.c @@ -9,8 +9,8 @@ volatile int one = 1; int main () { - char a1[] = {one, 2, 3, 4}; - char a2[] = {1, 2*one, 3, 4}; + char a1[] = {(char)one, 2, 3, 4}; + char a2[] = {1, (char)(2*one), 3, 4}; int res = memcmp (a1, a2, 5 + one); return res; } diff --git a/gcc/testsuite/c-c++-common/asan/no-asan-stack.c b/gcc/testsuite/c-c++-common/asan/no-asan-stack.c index 0f65ab3..59ae55b 100644 --- a/gcc/testsuite/c-c++-common/asan/no-asan-stack.c +++ b/gcc/testsuite/c-c++-common/asan/no-asan-stack.c @@ -7,8 +7,8 @@ volatile int one = 1; int main () { - volatile char a1[] = {one, 2, 3, 4}; - volatile char a2[] = {1, 2*one, 3, 4}; + volatile char a1[] = {(char)one, 2, 3, 4}; + volatile char a2[] = {1, (char)(2*one), 3, 4}; volatile int res = memcmp ((void *)a1,(void *)a2, 5 + one); return 0; } diff --git a/gcc/testsuite/c-c++-common/torture/vector-shift1.c b/gcc/testsuite/c-c++-common/torture/vector-shift1.c index e6e31da..c80d7cc 100644 --- a/gcc/testsuite/c-c++-common/torture/vector-shift1.c +++ b/gcc/testsuite/c-c++-common/torture/vector-shift1.c @@ -2,7 +2,7 @@ #define vector __attribute__((vector_size(8*sizeof(short)))) int main (int argc, char *argv[]) { - vector short v0 = {argc,2,3,4,5,6,7}; + vector short v0 = {(short)argc,2,3,4,5,6,7}; vector short v1 = {2,2,2,2,2,2,2}; vector short r1,r2,r3,r4; int i = 8; diff --git a/gcc/testsuite/c-c++-common/torture/vshuf-2.inc b/gcc/testsuite/c-c++-common/torture/vshuf-2.inc index ef778e5..bc21794 100644 --- a/gcc/testsuite/c-c++-common/torture/vshuf-2.inc +++ b/gcc/testsuite/c-c++-common/torture/vshuf-2.inc @@ -11,7 +11,7 @@ struct S struct S tests[] = { { { A, B }, { 0, 1 }, { A, B } }, - { { A, B }, { -16, -1 }, { A, B } }, + { { A, B }, { -16U, -1U }, { A, B } }, { { A, B }, { 1, 0 }, { B, A } }, { { A, B }, { 0, 0 }, { A, A } }, { { X, Y }, { 1, 1 }, { Y, Y } }, diff --git a/gcc/testsuite/g++.dg/torture/pr33572.C b/gcc/testsuite/g++.dg/torture/pr33572.C index 91cd073..b4db2ac 100644 --- a/gcc/testsuite/g++.dg/torture/pr33572.C +++ b/gcc/testsuite/g++.dg/torture/pr33572.C @@ -1,4 +1,6 @@ // { dg-do run } +// { dg-options "-std=c++98" } + #include #include --------------040303020102000804030901--