Commit Graph

278 Commits

Author SHA1 Message Date
Dodji Seketeli 7ecc3eb9e6 PR preprocessor/58580 - preprocessor goes OOM with warning for zero literals
In this problem report, the compiler is fed a (bogus) translation unit
in which some literals contain bytes whose value is zero.  The
preprocessor detects that and proceeds to emit diagnostics for that
king of bogus literals.  But then when the diagnostics machinery
re-reads the input file again to display the bogus literals with a
caret, it attempts to calculate the length of each of the lines it got
using fgets.  The line length calculation is done using strlen.  But
that doesn't work well when the content of the line can have several
zero bytes.  The result is that the read_line never sees the end of
the line because strlen repeatedly reports that the line ends before
the end-of-line character; so read_line thinks its buffer for reading
the line is too small; it thus increases the buffer, leading to a huge
memory consumption and disaster.

Here is what this patch does.

location_get_source_line is modified to return the length of a source
line that can now contain bytes with zero value.
diagnostic_show_locus() is then modified to consider that a line can
have characters of value zero, and so just shows a white space when
instructed to display one of these characters.

Additionally location_get_source_line is modified to avoid re-reading
each and every line from the beginning of the file until it reaches
the line number N that it is instructed to get; this was leading to
annoying quadratic behaviour when reading adjacent lines near the end
of (big) files.  So a cache is now associated to the file opened in
text mode.  When the content of the file is read, that content is
stashed in the file cache.  That file cache is searched for line
delimiters.  A number of line positions are saved in the cache and a
number of file caches are kept in memory.  That way when
location_get_source_line is asked to read line N + 1, it just has to
start reading from line N that it has already read.

libcpp/ChangeLog:

	* include/line-map.h (linemap_get_file_highest_location): Declare
	new function.
	* line-map.c (linemap_get_file_highest_location): Define it.

gcc/ChangeLog:

	* input.h (location_get_source_line): Take an additional line_size
	parameter.
	(void diagnostics_file_cache_fini): Declare new function.
	* input.c (struct fcache): New type.
	(fcache_tab_size, fcache_buffer_size, fcache_line_record_size):
	New static constants.
	(diagnostic_file_cache_init, total_lines_num)
	(lookup_file_in_cache_tab, evicted_cache_tab_entry)
	(add_file_to_cache_tab, lookup_or_add_file_to_cache_tab)
	(needs_read, needs_grow, maybe_grow, read_data, maybe_read_data)
	(get_next_line, read_next_line, goto_next_line, read_line_num):
	New static function definitions.
	(diagnostic_file_cache_fini): New function.
	(location_get_source_line): Take an additional output line_len
	parameter.  Re-write using lookup_or_add_file_to_cache_tab and
	read_line_num.
	* diagnostic.c (diagnostic_finish): Call
	diagnostic_file_cache_fini.
	(adjust_line): Take an additional input parameter for the length
	of the line, rather than calculating it with strlen.
	(diagnostic_show_locus): Adjust the use of
	location_get_source_line and adjust_line with respect to their new
	signature.  While displaying a line now, do not stop at the first
	null byte.  Rather, display the zero byte as a space and keep
	going until we reach the size of the line.
	* Makefile.in: Add vec.o to OBJS-libcommon

gcc/testsuite/ChangeLog:

	* c-c++-common/cpp/warning-zero-in-literals-1.c: New test file.

Signed-off-by: Dodji Seketeli <dodji@seketeli.org>

From-SVN: r206957
2014-01-23 10:13:08 +01:00
Richard Sandiford 23a5b65a92 Update copyright years in gcc/
From-SVN: r206289
2014-01-02 22:23:26 +00:00
Dodji Seketeli 7f4d640cd9 Revert "preprocessor/58580 - preprocessor goes OOM with warning for zero literals"
This reverts commit fc3eff8854861fcd70d33d26095b17fe456fae31.

From-SVN: r204490
2013-11-06 23:51:36 +01:00
Dodji Seketeli 9789a91276 preprocessor/58580 - preprocessor goes OOM with warning for zero literals
In this problem report, the compiler is fed a (bogus) translation unit
in which some literals contain bytes whose value is zero.  The
preprocessor detects that and proceeds to emit diagnostics for that
king of bogus literals.  But then when the diagnostics machinery
re-reads the input file again to display the bogus literals with a
caret, it attempts to calculate the length of each of the lines it got
using fgets.  The line length calculation is done using strlen.  But
that doesn't work well when the content of the line can have several
zero bytes.  The result is that the read_line never sees the end of
the line because strlen repeatedly reports that the line ends before
the end-of-line character; so read_line thinks its buffer for reading
the line is too small; it thus increases the buffer, leading to a huge
memory consumption, pain and disaster.

The patch below introduces a new get_line function that returns the
next line of a file and return the length of that line even if the
line contains zero bytes.  That get_line function has been adapted
from the getline function from the GNU C Library because getline being
a GNU extension it is not necessarily supported on all platforms.
read_line is then modified to return the length of the line along with
the line itself, as the line can now contain zero bytes.  Callers of
read_line are adjusted consequently.

diagnostic_show_locus() is modified to consider that a line can have
characters of value zero, and so just shows a white space when
instructed to display one of these characters.

gcc/ChangeLog:

	* input.h (location_get_source_line): Take an additional line_size
	parameter.
	* input.c (get_line): New static function definition.
	(read_line): Take an additional line_length output parameter to be
	set to the size of the line.  Use the new get_line function do the
	actual line reading.
	(location_get_source_line): Take an additional output line_len
	parameter.  Update the use of read_line to pass it the line_len
	parameter.
	* diagnostic.c (adjust_line): Take an additional input parameter
	for the length of the line, rather than calculating it with
	strlen.
	(diagnostic_show_locus): Adjust the use of
	location_get_source_line and adjust_line with respect to their new
	signature.  While displaying a line now, do not stop at the first
	null byte.  Rather, display the zero byte as a space and keep
	going until we reach the size of the line.

gcc/testsuite/ChangeLog:

	* c-c++-common/cpp/warning-zero-in-literals-1.c: New test file.

From-SVN: r204453
2013-11-06 12:33:52 +01:00
Richard Sandiford c328471880 alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
	* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
	bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
	cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
	cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
	combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
	cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
	df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
	dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
	errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
	fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
	gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
	genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
	genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
	genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
	gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
	gimple.h, godump.c, graphite-clast-to-gimple.c,
	graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
	graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
	hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
	ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
	ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
	ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
	loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
	lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
	mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
	pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
	predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
	profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
	regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
	reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
	sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
	statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
	system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
	tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
	tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
	tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
	tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
	tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
	tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
	tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
	tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
	tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
	tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
	tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
	tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
	tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
	tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
	tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
	tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
	tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
	tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
	varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
	whitespace before "(".

From-SVN: r203004
2013-09-28 08:42:34 +00:00
Paolo Carlini 97f1f314fe re PR c++/54941 (do not print line/column numbers for <built-in>:0:0)
2013-09-08  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/54941
	* diagnostic.c (diagnostic_build_prefix): When s.file is
	"<built-in>" don't output line and column numbers.

/testsuite
2013-09-08  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/54941
	* g++.dg/overload/new1.C: Adjust.

From-SVN: r202366
2013-09-08 14:30:27 +00:00
Gabriel Dos Reis 025311c4bb diagnostic.c (diagnostic_set_caret_max_width): Use pp_buffer.
* diagnostic.c (diagnostic_set_caret_max_width): Use pp_buffer.
	* gimple-pretty-print.c (gimple_dump_bb_buff): Likewise.
	* pretty-print.c (pp_formatted_text_data): Likewise.
	(pp_write_text_to_stream): Likewise.
	(pp_write_text_as_dot_label_to_stream): Likewise.
	(pp_append_r): Likewise.
	(pp_format): Likewise.
	(pp_flush): Likewise.
	(pp_clear_output_area): Likewise.
	(pp_append_text): Likewise.
	(pp_formatted_text): Likewise.
	(pp_remaining_character_count_for_line): Likewise.
	(pp_newline): Likewise.
	(pp_character): Likewise.
	(output_buffer::~output_buffer): Define.
	(pretty_printer::~pretty_printer): Destruct output buffer.
	* pretty-print.h (output_buffer::~output_buffer): Declare.
	(pretty_printer::~pretty_printer): Declare virtual.

c/
	* c-objc-common.c (c_tree_printer): Document the nature of the cast.
	(c_initialize_diagnostics): Call a destructor for the early printer.

cp/
	* cp-objcp-common.c (cxx_initialize_diagnostics): Call a
	destructor for the early printer.
	* error.c (type_to_string): Use pp_buffer.

From-SVN: r201956
2013-08-23 23:58:55 +00:00
Gabriel Dos Reis da6ca2b5ee pretty-print.h (output_buffer::output_buffer): Declare.
* pretty-print.h (output_buffer::output_buffer): Declare.
	(pretty_printer::pretty_printer): Likewise.
	(pp_construct): Remove.
	* pretty-print.c (output_buffer::output_buffer): Define.
	(pretty_printer::pretty_printer): Rename from pp_construct.  Simplify.
	* gimple-pretty-print.c (print_gimple_stmt): Do not call pp_construct.
	(print_gimple_expr): Likewise.
	(print_gimple_seq): Likewise.
	(gimple_dump_bb): Likewise.
	* sched-vis.c (dump_value_slim): Likewise.
	(dump_insn_slim): Likewise.
	(dump_rtl_slim): Likewise.
	(str_pattern_slim): Likewise.
	* tree-mudflap.c (mf_varname_tree): Likewise.
	* graph.c (print_graph_cfg): Likewise.
	(start_graph_dump): Likewise.
	* tree-pretty-print.c (maybe_init_pretty_print): Likewise.  Use
	placement-new.
	* diagnostic.c (diagnostic_initialize): Simplify early diagnostic
	pretty printer initialization.
	* coretypes.h (diagnostic_context): Remove superflous type alias
	declaration.
	(pretty_printer): Likewise.  Declare directly as a class.
	(pretty_print_info): Remove declaration as class.
	* asan.c (asan_emit_stack_protection): Remove call to pp_construct
	and pp_clear_output_area.
	(asan_add_global): Likewise.

c/
	* c-objc-common.c (c_initialize_diagnostics): Simplify C pretty
	printer initialization.

c-family/
	* c-pretty-print.h (pp_c_pretty_printer_init): Remove.
	(c_pretty_printer::c_pretty_printer): Declare.
	* c-pretty-print.c (pretty_printer::c_pretty_printer): Rename from
	c_pretty_printer_init.  Adjust.
	(print_c_tree): Do not call c_pretty_printer_init.
	* c-ada-spec.c (dump_ads): Remove call to pp_construct.

cp/
	* error.c (init_error): Remove calls to pp_construct and
	pp_cxx_pretty_printer_init.  Initialize cxx_pp with placement-new.
	* cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
	(cxx_pretty_printer_init): Remove.
	* cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
	Rename from cxx_pretty_printer_init.  Adjust.
	* cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
	initialization of C++ diagnostics pretty printer.

From-SVN: r201918
2013-08-22 10:14:46 +00:00
Eric Botcazou 3c8ca1abde diagnostic.c (diagnostic_classify_diagnostic): Accept zero index and document its semantics.
* diagnostic.c (diagnostic_classify_diagnostic): Accept zero index and
	document its semantics.
	(diagnostic_report_diagnostic): Adjust accordingly.

From-SVN: r201574
2013-08-07 17:15:25 +00:00
Gabriel Dos Reis 07838b1363 pretty-print.h (pp_underscore): New.
* pretty-print.h (pp_underscore): New.
	(pp_comma): Tidy.
	* gimple-pretty-print.c (dump_unary_rhs): Use specialized pretty
	printer functions instead of pp_character.
	(dump_binary_rhs): Likewise.
	(dump_ternary_rhs): Likewise.
	(dump_gimple_call_args): Likewise.
	(pp_points_to_solution): Likewise.
	(dump_gimple_call): Likewise.
	(dump_gimple_switch): Likewise.
	(dump_gimple_cond): Likewise.
	(dump_gimple_bind): Likewise.
	(dump_gimple_try): Likewise.
	(dump_gimple_omp_for): Likewise.
	(dump_gimple_omp_continue): Likewise.
	(dump_gimple_omp_single): Likewise.
	(dump_gimple_omp_sections): Likewise.
	(dump_gimple_omp_block): Likewise.
	(dump_gimple_omp_critical): Likewise.
	(dump_gimple_transaction): Likewise.
	(dump_gimple_asm): Likewise.
	(dump_gimple_phi): Likewise.
	(dump_gimple_omp_parallel): Likewise.
	(dump_gimple_omp_task): Likewise.
	(dump_gimple_omp_atomic_load): Likewise.
	(dump_gimple_omp_atomic_store): Likewise.
	(dump_gimple_mem_ops): Likewise.
	(pp_gimple_stmt_1): Likewise.
	(pp_cfg_jump): Likewise.
	(dump_implicit_edges): Likewise.
	(gimple_dump_bb_for_graph): Likewise.
	* graph.c (draw_cfg_node): Likewise.
	* langhooks.c (lhd_print_error_function): Likewise.
	* sched-vis.c (print_exp): Likewise.
	(print_value): Likewise.
	(print_pattern): Likewise.
	(print_insn): Likewise.
	(rtl_dump_bb_for_graph): Likewise.
	* tree-pretty-print.c (dump_function_declaration): Likewise.
	(dump_array_domain): Likewise.
	(dump_omp_clause): Likewise.
	(dump_location): Likewise.
	(dump_generic_node): Likewise.
	(print_struct_decl): Likewise.
	* diagnostic.c (diagnostic_show_locus): Use pp_space.

c-family/
	* c-ada-spec.c (print_ada_macros): Use specialized pretty printer
	functions instead of pp_character.
	(pp_ada_tree_identifier): Likewise.
	(dump_ada_double_name): Likewise.
	(dump_ada_function_declaration): Likewise.
	(dump_ada_array_domains): Likewise.
	(dump_template_types): Likewise.
	(dump_generic_ada_node): Likewise.
	(print_ada_declaration): Likewise.
	(print_ada_struct_decl): Likewise.
	* c-pretty-print.c (pp_c_integer_constant): Likewise.

cp/
	* error.c (dump_aggr_type): Use specialized pretty printer
	functions instead of pp_character.
	(dump_type_prefix): Likewise.
	(dump_simple_decl): Likewise.
	(type_to_string): Likewise.

From-SVN: r201467
2013-08-03 18:57:25 +00:00
Jakub Jelinek 2e55d06281 tree.c (warn_deprecated_use): Print file:line using locus color.
* tree.c (warn_deprecated_use): Print file:line using locus color.
	* diagnostic.c (diagnostic_report_current_module): Print file:line
	and file:line:column using locus color.

From-SVN: r198900
2013-05-14 21:41:13 +02:00
Jakub Jelinek e78e8a0b19 diagnostic.h (file_name_as_prefix): Add context argument.
* diagnostic.h (file_name_as_prefix): Add context argument.
	* diagnostic.c (file_name_as_prefix): Likewise.  Colorize
	the string as locus.
	* langhooks.c (lhd_print_error_function): Adjust caller.
cp/
	* error.c (cp_print_error_function): Adjust file_name_as_prefix
	caller.

From-SVN: r198331
2013-04-26 08:54:54 +02:00
Jakub Jelinek 4b84d650e8 opts.c: Include diagnostic-color.h.
* opts.c: Include diagnostic-color.h.
	(common_handle_option): Handle OPT_fdiagnostics_color_.
	* Makefile.in (OBJS-libcommon): Add diagnostic-color.o.
	(diagnostic.o, opts.o, pretty-print.o): Depend on diagnostic-color.h.
	(diagnostic-color.o): New.
	* common.opt (fdiagnostics-color, fdiagnostics-color=): New options.
	(diagnostic_color_rule): New enum.
	* dwarf2out.c (gen_producer_string): Don't print -fdiagnostics-color*.
	* langhooks.c (lhd_print_error_function): Add %r "locus" and %R around
	the location string.
	* diagnostic.def: Add 3rd argument to DEFINE_DIAGNOSTIC_KIND macros,
	either NULL, or color kind.
	* diagnostic-color.c: New file.
	* diagnostic-color.h: New file.
	* diagnostic-core.h (DEFINE_DIAGNOSTIC_KIND): Adjust macro for 3
	arguments.
	* doc/invoke.texi (-fdiagnostics-color): Document.
	* pretty-print.h (pp_show_color): Define.
	(struct pretty_print_info): Add show_color field.
	* diagnostic.c: Include diagnostic-color.h.
	(diagnostic_build_prefix): Adjust for 3 argument DEFINE_DIAGNOSTIC_KIND
	macros.  Colorize error:, warning: etc. strings and also the location
	string.
	(diagnostic_show_locus): Colorize the caret line.
	* pretty-print.c: Include diagnostic-color.h.
	(pp_base_format): Handle %r and %R format specifiers.  Colorize strings
	inside of %< %> quotes or quoted through q format modifier.
c-family/
	* c-format.c (gcc_diag_char_table, gcc_tdiag_char_table,
	gcc_cdiag_char_table, gcc_cxxdiag_char_table): Add %r and %R format
	specifiers.
cp/
	* error.c (cp_print_error_function,
	print_instantiation_partial_context_line,
	maybe_print_constexpr_context): Colorize locus strings.

From-SVN: r197841
2013-04-12 08:19:58 +02:00
Jakub Jelinek 37e9911604 re PR middle-end/48087 (-Wall -Werror adds warnings over and above those generated by -Wall)
PR middle-end/48087
	* diagnostic.def (DK_WERROR): New kind.
	* diagnostic.h (werrorcount): Define.
	* diagnostic.c (diagnostic_report_diagnostic): For DK_WARNING
	promoted to DK_ERROR, increment DK_WERROR counter instead of
	DK_ERROR counter.
	* toplev.c (toplev_main): Call print_ignored_options even if
	just werrorcount is non-zero.  Exit with FATAL_EXIT_CODE
	even if just werrorcount is non-zero.

	* pt.c (convert_nontype_argument): Count werrorcount as warnings.
	* call.c (build_temp): Likewise.
	* method.c (synthesize_method): Likewise.
	* typeck.c (convert_for_initialization): Likewise.

From-SVN: r196887
2013-03-21 18:36:47 +01:00
Jakub Jelinek 4432aa6c81 re PR middle-end/56461 (GCC is leaking lots of memory)
PR middle-end/56461
	* diagnostic.c (diagnostic_append_note): Save and restore old prefix.

From-SVN: r196445
2013-03-04 22:52:08 +01:00
Richard Sandiford d1e082c2c2 Update copyright years in gcc/
From-SVN: r195098
2013-01-10 20:38:27 +00:00
Tobias Burnus 3b4adfb357 diagnostic.c (diagnostic_append_note): Also call va_end when inhibit_notes_p is true.
2012-11-12  Tobias Burnus  <burnus@net-b.de>

        * diagnostic.c (diagnostic_append_note): Also call va_end when
        inhibit_notes_p is true.

From-SVN: r193428
2012-11-12 12:00:58 +01:00
Manuel López-Ibáñez dfa3226153 re PR c++/54928 (Infinite output with after ICE with macro)
2012-10-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c++/54928
	* tree-diagnostic.c (maybe_unwind_expanded_macro_loc):
	Use diagnostic_append_note.
	* diagnostic.c (diagnostic_build_prefix): Make diagnostic const.
	(default_diagnostic_finalizer): Do not destroy prefix here.
	(diagnostic_report_diagnostic): Destroy it here.
	(diagnostic_append_note): New.
	* diagnostic.h (diagnostic_append_note): Declare.

From-SVN: r192786
2012-10-24 22:01:50 +00:00
Ian Lance Taylor a67a73fd0c * diagnostic.c (bt_callback): Cast pc when calling fprintf.
From-SVN: r191766
2012-09-26 17:49:38 +00:00
Ian Lance Taylor d83697f4f0 Makefile.def: Make all-gcc depend on all-libbacktrace.
./:	* Makefile.def: Make all-gcc depend on all-libbacktrace.
	* Makefile.in: Rebuild.
gcc/:
	* diagnostic.c: Include "demangle.h" and "backtrace.h".
	(bt_stop): New static array.
	(bt_callback, bt_err_callback): New static functions.
	(diagnostic_action_after_output): Call backtrace_full for DK_ICE.
	* Makefile.in (BACKTRACE): New variable.
	(BACKTRACEINC, LIBBACKTRACE): New variables.
	(BACKTRACE_H): New variable.
	(LIBDEPS, LIBS): Add $(LIBBACKTRACE).
	(INCLUDES): Add $(BACKTRACEINC).
	(diagnostic.o): Depend upon $(DEMANGLE_H) and $(BACKTRACE_H).

From-SVN: r191757
2012-09-26 12:38:08 +00:00
Steven Bosscher f8923f7ead cfg.c (debug_bb): Do not set TDF_BLOCKS.
gcc/
	* cfg.c (debug_bb): Do not set TDF_BLOCKS.
	* cfghooks.c (dump_bb): Honor ~TDF_BLOCKS.
	* pretty-print.c (pp_base_flush): Do not add a newline, and do not
	clear pp_needs_newline.
	* pretty-print.h (pp_newline_and_flush): New macro with the behavior
	of pp_base_flush before the above change.
	* langhooks.c (lhd_print_error_function): Use pp_newline_and_flush
	instead of pp_flush.
	* diagnostic.c (diagnostic_finish): Likewise.
	(diagnostic_report_diagnostic): Likewise.
	(verbatim): Likewise.
	(error_recursion): Likewise.
	* tree-pretty-print.c (print_generic_stmt): Likewise.
	(print_generic_stmt_indented): LIkewise.
	* gimple-pretty-print.c (print_gimple_stmt): Likewise.
	(print_gimple_seq): Likewise.
	(gimple_dump_bb_buff): Likewise.

c-family/
	* c-pretty-print.c (pp_c_function_definition): Use pp_newline_and_flush
	instead of separate pp_newline and pp_flush.
	(print_c_tree): Likewise.

cp/
	* error.c (print_instantiation_context): Pretty-print a newline before
	diagnostic_flush_buffer.
	* cxx-pretty-print.c (pp_cxx_function_definition): Use
	pp_newline_and_flush instead of separate pp_newline and pp_flush.

testsuite/
	* gcc.dg/tree-prof/update-loopch.c: Ask for dump with blocks info.
	* gcc.dg/tree-ssa/attr-hotcold-2.c: Likewise.
	* gcc.dg/tree-ssa/pr18133-1.c: Likewise.

From-SVN: r190215
2012-08-07 22:14:29 +00:00
Manuel López-Ibáñez 1b8b126f38 re PR c++/53289 (unnecessary repetition of caret diagnostics)
2012-05-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c++/53289
gcc/
	* diagnostic.h (diagnostic_context): Add last_location.
	* diagnostic.c (diagnostic_initialize): Initialize it.
	(diagnostic_show_locus): Use it.

From-SVN: r187355
2012-05-09 21:14:15 +00:00
Manuel López-Ibáñez 0c3641b0ea flags.h (flag_permissive): Do not declare.
2012-05-03  Manuel López-Ibáñez  <manu@gcc.gnu.org>

gcc/
	* flags.h (flag_permissive): Do not declare.
	* diagnostic.c (diagnostic_report_diagnostic): Handle fpermissive
	option specially.
	* toplev.c (flag_permissive): Do not define.
	* c-tree.h (system_header_p): Delete unused.
c-family/
	* c.opt (fpermissive): Add Var(flag_permissive).

From-SVN: r187123
2012-05-03 22:28:21 +00:00
Dodji Seketeli 7eb918cc4e Make expand_location resolve to locus in main source file
Apparently, quite some places in the compiler (like the C/C++
preprocessor, the debug info machinery) expect expand_location to
resolve to locations that are in the main source file, even if the
token at stake comes from a macro that was defined in a header
somewhere.  Turning on -ftrack-macro-expansion by default was
triggering a lot of failures (not necessarily related to diagnostics)
because expand_location resolves to spelling locations instead.

So I have changed expand_location to honour the initial expectation.

In addition, I came up with the new expand_location_to_spelling_point
used in diagnostic_build_prefix because the diagnostic system, on the
other hand, wants to point to the location of the token where it was
spelled, and then display the error context involving all the macro
whose expansion led to that spelling point - if we are in the context
of a macro expansion there.

This seems to me like a reasonable balance.

Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk and
whitnessed that a lot more tests were PASSing.

Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches.  This patch
just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

gcc/

	* input.c (expand_location_1): New.  Takes a parameter to choose
	whether to resolve the location to spelling or expansion point.
	Was factorized from ...
	(expand_location): ... here.
	(expand_location_to_spelling_point): New.  Implemented in terms of
	expand_location_1.
	* diagnostic.c (diagnostic_build_prefix): Use the new
	expand_location_to_spelling_point instead of expand_location.

From-SVN: r186969
2012-04-30 13:42:00 +02:00
Manuel López-Ibáñez c1771a200a re PR c/44774 (-Werror=edantic)
2012-04-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c/44774
gcc/
	* doc/invoke.texi (pedantic): Rename to Wpedantic.
	* common.opt (Wpedantic): New.
	(pedantic): Alias Wpedantic.
	* diagnostic.c (warning_at): Likewise.
	* c-decl.c (diagnose_mismatched_decls): Likewise.
	(build_array_declarator): Likewise.
	(mark_forward_parm_decls):
	(check_bitfield_type_and_width): Likewise.
	(grokdeclarator): Likewise.
	(grokfield): Likewise.
	(finish_struct): Likewise.
	(build_enumerator): Likewise.
	(store_parm_decls_oldstyle): Likewise.
	(declspecs_add_qual): Likewise.
	(declspecs_add_type): Likewise.
	(finish_declspecs): Likewise.
	* c-typeck.c (composite_type): Likewise.
	(comp_target_types): Likewise.
	(build_array_ref): Likewise.
	(pointer_diff): Likewise.
	(build_unary_op): Likewise.
	(build_conditional_expr): Likewise.
	(build_c_cast): Likewise.
	(convert_for_assignment): Likewise.
	(maybe_warn_string_init): Likewise.
	(digest_init): Likewise.
	(pop_init_level): Likewise.
	(set_init_index): Likewise.
	(c_finish_goto_label): Likewise.
	(c_finish_return): Likewise.
	(do_case): Likewise.
	(build_binary_op): Likewise.
	* c-parser.c (static): Likewise.
	(c_parser_external_declaration): Likewise.
	(c_parser_declaration_or_fndef): Likewise.
	(c_parser_static_assert_declaration_no_se): Likewise.
	(c_parser_enum_specifier): Likewise.
	(c_parser_struct_or_union_specifier): Likewise.
	(c_parser_struct_declaration): Likewise.
	(c_parser_alignas_specifier): Likewise.
	(c_parser_braced_init): Likewise.
	(c_parser_initelt): Likewise.
	(c_parser_compound_statement_nostart): Likewise.
	(c_parser_conditional_expression): Likewise.
	(c_parser_alignof_expression): Likewise.
	(c_parser_postfix_expression): Likewise.
	(c_parser_postfix_expression_after_paren_): Likewise.
	(c_parser_objc_class_instance_variables): Likewise.
	(c_parser_objc_method_definition): Likewise.
	(c_parser_objc_methodprotolist): Likewise.

c-family/
	* c.opt (Wpedantic): New.
	(pedantic): Alias Wpedantic.
	* c-opts.c (c_common_handle_option): Replace -pedantic with -Wpedantic.
	(c_common_post_options): Likewise.
	(sanitize_cpp_opts): Likewise.
	* c-lex.c (interpret_float): Likewise.
	* c-format.c (check_format_types): Likewise.
	* c-common.c (pointer_int_sum): Likewise.
	(c_sizeof_or_alignof_type): Likewise.
	(c_add_case_label): Likewise.
	(c_do_switch_warnings): Likewise.
	* c-pragma.c (handle_pragma_float_const_decimal64): Likewise.
cp/
	* typeck.c (composite_pointer_type): Likewise.
	(cxx_sizeof_or_alignof_type): Likewise.
	(cp_build_array_ref): Likewise.
	(cp_build_function_call_vec): Likewise.
	(cp_build_addr_expr_1): Likewise.
	(convert_member_func_to_ptr): Likewise.
	* decl.c (check_tag_decl): Likewise.
	(check_static_variable_definition): Likewise.
	(compute_array_index_type): Likewise.
	(create_array_type_for_decl): Likewise.
	(grokdeclarator): Likewise.
	(grok_op_properties): Likewise.
	* error.c (maybe_warn_cpp0x): Likewise.
	* pt.c (maybe_process_partial_specialization): Likewise.
	(convert_template_argument): Likewise.
	(do_decl_instantiation): Likewise.
	(do_type_instantiation): Likewise.
	* parser.c (cp_parser_primary_expression): Likewise.
	(cp_parser_postfix_expression): Likewise.
	(cp_parser_unary_expression): Likewise.
	(cp_parser_question_colon_clause): Likewise.
	(cp_parser_lambda_introducer): Likewise.
	(cp_parser_lambda_declarator_opt): Likewise.
	(cp_parser_compound_statement): Likewise.
	(cp_parser_jump_statement): Likewise.
	(cp_parser_declaration_seq_opt): Likewise.
	(cp_parser_enum_specifier): Likewise.
	(cp_parser_enumerator_list): Likewise.
	(cp_parser_initializer_list): Likewise.
	(cp_parser_member_declaration): Likewise.
	* call.c (build_conditional_expr_1): Likewise.
	* friend.c (make_friend_class): Likewise.
	* name-lookup.c (pushdecl_maybe_friend_1): Likewise.

From-SVN: r186681
2012-04-22 19:17:47 +00:00
Michael Matz 80f2435130 diagnostic.c (emit_diagnostic): Move va_end call after user of the va_list.
* diagnostic.c (emit_diagnostic): Move va_end call after user
	of the va_list.
	(warning, warning_at, pedwarn, permerror): Ditto.

From-SVN: r186591
2012-04-19 12:51:25 +00:00
Manuel López-Ibáñez 9fec00429d re PR c++/24985 (caret diagnostics)
2012-04-11  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR 24985
gcc/
        * diagnostic.h (show_caret): Declare.
	(caret_max_width): Declare.
	(diagnostic_show_locus): Declare.
        * diagnostic.c (diagnostic_initialize): Initialize to false.
        (diagnostic_show_locus): New.
        (diagnostic_report_diagnostic): Call it.
	(getenv_columns): New.
	(adjust_line): New.
	(diagnostic_set_caret_max_width): New.
        * input.c (read_line): New.
	(location_get_source_line): New.
        * input.h (location_get_source_line): Declare.
        * toplev.c (general_init): Initialize show_caret from options.
        * dwarf2out.c (gen_producer_string): Handle fdiagnostics-show-caret.
        * opts.c (common_handle_option): Likewise.
	* pretty-print.h (pp_get_prefix): New.
	(pp_base_get_prefix): New.
        * common.opt (fdiagnostics-show-caret): New option.
	* doc/invoke.texi (fdiagnostics-show-caret): Document it.
testsuite/
        * lib/prune.exp: Add -fno-diagnostics-show-caret.
libstdc++-v3/
	* testsuite/lib/prune.exp: Handle caret.
libmudflap/
	* testsuite/lib/libmudflap.exp: Handle caret.

From-SVN: r186305
2012-04-11 09:26:48 +00:00
Jakub Jelinek 1f01c3ecd1 re PR middle-end/48071 (Blank line after 'all warnings being treated as errors')
PR middle-end/48071
	* diagnostic.c (diagnostic_finish): Remove trailing newlines.

From-SVN: r183847
2012-02-02 21:46:06 +01:00
Tom Tromey 07a0b324eb Emit macro expansion related diagnostics
In this third instalment the diagnostic machinery -- when faced with
the virtual location of a token resulting from macro expansion -- uses
the new linemap APIs to unwind the stack of macro expansions that led
to that token and emits a [hopefully] more useful message than what we
have today.

diagnostic_report_current_module has been slightly changed to use the
location given by client code instead of the global input_location
variable.  This results in more precise diagnostic locations in
general but then the patch adjusts some C++ tests which output changed
as a result of this.

Three new regression tests have been added.

The mandatory screenshot goes like this:

[dodji@adjoa gcc]$ cat -n test.c
     1    #define OPERATE(OPRD1, OPRT, OPRD2) \
     2      OPRD1 OPRT OPRD2;
     3
     4    #define SHIFTL(A,B) \
     5      OPERATE (A,<<,B)
     6
     7    #define MULT(A) \
     8      SHIFTL (A,1)
     9
    10    void
    11    g ()
    12    {
    13      MULT (1.0);/* 1.0 << 1; <-- so this is an error.  */
    14    }

[dodji@adjoa gcc]$ ./cc1 -quiet -ftrack-macro-expansion test.c
test.c: In function 'g':
test.c:5:14: erreur: invalid operands to binary << (have 'double' and 'int')
test.c:2:9: note: in expansion of macro 'OPERATE'
test.c:5:3: note: expanded from here
test.c:5:14: note: in expansion of macro 'SHIFTL'
test.c:8:3: note: expanded from here
test.c:8:3: note: in expansion of macro 'MULT2'
test.c:13:3: note: expanded from here

Co-Authored-By: Dodji Seketeli <dodji@redhat.com>

From-SVN: r180083
2011-10-17 11:59:27 +02:00
Tom Tromey 46427374e1 Linemap infrastructure for virtual locations
This is the first instalment of a set which goal is to track locations
of tokens across macro expansions.  Tom Tromey did the original work
and attached the patch to PR preprocessor/7263.  This opus is a
derivative of that original work.

This patch modifies the linemap module of libcpp to add virtual
locations support.

A virtual location is a mapped location that can resolve to several
different physical locations.  It can always resolve to the spelling
location of a token.  For tokens resulting from macro expansion it can
resolve to:
  - either the location of the expansion point of the macro.
  - or the location of the token in the definition of the
  macro
  - or, if the token is an argument of a function-like macro,
  the location of the use of the matching macro parameter in
  the definition of the macro

The patch creates a new type of line map called a macro map.  For every
single macro expansion, there is a macro map that generates a virtual
location for every single resulting token of the expansion.

The good old type of line map we all know is now called an ordinary
map.  That one still encodes spelling locations as it has always had.

As a result linemap_lookup as been extended to return a macro map when
given a virtual location resulting from a macro expansion.  The layout
of structs line_map has changed to support this new type of map.  So
did the layout of struct line_maps.  Accessor macros have been
introduced to avoid messing with the implementation details of these
datastructures directly.  This helped already as we have been testing
different ways of arranging these datastructure.  Having to constantly
adjust client code that is too tied with the internals of line_map and
line_maps would have been even more painful.

Of course, many new public functions have been added to the linemap
module to handle the resolution of virtual locations.

This patch introduces the infrastructure but no part of the compiler
uses virtual locations yet.

However the client code of the linemap data structures has been
adjusted as per the changes.  E.g, it's not anymore reliable for a
client code to manipulate struct line_map directly if it just wants to
deal with spelling locations, because struct line_map can now
represent a macro map as well.  In that case, it's better to use the
convenient API to resolve the initial (possibly virtual) location to a
spelling location (or to an ordinary map) and use that.

This is the reason why the patch adjusts the Java, Ada and Fortran
front ends.

Also, note that virtual locations are not supposed to be ordered for
relations '<' and '>' anymore.  To test if a virtual location appears
"before" another one, one has to use a new operator exposed by the
line map interface.  The patch updates the only spot (in the
diagnostics module) I have found that was making the assumption that
locations were ordered for these relations.  This is the only change
that introduces a use of the new line map API in this patch, so I am
adding a regression test for it only.

From-SVN: r180081
2011-10-17 11:58:56 +02:00
Nathan Froyd 3a789837f5 re PR c/44782 (implement -ferror-limit=)
gcc/
	PR c/44782
	* common.opt (fmax-errors=): New option.
	* opts.c (common_handle_option) [OPT_fmax_errors_]: Handle it.
	* diagnostic.h (struct diagnostic_context): Add max_errors field.
	* diagnostic.c (diagnostic_initialize): Initialize it.
	(diagnostic_action_after_output): Exit if more than max_errors
	have been output.
	* doc/invoke.texi (Warning Options): Add -fmax-errors.
	(-fmax-errors): Document.

gcc/fortran/
	PR c/44782
	* options.c (gfc_post_options): Initialize gfc_option.max_errors.
	(gfc_handle_option) [OPT_fmax_errors_]: Remove.
	* lang.opt (fmax-errors=): Remove.

gcc/testsuite/
	PR c/44782
	* c-c++-common/fmax-errors.c: New test.

From-SVN: r166644
2010-11-12 03:38:15 +00:00
Joseph Myers 46625112d2 opt-functions.awk (static_var): Update comment.
* opt-functions.awk (static_var): Update comment.
	(var_ref): Return offsetof expression or -1, not variable address.
	* optc-gen.awk: Generate structure field initializers instead of
	static variables.  Expect -1 for missing variables instead of null
	pointer.  Add gcc_options parameters to generated functions.
	* opth-gen.awk: Generate structure fields for static variables.
	Add gcc_options parameters to generated functions.
	* common.opt (optimize, optimize_size): Add variables.
	* config/i386/i386-c.c (ix86_pragma_target_parse): Pass
	&global_options to cl_target_option_restore.
	* config/i386/i386.c (ix86_valid_target_attribute_p): Pass
	&global_options to cl_optimization_restore, cl_target_option_save
	and cl_target_option_restore.
	(ix86_set_current_function): Pass &global_options to
	cl_target_option_restore.
	* config/pdp11/pdp11.h (optimize): Remove.
	* config/rs6000/rs6000.h (optimize): Remove.
	* config/sh/sh.h (optimize): Remove.
	* config/xtensa/xtensa.h (optimize): Remove.
	* coretypes.h (struct gcc_options): Declare.
	* diagnostic.c (diagnostic_initialize): Initialize
	context->option_state.
	(diagnostic_report_diagnostic): Pass option_state to
	option_enabled hook.
	* diagnostic.h (diagnostic_context.option_enabled): Add void *
	parameter.
	(diagnostic_context.option_state): New field.
	* final.c (final_start_function, final, final_scan_insn): Rename
	optimize parameter to optimize_p.
	* flags.h (optimize, optimize_size): Remove.
	* function.c (invoke_set_current_function_hook): Pass
	&global_options to cl_optimization_restore.
	* gcc.c (driver_handle_option): Take gcc_options parameter.
	Assert that it is &global_options.
	(process_command): Pass &global_options to read_cmdline_option.
	* ipa-pure-const.c (suggest_attribute): Pass &global_options to
	option_enabled.
	* lto-opts.c (lto_reissue_options): Use option_flag_var.  Pass
	&global_options to set_option.
	* opts-common.c (handle_option, handle_generated_option,
	read_cmdline_option, set_option): Take explicit gcc_options
	parameters.  Use option_flag_var.
	(option_flag_var): New.
	* opts.c (common_handle_option, lang_handle_option,
	target_handle_option): Take gcc_options parameter.  Assert that it
	is &global_options.
	(read_cmdline_options): Pass &global_options to
	read_cmdline_option.
	(print_filtered_help): Use option_flag_var.  Pass &global_options
	to option_enabled.
	(common_handle_option): Use option_flag_var.
	(option_enabled): Take opts parameter.  Use option_flag_var.
	(get_option_state): Take gcc_options parameter.  Use
	option_flag_var.  Pass gcc_options parameter to option_enabled.
	(enable_warning_as_error): Pass &global_options to
	handle_generated_option.
	* opts.h (struct cl_option): Change flag_var to flag_var_offset.
	(cl_option_handler_func.handler): Take gcc_options parameter.
	(option_enabled, get_option_state, set_option, handle_option,
	handle_generated_option, read_cmdline_option): Take gcc_options
	parameters.
	* toplev.c (optimize, optimize_size): Remove.
	(print_switch_values): Pass &global_options to option_enabled.
	(option_affects_pch_p): Use option_flag_var.  Pass &global_options
	to get_option_state.
	(general_init): Initialize global_dc->option_state.
	* tree.c (build_optimization_node): Pass &global_options to
	cl_optimization_save.
	(build_target_option_node): Pass &global_options to
	cl_target_option_save.

c-family:
	* c-common.c (handle_optimize_attribute): Pass &global_options to
	cl_optimization_save and cl_optimization_restore.
	* c-opts.c (c_common_handle_option): Pass &global_options to
	handle_generated_option.
	* c-pragma.c (handle_pragma_diagnostic): Use option_flag_var.
	(handle_pragma_pop_options, handle_pragma_reset_options): Pass
	&global_options to cl_optimization_restore.

From-SVN: r164751
2010-09-30 14:53:12 +01:00
Joseph Myers e3339d0f33 optc-gen.awk: Generate global_options initializer instead of individual variables.
gcc:
	* optc-gen.awk: Generate global_options initializer instead of
	individual variables.  Add x_ prefix to names of structure
	members.
	* opth-gen.awk: Generate gcc_options structure.  Add x_ prefix to
	names of structure members.
	* doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Document.
	* doc/tm.texi: Regenerate.
	* alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.
	* c-parser.c (disable_extension_diagnostics,
	restore_extension_diagnostics): Update names of cpp_options
	members.
	* combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* common.opt (fcompare-debug-second): Don't use Var.
	* config/alpha/alpha.h (target_flags): Remove.
	* config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
	* config/bfin/bfin.h (target_flags): Remove.
	* config/cris/cris.h (target_flags): Remove.
	* config/i386/i386-c.c (ix86_pragma_target_parse): Update names of
	cl_target_option members.
	* config/i386/i386.c (ix86_force_align_arg_pointer): Remove.
	(ix86_function_specific_print, ix86_valid_target_attribute_tree,
	ix86_can_inline_p): Update names of cl_target_option members.
	* config/i386/i386.h (ix86_isa_flags): Remove.
	* config/lm32/lm32.h (target_flags): Remove.
	* config/mcore/mcore.h (mcore_stack_increment): Remove.
	* config/mcore/mcore.md (addsi3): Remove extern declaration of
	flag_omit_frame_pointer.
	* config/mep/mep.h (target_flags): Remove.
	* config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Define.
	* config/mmix/mmix.h (target_flags): Remove.
	* config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic,
	flag_expensive_optimizations): Remove.
	* config/s390/s390.h (flag_pic): Remove.
	* config/score/score-conv.h (target_flags): Remove.
	* config/sh/sh.h (sh_fixed_range_str): Remove.
	* config/spu/spu.h (target_flags, spu_fixed_range_string): Remove.
	* dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
	* df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* diagnostic.c (diagnostic_initialize): Update names of
	diagnostic_context members.
	* diagnostic.h (diagnostic_context): Rename inhibit_warnings and
	warn_system_headers.
	(diagnostic_report_warnings_p): Update for new names.
	* dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER
	* emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and
	HARD_FRAME_POINTER_IS_ARG_POINTER.
	* flags.h (flag_compare_debug): Declare.
	* ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* opts.c (flag_compare_debug): Define.
	(common_handle_option): Update names of diagnostic_context
	members.  Handle -fcompare-debug-second.
	(fast_math_flags_struct_set_p): Update names of cl_optimization
	members.
	* reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER.
	* rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER,
	HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use.
	* sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER
	* stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER.

gcc/c-family:
	* c-common.c (c_cpp_error): Update names of diagnostic_context
	members.
	* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of
	cl_optimization members.
	* c-opts.c (warning_as_error_callback, c_common_handle_option,
	sanitize_cpp_opts, finish_options): Update names of cpp_options
	members.

gcc/fortran:
	* cpp.c (cpp_define_builtins): Update names of gfc_option_t
	members.
	(gfc_cpp_post_options): Update names of cpp_options members.
	(cb_cpp_error): Update names of diagnostic_context members.
	* f95-lang.c (gfc_init_builtin_functions): Update names of
	gfc_option_t members.
	* gfortran.h (gfc_option_t): Rename warn_conversion and
	flag_openmp.
	* intrinsic.c (gfc_convert_type_warn): Update names of
	gfc_option_t members.
	* options.c (gfc_init_options, gfc_post_options, set_Wall,
	gfc_handle_option): Update names of gfc_option_t members.
	* parse.c (next_free, next_fixed): Update names of gfc_option_t
	members.
	* scanner.c (pedantic): Remove extern declaration.
	(skip_free_comments, skip_fixed_comments, include_line): Update
	names of gfc_option_t members.
	* trans-decl.c (gfc_generate_function_code): Update names of
	gfc_option_t members.

gcc/java:
	* java-tree.h (flag_filelist_file, flag_assert, flag_jni,
	flag_force_classes_archive_check, flag_redundant, flag_newer,
	flag_use_divide_subroutine, flag_use_atomic_builtins,
	flag_use_boehm_gc, flag_hash_synchronization,
	flag_check_references, flag_optimize_sci, flag_indirect_classes,
	flag_indirect_dispatch, flag_store_check,
	flag_reduced_reflection): Remove.
	* jcf-dump.c (flag_newer): Remove.
	* jcf.h (quiet_flag): Remove.
	* parse.h (quiet_flag): Remove.

libcpp:
	* include/cpplib.h (cpp_options): Rename warn_deprecated,
	warn_traditional, warn_long_long and pedantic.
	* directives.c (directive_diagnostics, _cpp_handle_directive):
	Update names of cpp_options members.
	* expr.c (cpp_classify_number, eval_token): Update names of
	cpp_options members.
	* init.c (cpp_create_reader, post_options): Update names of
	cpp_options members.
	* internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
	cpp_options members.
	* macro.c (parse_params): Update names of cpp_options members.

From-SVN: r164723
2010-09-29 15:49:14 +01:00
DJ Delorie cd7fe53b72 diagnostic.h (diagnostic_classification_change_t): New.
* diagnostic.h (diagnostic_classification_change_t): New.
(diagnostic_context): Add history and push/pop list.
(diagnostic_push_diagnostics): Declare.
(diagnostic_pop_diagnostics): Declare.
* diagnostic.c (diagnostic_classify_diagnostic): Store changes
from pragmas in a history chain instead of the global table.
(diagnostic_push_diagnostics): New.
(diagnostic_pop_diagnostics): New.
(diagnostic_report_diagnostic): Scan history chain to find state
of diagnostics as of the diagnostic location.
* opts.c (set_option): Pass UNKNOWN_LOCATION to
diagnostic_classify_diagnostic.
(enable_warning_as_error): Likewise.
* diagnostic-core.h (DK_POP): Add after "real" diagnostics, for
use in the history chain.
* c-family/c-pragma.c (handle_pragma_diagnostic): Add push/pop,
allow these pragmas anywhere.
* doc/extend.texi: Document pragma GCC diagnostic changes.

* gcc.dg/pragma-diag-1.c: New.

From-SVN: r161115
2010-06-21 16:58:57 -04:00
Joseph Myers 1da2ed5f19 diagnostic-core.h: New.
* diagnostic-core.h: New.  Contents moved from diagnostic.h and
	toplev.h.
	* diagnostic.c: Don't include toplev.h.
	(progname): Define.  Moved from toplev.c.
	(seen_error): New function.
	* diagnostic.h: Include diagnostic-core.h.
	(diagnostic_t, emit_diagnostic): Don't declare here.
	* toplev.c (progname): Move to toplev.c.
	(emit_debug_global_declarations, compile_file, finalize,
	do_compile, toplev_main): Use seen_error.
	* toplev.h: Include diagnostic-core.h.
	(trim_filename, GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG,
	internal_error, warning, warning_at, error, error_n, error_at,
	fatal_error, pedwarn, permerror, sorry, inform, inform_n,
	verbatim, fnotice, progname): Move to diagnostic-core.h.
	* builtins.c: Include diagnostic-core.h instead of diagnostic.h.
	(expand_builtin_expect): Use seen_error.
	* c-decl.c: Include diagnostic-core.h instead of diagnostic.h.
	(c_make_fname_decl, c_write_global_declarations): Use seen_error.
	* c-format.c: Include diagnostic-core.h instead of diagnostic.h.
	* c-gimplify.c: Include diagnostic-core.h instead of diagnostic.h.
	* c-lang.c: Include diagnostic-core.h instead of diagnostic.h.
	* c-lex.c (c_lex_with_flags, interpret_float): Don't increment
	errorcount for errors.
	* c-opts.c (c_common_finish): Use seen_error.
	* cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
	* cgraphunit.c (verify_cgraph_node, verify_cgraph,
	cgraph_output_pending_asms, cgraph_optimize): Use seen_error.
	* coverage.c: Include diagnostic-core.h instead of diagnostic.h.
	(get_coverage_counts): Use seen_error.
	* dwarf2out.c (dwarf2out_finish): Use seen_error.
	* gimplify.c (gimplify_var_or_parm_decl, gimple_push_cleanup,
	gimplify_body): Use seen_error.
	* ipa-inline.c (cgraph_early_inlining): Use seen_error.
	* ipa-pure-const.c (gate_pure_const): Use seen_error.
	* ipa-reference.c (gate_reference): Use seen_error.
	* jump.c: Include diagnostic-core.h instead of diagnostic.h.
	* lambda-code.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
	* lto-compress.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-section-in.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-streamer-out.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-streamer.c: Include diagnostic-core.h instead of
	diagnostic.h.
	(gate_lto_out): Use seen_error.
	* matrix-reorg.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* omega.c: Include diagnostic-core.h instead of diagnostic.h.
	* omp-low.c: Include diagnostic-core.h instead of diagnostic.h.
	(gate_expand_omp, lower_omp_1): Use seen_error.
	* passes.c: Include diagnostic-core.h instead of diagnostic.h.
	(rest_of_decl_compilation, rest_of_type_compilation,
	gate_rest_of_compilation, ipa_write_summaries): Use seen_error.
	* tree-cfg.c (label_to_block_fn): Use seen_error.
	* tree-inline.c (optimize_inline_calls): Use seen_error.
	* tree-mudflap.c (mudflap_finish_file): Use
	seen_error.
	* tree-optimize.c (gate_all_optimizations,
	gate_all_early_local_passes, gate_all_early_optimizations): Use
	seen_error.
	* tree-ssa-structalias.c (gate_ipa_pta): Use seen_error.
	* varpool.c: Include diagnostic-core.h instead of diagnostic.h.
	(varpool_remove_unreferenced_decls,
	varpool_assemble_pending_decls): Use seen_error.
	* Makefile.in (DIAGNOSTIC_CORE_H): Define.
	(TOPLEV_H, DIAGNOSTIC_H): Update.
	(c-decl.o, c-lang.o, c-format.o, lto-compress.o, lto-cgraph.o,
	lto-streamer-out.o, lto-section-in.o, lto-streamer.o,
	c-gimplify.o, omp-low.o, omega.o, diagnostic.o, passes.o,
	builtins.o, jump.o, cgraph.o, varpool.o, matrix-reorg.o,
	coverage.o, lambda-code.o): Update dependencies.

cp:
	* call.c: Include diagnostic-core.h instead of diagnostic.h.
	* cp-lang.c: Don't include diagnostic.h
	* name-lookup.c: Include diagnostic-core.h instead of
	diagnostic.h.
	(cp_emit_debug_info_for_using): Use seen_error.
	* optimize.c: Include diagnostic-core.h instead of diagnostic.h.
	* parser.c: Include diagnostic-core.h instead of diagnostic.h.
	* pt.c (iterative_hash_template_arg): Use seen_error.
	* repo.c: Include diagnostic-core.h instead of diagnostic.h.
	* typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
	* Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
	cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
	dependencies.

lto:
	* lto.c: Include diagnostic-core.h instead of diagnostic.h.
	(read_cgraph_and_symbols, lto_main): Use seen_error.
	* Make-lang.in (lto/lto.o): Update dependencies.

objc:
	* objc-act.c: Include diagnostic-core.h instead of diagnostic.h.
	* Make-lang.in (objc/objc-act.o): Update dependencies.

From-SVN: r159947
2010-05-27 21:16:07 +01:00
Joseph Myers 5f0f4a3bc5 diagnostic.c: Don't include opts.h.
* diagnostic.c: Don't include opts.h.
	(permissive_error_option): Define.
	(diagnostic_initialize): Take n_opts parameter.  Allocate memory
	for classify_diagnostic.  Don't use memset for
	classify_diagnostic.  Initialize new and recently added fields.
	(diagnostic_classify_diagnostic): Use context->n_opts instead of
	N_OPTS.
	(diagnostic_report_diagnostic): Pass context parameter to
	diagnostic_report_warnings_p.  Use option_enabled and option_name
	hooks from context.
	(emit_diagnostic): Use permissive_error_option.
	(permerror): Likewise.
	* diagnostic.h: Don't include options.h.
	(struct diagnostic_context): Add n_opts, opt_permissive,
	inhibit_warnings, warn_system_headers, option_enabled and
	option_name fields.  Change classify_diagnostic to a pointer.
	* opts-diagnostic.h: New file.
	* opts.c: Include opts-diagnostic.h.
	(common_handle_option): Set global_dc fields for -Wfatal-errors,
	-Wsystem-headers, -fshow-column, -pedantic-errors and -w.
	(option_name): New function.
	* c-opts.c (c_common_init_options): Set global_dc->opt_permissive.
	(c_common_handle_option): Set global_dc->permissive for
	-fpermissive.
	* c-common.c (c_cpp_error): Save and restore
	global_dc->warn_system_headers, not variable warn_system_headers.
	* toplev.c: Include opts-diagnostic.h.
	(general_init): Update call to diagnostic_initialize.  Set
	global_dc->show_column, global_dc->option_enabled and
	global_dc->option_name.
	(process_options): Don't set global_dc fields here.
	* Makefile.in (DIAGNOSTIC_H): Remove options.h.
	(diagnostic.o, opts.o, toplev.o): Update dependencies.

fortran:
	* cpp.c (cb_cpp_error): Save and restore
	global_dc->warn_system_headers, not variable warn_system_headers.

From-SVN: r159869
2010-05-26 14:40:53 +01:00
Joseph Myers a13812e2c8 diagnostic.c: Don't include plugin.h.
* diagnostic.c: Don't include plugin.h.
	(diagnostic_report_diagnostic): Don't handle plugins specially
	here.  Pass context to internal_error callback.
	* diagnostic.h (struct diagnostic_context): Add context parameter
	to internal_error callback.
	* plugin.c (warn_if_plugins, plugins_internal_error_function):
	New.
	* plugin.h (struct diagnostic_context): Declare.
	(warn_if_plugins, plugins_internal_error_function): Declare.
	* toplev.c (general_init): Set global_dc->internal_error.
	* Makefile.in (diagnostic.o): Update dependencies.

ada:
	* gcc-interface/misc.c (internal_error_function): Add context
	parameter.  Use it to access show_column flag and instead of using
	global_dc.  Call warn_if_plugins.
	* gcc-interface/Make-lang.in (ada/misc.o): Update dependencies.

From-SVN: r159819
2010-05-25 14:01:45 +01:00
Joseph Myers 243fbddd9c diagnostic.c: Don't include flags.h.
* diagnostic.c: Don't include flags.h.
	(pedantic_warning_kind, permissive_error_kind): Take diagnostic
	context parameters.  Check flags in the context passed as a
	parameter.
	(diagnostic_build_prefix): Add context parameter.  Check
	show_column flag in context.
	(diagnostic_action_after_output): Check fatal_errors flag in
	context.
	(diagnostic_report_current_module): Check show_column flag in
	context.
	(default_diagnostic_starter): Update call to
	diagnostic_build_prefix.
	(diagnostic_report_diagnostic): Pass context to
	pedantic_warning_kind.
	(emit_diagnostic): Pass context to permissive_error_kind.
	(permerror): Pass context to permissive_error_kind.
	* diagnostic.h (struct diagnostic_context): Add show_column,
	pedantic_errors, permissive and fatal_errors fields.
	(diagnostic_build_prefix): Update prototype.
	* langhooks.c
	* toplev.c (process_options): Set flags in global_dc from
	flag_show_column, flag_pedantic_errors, flag_permissive,
	flag_fatal_errors.
	* tree-diagnostic.c (default_tree_diagnostic_starter): Update call
	to diagnostic_build_prefix.
	* Makefile.in (diagnostic.o): Update dependencies.

cp:
	* error.c (cp_diagnostic_starter): Update call to
	diagnostic_build_prefix.
	(cp_print_error_function,
	print_instantiation_partial_context_line): Check show_column flag
	in context.

From-SVN: r159793
2010-05-24 19:55:44 +01:00
Joseph Myers cf8358387d diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h.
* diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or
	langhooks-def.h.
	(diagnostic_initialize): Initialize x_data not last_function.
	(diagnostic_report_current_function): Move to tree-diagnostic.c.
	(default_diagnostic_starter): Call
	diagnostic_report_current_module not
	diagnostic_report_current_function.
	(diagnostic_report_diagnostic): Initialize x_data not
	abstract_origin.
	(verbatim): Likewise.
	* diagnostic.h (struct diagnostic_info): Change abstract_origin to
	x_data.
	(struct diagnostic_context): Change last_function to x_data.
	(diagnostic_auxiliary_data): Replace with
	diagnostic_context_auxiliary_data and
	diagnostic_info_auxiliary_data.
	(diagnostic_last_function_changed, diagnostic_set_last_function,
	diagnostic_report_current_function): Move to tree-diagnostic.h.
	(print_declaration, dump_generic_node, print_generic_stmt,
	print_generic_stmt_indented, print_generic_expr,
	print_generic_decl, debug_c_tree, dump_omp_clauses,
	print_call_name, debug_generic_expr, debug_generic_stmt,
	debug_tree_chain, default_tree_printer): Move to
	tree-pretty-print.h.
	(debug_gimple_stmt, debug_gimple_seq, print_gimple_seq,
	print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to
	gimple-pretty-print.h.
	* pretty-print.c: Don't include tree.h
	(pp_base_format): Don't handle %K here.
	(pp_base_tree_identifier): Move to tree-pretty-print.c.
	* pretty-print.h (text_info): Change abstract_origin to x_data.
	(pp_tree_identifier, pp_unsupported_tree,
	pp_base_tree_identifier): Move to tree-pretty-print.h.
	* gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h,
	tree-pretty-print.h: New files.
	* tree-pretty-print.c: Include tree-pretty-print.h.
	(percent_K_format): New.  Moved from pretty-print.c.
	(pp_base_tree_identifier): Move from pretty-print.c.
	* c-objc-common.c: Include tree-pretty-print.h.
	(c_tree_printer): Handle %K here.
	* langhooks.c: Include tree-diagnostic.h.
	(lhd_print_error_function): Use diagnostic_abstract_origin macro.
	* toplev.c: Include tree-diagnostic.h and tree-pretty-print.h.
	(default_tree_printer): Handle %K using percent_K_format.
	(general_init): Use default_tree_diagnostic_starter.
	* tree.c: Include tree-diagnostic.h and tree-pretty-print.h.
	(free_lang_data): Use default_tree_diagnostic_starter.
	* c-pretty-print.c: Include tree-pretty-print.h.
	* cfgexpand.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* cgraphunit.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* dwarf2out.c: Include tree-pretty-print.h.
	* except.c: Include tree-pretty-print.h.
	* gimple-pretty-print.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* gimplify.c: Include tree-pretty-print.h.
	* graphite-poly.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* ipa-cp.c: Include tree-pretty-print.h.
	* ipa-inline.c: Include gimple-pretty-print.h.
	* ipa-prop.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* ipa-pure-const.c: Include gimple-pretty-print.h.
	* ipa-struct-reorg.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* ipa-type-escape.c: Include tree-pretty-print.h.
	* print-rtl.c: Include tree-pretty-print.h.
	* print-tree.c: Include gimple-pretty-print.h.
	* sese.c: Include tree-pretty-print.h.
	* tree-affine.c: Include tree-pretty-print.h.
	* tree-browser.c: Include tree-pretty-print.h.
	* tree-call-cdce.c: Include gimple-pretty-print.h.
	* tree-cfg.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-chrec.c: Include tree-pretty-print.h.
	* tree-data-ref.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-dfa.c: Include tree-pretty-print.h.
	* tree-if-conv.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-inline.c: Include tree-pretty-print.h.
	* tree-into-ssa.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-nrv.c: Include tree-pretty-print.h.
	* tree-object-size.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-outof-ssa.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-parloops.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-predcom.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-scalar-evolution.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-sra.c: Include tree-pretty-print.h.
	* tree-ssa-address.c: Include tree-pretty-print.h.
	* tree-ssa-alias.c: Include tree-pretty-print.h.
	* tree-ssa-ccp.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-coalesce.c: Include tree-pretty-print.h.
	* tree-ssa-copy.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-copyrename.c: Include tree-pretty-print.h.
	* tree-ssa-dce.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-dom.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-dse.c: Include gimple-pretty-print.h.
	* tree-ssa-forwprop.c: Include tree-pretty-print.h.
	* tree-ssa-ifcombine.c: Include tree-pretty-print.h.
	* tree-ssa-live.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-im.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-niter.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-prefetch.c: Include tree-pretty-print.h.
	* tree-ssa-math-opts.c: Include gimple-pretty-print.h.
	* tree-ssa-operands.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-phiprop.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-pre.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-propagate.c: Include gimple-pretty-print.h.
	* tree-ssa-reassoc.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-sccvn.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-sink.c: Include gimple-pretty-print.h.
	* tree-ssa-ter.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-uninit.c: Include gimple-pretty-print.h.
	* tree-ssa.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-stdarg.c: Include gimple-pretty-print.h.
	* tree-switch-conversion.c: Include gimple-pretty-print.h.
	* tree-tailcall.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-data-refs.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-loop-manip.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-loop.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-patterns.c: Include gimple-pretty-print.h.
	* tree-vect-slp.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-stmts.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vectorizer.c: Include tree-pretty-print.h.
	* tree-vrp.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* value-prof.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* var-tracking.c: Include tree-pretty-print.h.
	* Makefile.in (OBJS-common): Add tree-diagnostic.o.
	(tree-diagnostic.o): New dependencies.
	(c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o,
	tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o,
	tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o,
	tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o,
	tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o,
	tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o,
	tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o,
	tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o,
	tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o,
	tree-ssa-address.o, tree-ssa-loop-niter.o,
	tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o,
	tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o,
	tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o,
	gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o,
	tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o,
	tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o,
	tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o,
	tree-parloops.o, tree-stdarg.o, tree-object-size.o,
	gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o,
	toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o,
	ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o,
	ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o,
	tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o,
	tree-switch-conversion.o, var-tracking.o, value-prof.o,
	cfgexpand.o, pretty-print.o): Update dependencies.

cp:
	* error.c: Include tree-diagnostic.h and tree-pretty-print.h.
	(cp_print_error_function): Use diagnostic_abstract_origin macro.
	(cp_printer): Handle %K here using percent_K_format.
	* cxx-pretty-print.c: Include tree-pretty-print.h.
	* Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
	dependencies.

From-SVN: r159685
2010-05-21 23:34:26 +01:00
Joseph Myers 676dd4d4df diagnostic.c (FLOAT, FFS): Don't undefine.
* diagnostic.c (FLOAT, FFS): Don't undefine.
	* passes.c, pretty-print.c, rtl-error.c, toplev.c: Likewise.
	* cse.c, regmove.c: Remove comments about stdio.h and rtl.h
	include ordering.

From-SVN: r159602
2010-05-19 22:32:19 +01:00
Manuel López-Ibáñez 289fcbbd6e re PR other/42966 (add some indication that a warning has been converted to an error)
2010-04-14  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR 42966
	* diagnostics.c (diagnostic_report_diagnostic): Mark specially
	warnings converted to errors.
	
testsuite/	
	* gcc.dg/cpp/warn-undef-2.c: Update.
	* gcc.dg/cpp/warn-traditional-2.c: Update.
	* gcc.dg/cpp/warn-comments-2.c: Update.
	* gcc.dg/cpp/warn-variadic-2.c: Update.
	* gcc.dg/cpp/warn-long-long-2.c: Update.
	* gcc.dg/cpp/warn-deprecated-2.c: Update.
	* gcc.dg/cpp/warn-multichar-2.c: Update.
	* gcc.dg/cpp/warn-normalized-3.c: Update.
	* gcc.dg/cpp/warn-cxx-compat-2.c: Update.
	* gcc.dg/cpp/warn-trigraphs-3.c: Update.
	* gcc.dg/cpp/warn-unused-macros-2.c: Update.
	* gcc.dg/cpp/warn-trigraphs-4.c: Update.
	* gcc.dg/cpp/warn-redefined-2.c: Update.
	* gfortran.dg/warning-directive-2.F90: Update.
	* c-c++-common/cpp/warning-directive-2.c: Update.

From-SVN: r158349
2010-04-14 16:08:23 +00:00
Manuel López-Ibáñez d0b8780d9f re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options)
2010-04-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR 42965
	* diagnostic.c (diagnostic_initialize): Initialize
	some_warnings_are_errors.
	(diagnostic_finish): New.
	(diagnostic_action_after_output): Call it before exiting.
	(diagnostic_report_diagnostic): Do not print message here. Set
	some_warnings_are_errors.
	* diagnostic.h (diagnostic_context): Delete
	issue_warnings_are_errors_message. Add some_warnings_are_errors.
	(diagnostic_finish): Declare.
	* toplev.c (toplev_main): Call it before exit.
testsuite/
	* gcc.dg/Werror-6.c: Adjust.
	* gcc.dg/Werror-implicit-function-declaration.c: Likewise.
	* gcc.dg/Werror-4.c: Likewise.
	* gcc.dg/Wdeclaration-after-statement-3.c: Likewise.
	* gcc.dg/Wswitch-enum-error.c: Likewise.
	* gcc.dg/Wpointer-arith.c: Likewise.
	* gcc.dg/Wfatal.c: Likewise.
	* gcc.dg/Wswitch-error.c: Likewise.
	* g++.dg/warn/unused-result1-Werror.c: Likewise.
	* gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c.
	* gcc.dg/cpp/warn-undef-2.c: Likewise.
	* gcc.dg/cpp/warn-traditional-2.c: Likewise.
	* gcc.dg/cpp/warn-comments-2.c: Likewise.
	* gcc.dg/cpp/warn-variadic-2.c: Likewise.
	* gcc.dg/cpp/warning-directive-2.c: Likewise.
	* gcc.dg/cpp/warn-long-long-2.c: Likewise.
	* gcc.dg/cpp/warn-deprecated-2.c: Likewise.
	* gcc.dg/cpp/warn-multichar-2.c: Likewise.
	* gcc.dg/cpp/warn-normalized-3.c: Likewise.
	* gcc.dg/cpp/warn-cxx-compat-2.c: Likewise.
	* gcc.dg/cpp/warn-trigraphs-3.c: Likewise.
	* gcc.dg/cpp/warn-unused-macros-2.c: Likewise.
	* gcc.dg/cpp/warn-trigraphs-4.c: Likewise.
	* gcc.dg/cpp/warn-redefined-2.c: Likewise.
	* g++.dg/cpp/warning-directive-2.C: Likewise.
	* gfortran.dg/warning-directive-2.F90: Likewise.

From-SVN: r158168
2010-04-09 15:45:52 +00:00
Steven Bosscher c75c517d53 Make-lang.in, [...]: Update copyright years.
* ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c, 
	basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h,
	collect2.h, config/alpha/alpha.c, config/alpha/alpha.md,
	config/alpha/predicates.md, config/arm/arm.md,
	config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml,
	config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c,
	config/darwin9.h, config/darwin.c, config/darwin.h,
	config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h,
	config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c,
	config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c,
	config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c,
	config/mips/mips.md, config/mn10300/mn10300.c,
	config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md,
	config/rs6000/aix.h, config/rs6000/dfp.md,
	config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c,
	config/rs6000/vector.md, config/rtems.h, config/rx/rx.md,
	config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h,
	config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md,
	config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c,
	config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in,
	c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c,
	diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi,
	doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi,
	doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c,
	fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h,
	gensupport.c, gimple.h, gimple-iterator.c, graphite.c,
	graphite-clast-to-gimple.c, graphite-clast-to-gimple.h,
	graphite-dependences.c, graphite-poly.c, graphite-poly.h,
	graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c,
	graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c,
	intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h,
	ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c,
	ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c,
	loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c,
	objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk,
	opt-functions.awk, opth-gen.awk, params.def, passes.c,
	postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h,
	rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h,
	store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c,
	tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h,
	tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c,
	tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c,
	tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c,
	tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c,
	tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c,
	tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
	tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c,
	tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c,
	tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c,
	unwind-dw2-fde-darwin.c, varpool.c: Update copyright years.

From-SVN: r157950
2010-04-02 19:54:46 +00:00
Shujing Zhao 894e2652e1 toplev.h (inform_n, error_n): Declare.
gcc/
2010-03-01  Marco Poletti  <poletti.marco@gmail.com> 

        * toplev.h (inform_n, error_n): Declare.
        * diagnostic.c (inform_n, error_n): New function.

gcc/cp/
2010-03-01  Marco Poletti  <poletti.marco@gmail.com>

        * pt.c (redeclare_class_template): Use error_n and inform_n.

gcc/po
2010-03-01  Shujing Zhao  <pearly.zhao@oracle.com>

        * exgettext: Handle the functions that end with _n.

From-SVN: r157134
2010-03-01 09:56:41 +00:00
Manuel López-Ibáñez 0e94b75085 diagnostic.c (diagnostic_initialize): Update.
2010-02-26  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* diagnostic.c (diagnostic_initialize): Update.
	(diagnostic_report_diagnostic): Test inhibit_notes_p for
	informative notes.
	* diagnostic.h (diagnostic_context): New bool inhibit_notes_p.
	(diagnostic_inhibit_notes): New.
	* toplev.c (process_options): inhibit notes with -fcompare-debug.

From-SVN: r157100
2010-02-26 22:06:56 +00:00
H.J. Lu b8698a0f37 Remove trailing white spaces.
2009-11-25  H.J. Lu  <hongjiu.lu@intel.com>

	* alias.c: Remove trailing white spaces.
	* alloc-pool.c: Likewise.
	* alloc-pool.h: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* basic-block.h: Likewise.
	* bb-reorder.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* builtins.def: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-cppbuiltin.c: Likewise.
	* c-decl.c: Likewise.
	* c-format.c: Likewise.
	* c-lex.c: Likewise.
	* c-omp.c: Likewise.
	* c-opts.c: Likewise.
	* c-parser.c: Likewise.
	* c-pretty-print.c: Likewise.
	* c-tree.h: Likewise.
	* c-typeck.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfghooks.h: Likewise.
	* cfglayout.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphunit.c: Likewise.
	* cif-code.def: Likewise.
	* collect2.c: Likewise.
	* combine.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* crtstuff.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* dbgcnt.c: Likewise.
	* dbgcnt.def: Likewise.
	* dbgcnt.h: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* ddg.h: Likewise.
	* defaults.h: Likewise.
	* df-byte-scan.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* df.h: Likewise.
	* dfp.c: Likewise.
	* diagnostic.c: Likewise.
	* diagnostic.h: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* double-int.c: Likewise.
	* double-int.h: Likewise.
	* dse.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2asm.h: Likewise.
	* dwarf2out.c: Likewise.
	* ebitmap.c: Likewise.
	* ebitmap.h: Likewise.
	* emit-rtl.c: Likewise.
	* et-forest.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* flags.h: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* fwprop.c: Likewise.
	* gcc.c: Likewise.
	* gcov-dump.c: Likewise.
	* gcov-io.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* genchecksum.c: Likewise.
	* genconfig.c: Likewise.
	* genflags.c: Likewise.
	* gengtype-parse.c: Likewise.
	* gengtype.c: Likewise.
	* gengtype.h: Likewise.
	* genmddeps.c: Likewise.
	* genmodes.c: Likewise.
	* genopinit.c: Likewise.
	* genpreds.c: Likewise.
	* gensupport.c: Likewise.
	* ggc-common.c: Likewise.
	* ggc-page.c: Likewise.
	* ggc-zone.c: Likewise.
	* ggc.h: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple.c: Likewise.
	* gimple.def: Likewise.
	* gimple.h: Likewise.
	* gimplify.c: Likewise.
	* graphds.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* gthr-nks.h: Likewise.
	* gthr-posix.c: Likewise.
	* gthr-posix.h: Likewise.
	* gthr-posix95.h: Likewise.
	* gthr-single.h: Likewise.
	* gthr-tpf.h: Likewise.
	* gthr-vxworks.h: Likewise.
	* gthr.h: Likewise.
	* haifa-sched.c: Likewise.
	* hard-reg-set.h: Likewise.
	* hooks.c: Likewise.
	* hooks.h: Likewise.
	* hosthooks.h: Likewise.
	* hwint.h: Likewise.
	* ifcvt.c: Likewise.
	* incpath.c: Likewise.
	* init-regs.c: Likewise.
	* integrate.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa-struct-reorg.h: Likewise.
	* ipa-type-escape.c: Likewise.
	* ipa-type-escape.h: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-utils.h: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-int.h: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* lambda-code.c: Likewise.
	* lambda-mat.c: Likewise.
	* lambda-trans.c: Likewise.
	* lambda.h: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* libgcov.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* lto-streamer.h: Likewise.
	* lto-symtab.c: Likewise.
	* lto-wpa-fixup.c: Likewise.
	* matrix-reorg.c: Likewise.
	* mcf.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* omega.c: Likewise.
	* omega.h: Likewise.
	* omp-low.c: Likewise.
	* optabs.c: Likewise.
	* optabs.h: Likewise.
	* opts-common.c: Likewise.
	* opts.c: Likewise.
	* params.def: Likewise.
	* params.h: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* predict.def: Likewise.
	* pretty-print.c: Likewise.
	* pretty-print.h: Likewise.
	* print-rtl.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* read-rtl.c: Likewise.
	* real.c: Likewise.
	* recog.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regmove.c: Likewise.
	* regrename.c: Likewise.
	* regs.h: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* resource.c: Likewise.
	* rtl.c: Likewise.
	* rtl.def: Likewise.
	* rtl.h: Likewise.
	* rtlanal.c: Likewise.
	* sbitmap.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-int.h: Likewise.
	* sched-rgn.c: Likewise.
	* sched-vis.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-dump.h: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched-ir.h: Likewise.
	* sel-sched.c: Likewise.
	* sel-sched.h: Likewise.
	* sese.c: Likewise.
	* sese.h: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* stringpool.c: Likewise.
	* stub-objc.c: Likewise.
	* sync-builtins.def: Likewise.
	* target-def.h: Likewise.
	* target.h: Likewise.
	* targhooks.c: Likewise.
	* targhooks.h: Likewise.
	* timevar.c: Likewise.
	* tlink.c: Likewise.
	* toplev.c: Likewise.
	* toplev.h: Likewise.
	* tracer.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-affine.h: Likewise.
	* tree-browser.def: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-chrec.h: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-data-ref.h: Likewise.
	* tree-dfa.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-dump.h: Likewise.
	* tree-eh.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-flow.h: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-loop-linear.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-pass.h: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-operands.h: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vectorizer.h: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tree.def: Likewise.
	* tree.h: Likewise.
	* treestruct.def: Likewise.
	* unwind-compat.c: Likewise.
	* unwind-dw2-fde-glibc.c: Likewise.
	* unwind-dw2.c: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vec.c: Likewise.
	* vec.h: Likewise.
	* vmsdbgout.c: Likewise.
	* web.c: Likewise.
	* xcoffout.c: Likewise.

From-SVN: r154645
2009-11-25 02:55:54 -08:00
Diego Novillo 4537ec0c86 [multiple changes]
2009-09-01  Diego Novillo  <dnovillo@google.com>

	* c-lang.c (lang_hooks): Remove const qualifier.

java/ChangeLog

	* lang.c (lang_hooks): Remove const qualifier.

objc/ChangeLog

	* objc-lang.c (lang_hooks): Remove const qualifier.

objcp/ChangeLog

	* objcp-lang.c (lang_hooks): Remove const qualifier.

ada/ChangeLog

	* gcc-interface/misc.c (lang_hooks): Remove const qualifier.

fortran/ChangeLog

	* f95-lang.c (lang_hooks): Remove const qualifier.

cp/ChangeLog

	* cp-lang.c (lang_hooks): Remove const qualifier.

2009-09-01  Diego Novillo  <dnovillo@google.com>

	* cgraph.c (cgraph_node_for_decl): New.
	* cgraph.h (cgraph_node_for_decl): Declare.
	* tree.c (host_integerp): Return 0 if T is NULL.


2009-09-01  Diego Novillo  <dnovillo@google.com>

	* tree.h (struct alias_pair): Move from varasm.c.
	(alias_pairs): Likewise.
	(TYPE_MAXVAL): Define.
	(TYPE_MINVAL): Define.
	(iterative_hash_host_wide_int): Declare.
	(remove_unreachable_alias_pairs): Declare.
	* tree-pass.h (pass_ipa_free_lang_data): Declare.
	* diagnostic.c (default_diagnostic_starter): Make extern.
	(default_diagnostic_finalizer): Make extern.
	* diagnostic.h (default_diagnostic_starter): Declare.
	(default_diagnostic_finalizer): Declare.
	(default_tree_printer): Declare.
	* toplev.c (default_tree_printer): Make extern.


2009-09-01  Richard Guenther  <rguenther@suse.de>
	    Diego Novillo  <dnovillo@google.com>

	* cgraph.c (cgraph_add_new_function): Remove gimplification.
	* cgraphunit.c (cgraph_expand_function): Do not emit
	associated thunks from here.
	(cgraph_emit_thunks): New.
	(cgraph_optimize): Call it.
	Return if any IPA pass finds an error.
	* varasm.c (finish_aliases_1): Ignore errorneous aliases used
	by thunks.


2009-09-01  Simon Baldwin  <simonb@google.com>
	    Rafael Espindola  <espindola@google.com>
	    Richard Guenther  <rguenther@suse.de>
	    Doug Kwan  <dougkwan@google.com>
	    Diego Novillo  <dnovillo@google.com>

	* tree.c: Include tree-pass.h, langhooks-def.h,
	diagnostic.h, cgraph.h, timevar.h, except.h and debug.h.
	(free_lang_data_in_type): New.
	(need_assembler_name_p): New.
	(free_lang_data_in_block): New.
	(free_lang_data_in_decl): New.
	(struct free_lang_data_d): New.
	(add_tree_to_fld_list): New.
	(find_decls_types_r): New.
	(get_eh_types_for_runtime): New.
	(find_decls_types_in_eh_region): New.
	(find_decls_types_in_node): New.
	(find_decls_types_in_var): New.
	(free_lang_data_in_cgraph): New.
	(free_lang_data): New.
	(gate_free_lang_data): New.
	(pass_ipa_free_lang_data): New.

2009-09-01  Diego Novillo  <dnovillo@google.com>

	* timevar.def (TV_IPA_FREE_LANG_DATA): Define.
	* langhooks.h (struct lang_hooks): Add field free_lang_data.
	(lang_hooks): Remove const qualifier.
	* ipa.c (cgraph_remove_unreachable_nodes): Call
	remove_unreachable_alias_pairs.
	* except.c (add_type_for_runtime): Check if TYPE has
	already been converted.
	(lookup_type_for_runtime): Likewise.
	(check_handled): Handle converted types.
	* varasm.c (remove_unreachable_alias_pairs): New.
	* gimple.c: Include demangle.h.
	(gimple_decl_printable_name): New.
	(gimple_fold_obj_type_ref): New.
	* gimple.h (gimple_decl_printable_name): Declare.
	(gimple_fold_obj_type_ref): Declare.
	* passes.c (init_optimization_passes): Add pass
	pass_ipa_free_lang_data.
	* langhooks-def.h (LANG_HOOKS_FREE_LANG_DATA): Define.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_FREE_LANG_DATA.

testsuite/ChangeLog

2009-09-01  Diego Novillo  <dnovillo@google.com>

	* gcc.dg/gomp/combined-1.c: Adjust expected pattern.
	* g++.dg/tree-prof/inline_mismatch_args.C: Likewise.
	* g++.dg/warn/unit-1.C: Likewise.
	* g++.dg/ipa/iinline-1.C: Likewise.
	* g++.dg/template/cond2.C: Adjust expected line location for the
	error.
	* g++.dg/template/pr35240.C: Likewise.


cp/ChangeLog

2009-09-01  Doug Kwan  <dougkwan@google.com>

	* tree.c (cp_fix_function_decl_p): New.
	(cp_free_lang_data): New.

2009-09-01  Diego Novillo  <dnovillo@google.com>

	* Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
	* decl2.c: Include pointer-set.h.
	(collect_candidates_for_java_method_aliases): New.
	(cp_write_global_declarations): Call it.
	Add local variable CANDIDATES.  If set, call
	build_java_method_aliases.
	(build_java_method_aliases): Add argument CANDIDATES.
	Use it to determine if FNDECL should get a hidden alias.
	* cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
	* cp-tree.h (cp_free_lang_data): Declare.

2009-09-03  Richard Guenther  <rguenther@suse.de>

	* method.c (use_thunk): Use cgraph_finalize_function to hand
	off thunks to the cgraph.
	* semantics.c (emit_associated_thunks): Do not emit thunks
	for really extern functions.

From-SVN: r151360
2009-09-03 00:07:12 -04:00
Alexandre Oliva b5b8b0ac64 invoke.texi (-fvar-tracking-assignments): New.
gcc/ChangeLog:
* doc/invoke.texi (-fvar-tracking-assignments): New.
(-fvar-tracking-assignments-toggle): New.
(-fdump-final-insns=file): Mark filename as optional.
(--param min-nondebug-insn-uid): New.
(-gdwarf-@{version}): Mention version 4.
* opts.c (common_handle_option): Accept it.
* tree-vrp.c (find_assert_locations_1): Skip debug stmts.
* regrename.c (regrename_optimize): Drop last.  Don't count debug
insns as uses.  Don't reject change because of debug insn.
(do_replace): Reject DEBUG_INSN as chain starter.  Take base_regno
from the chain starter, and check for inexact matches in
DEBUG_INSNS.
(scan_rtx_reg): Accept inexact matches in DEBUG_INSNs.
(build_def_use): Simplify and fix the marking of DEBUG_INSNs.
* sched-ebb.c (schedule_ebbs): Skip boundary debug insns.
* fwprop.c (forward_propagate_and_simplify): ...into debug insns.
* doc/gimple.texi (is_gimple_debug): New.
(gimple_debug_bind_p): New.
(is_gimple_call, gimple_assign_cast_p): End sentence with period.
* doc/install.texi (bootstrap-debug): More details.
(bootstrap-debug-big, bootstrap-debug-lean): Document.
(bootstrap-debug-lib): More details.
(bootstrap-debug-ckovw): Update.
(bootstrap-time): New.
* tree-into-ssa.c (mark_def_sites): Skip debug stmts.
(insert_phi_nodes_for): Insert debug stmts.
(rewrite_stmt): Take iterator.  Insert debug stmts.
(rewrite_enter_block): Adjust.
(maybe_replace_use_in_debug_stmt): New.
(rewrite_update_stmt): Use it.
(mark_use_interesting): Return early for debug stmts.
* tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug
stmts before replacing stmt.
(move_computations_stmt): Likewise.
* ira-conflicts.c (add_copies): Skip debug insns.
* regstat.c (regstat_init_n_sets_and_refs): Discount debug insns.
(regstat_bb_compute_ri): Skip debug insns.
* tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts.
* tree-ssa-loop-manip.c (find_uses_to_rename_stmt,
check_loop_closed_ssa_stmt): Skip debug stmts.
* tree-tailcall.c (find_tail_calls): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
* tree.h (MAY_HAVE_DEBUG_STMTS): New.
(build_var_debug_value_stat): Declare.
(build_var_debug_value): Define.
(target_for_debug_bind): Declare.
* reload.c (find_equiv_reg): Skip debug insns.
* rtlanal.c (reg_used_between_p): Skip debug insns.
(side_effects_p): Likewise.
(canonicalize_condition): Likewise.
* ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug
insns never depend on debug insns.
(create_ddg_dep_no_link): Likewise.
(add_cross_iteration_register_deps): Use ANTI_DEP for debug insns.
Don't add inter-loop dependencies for debug insns.
(build_intra_loop_deps): Likewise.
(create_ddg): Count debug insns.
* ddg.h (struct ddg::num_debug): New.
(num_backargs): Pair up with previous int field.
* diagnostic.c (diagnostic_report_diagnostic): Skip notes on
-fcompare-debug-second.
* final.c (get_attr_length_1): Skip debug insns.
(rest_of_clean-state): Don't dump CFA_RESTORE_STATE.
* gcc.c (invoke_as): Call compare-debug-dump-opt.
(driver_self_specs): Map -fdump-final-insns to
-fdump-final-insns=..
(get_local_tick): New.
(compare_debug_dump_opt_spec_function): Test for . argument and
compute output name.  Compute temp output spec without flag name.
Compute -frandom-seed.
(OPT): Undef after use.
* cfgloopanal.c (num_loop_insns): Skip debug insns.
(average_num_loop_insns): Likewise.
* params.h (MIN_NONDEBUG_INSN_UID): New.
* gimple.def (GIMPLE_DEBUG): New.
* ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts.
* auto-inc-dec.c (merge_in_block): Skip debug insns.
(merge_in_block): Fix whitespace.
* toplev.c (flag_var_tracking): Update comment.
(flag_var_tracking_assignments): New.
(flag_var_tracking_assignments_toggle): New.
(process_options): Don't open final insns dump file if we're not
going to write to it.  Compute defaults for var_tracking.
* df-scan.c (df_insn_rescan_debug_internal): New.
(df_uses_record): Handle debug insns.
* haifa-sched.c (ready): Initialize n_debug.
(contributes_to_priority): Skip debug insns.
(dep_list_size): New.
(priority): Use it.
(rank_for_schedule): Likewise.  Schedule debug insns as soon as
they're ready.  Disregard previous debug insns to make decisions.
(queue_insn): Never queue debug insns.
(ready_add, ready_remove_first, ready_remove): Count debug insns.
(schedule_insn): Don't reject debug insns because of issue rate.
(get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns.
(queue_to_ready): Skip and discount debug insns.
(choose_ready): Let debug insns through.
(schedule_block): Check boundary debug insns.  Discount debug
insns, schedule them early.  Adjust whitespace.
(set_priorities): Check for boundary debug insns.
(add_jump_dependencies): Use dep_list_size.
(prev_non_location_insn): New.
(check_cfg): Use it.
* tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug
stmts.
(remove_unused_ivs): Reset debug stmts.
* modulo-sched.c (const_iteration_count): Skip debug insns.
(res_MII): Discount debug insns.
(loop_single_full_bb_p): Skip debug insns.
(sms_schedule): Likewise.
(sms_schedule_by_order): Likewise.
(ps_has_conflicts): Likewise.
* caller-save.c (refmarker_fn): New.
(save_call_clobbered_regs): Replace regs with saved mem in
debug insns.
(mark_referenced_regs): Take pointer, mark and arg.  Adjust.
Call refmarker_fn mark for hardregnos.
(mark_reg_as_referenced): New.
(replace_reg_with_saved_mem): New.
* ipa-pure-const.c (check_stmt): Skip debug stmts.
* cse.c (cse_insn): Canonicalize debug insns.  Skip them when
searching back.
(cse_extended_basic_block): Skip debug insns.
(count_reg_usage): Likewise.
(is_dead_reg): New, split out of...
(set_live_p): ... here.
(insn_live_p): Use it for debug insns.
* tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts.
(execute_optimize_stdarg): Likewise.
* tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise.
* tree-ssa-propagate.c (substitute_and_fold): Don't regard
changes in debug stmts as changes.
* sel-sched.c (moving_insn_creates_bookkeeping_block_p): New.
(moveup_expr): Don't move across debug insns.  Don't move
debug insn if it would create a bookkeeping block.
(moveup_expr_cached): Don't use cache for debug insns that
are heads of blocks.
(compute_av_set_inside_bb): Skip debug insns.
(sel_rank_for_schedule): Schedule debug insns first.  Remove
dead code.
(block_valid_for_bookkeeping_p); Support lax searches.
(create_block_for_bookkeeping): Adjust block numbers when
encountering debug-only blocks.
(find_place_for_bookkeeping): Deal with debug-only blocks.
(generate_bookkeeping_insn): Accept no place to insert.
(remove_temp_moveop_nops): New argument full_tidying.
(prepare_place_to_insert): Deal with debug insns.
(advance_state_on_fence): Debug insns don't start cycles.
(update_boundaries): Take fence as argument.  Deal with
debug insns.
(schedule_expr_on_boundary): No full_tidying on debug insns.
(fill_insns): Deal with debug insns.
(track_scheduled_insns_and_blocks): Don't count debug insns.
(need_nop_to_preserve_insn_bb): New, split out of...
(remove_insn_from_stream): ... this.
(fur_orig_expr_not_found): Skip debug insns.
* rtl.def (VALUE): Move up.
(DEBUG_INSN): New.
* tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug
stmts.
(nearest_common_dominator_of_uses): Take debug_stmts argument.
Set it if debug stmts are found.
(statement_sink_location): Skip debug stmts.  Propagate
moving defs into debug stmts.
* ifcvt.c (first_active_insn): Skip debug insns.
(last_active_insns): Likewise.
(cond_exec_process_insns): Likewise.
(noce_process_if_block): Likewise.
(check_cond_move_block): Likewise.
(cond_move_convert_if_block): Likewise.
(block_jumps_and_fallthru_p): Likewise.
(dead_or_predicable): Likewise.
* dwarf2out.c (debug_str_hash_forced): New.
(find_AT_string): Add comment.
(gen_label_for_indirect_string): New.
(get_debug_string_label): New.
(AT_string_form): Use it.
(mem_loc_descriptor): Handle non-TLS symbols.  Handle MINUS , DIV,
MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING.  Accept but
discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and
several operations that cannot be represented with DWARF opcodes.
(loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND.  Require
dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value.
(dwarf2out_var_location): Take during-call mark into account.
(output_indirect_string): Update comment.  Output if there are
label and references.
(prune_indirect_string): New.
(prune_unused_types): Call it if debug_str_hash_forced.
More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>:
(dw_long_long_const): Remove.
(struct dw_val_struct): Change val_long_long type to rtx.
(print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for
val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair.
(output_die): Likewise.  Use HOST_BITS_PER_WIDE_INT size of each
component instead of HOST_BITS_PER_LONG.
(output_loc_operands): Likewise.   For const8* assert
HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64.
(output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT
rather than HOST_BITS_PER_LONG is >= 64.
(add_AT_long_long): Remove val_hi and val_lo arguments, add
val_const_double.
(size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of
HOST_BITS_PER_LONG for dw_val_class_long_long.
(add_const_value_attribute): Adjust add_AT_long_long caller.  Don't
handle TLS SYMBOL_REFs.  If CONST wraps a constant, tail recurse.
(dwarf_stack_op_name): Handle DW_OP_implicit_value and
DW_OP_stack_value.
(size_of_loc_descr, output_loc_operands, output_loc_operands_raw):
Handle DW_OP_implicit_value.
(extract_int): Move prototype earlier.
(mem_loc_descriptor): For SUBREG punt if inner
mode size is wider than DWARF2_ADDR_SIZE.  Handle SIGN_EXTEND
and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}.  Handle
EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN,
UMAX, SIGN_EXTRACT, ZERO_EXTRACT.
(loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE
instead of Pmode size.
(loc_descriptor): Add MODE argument.  Handle CONST_INT, CONST_DOUBLE,
CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode,
attempt to handle other expressions.  Don't handle TLS SYMBOL_REFs.
(concat_loc_descriptor, concatn_loc_descriptor,
loc_descriptor_from_tree_1): Adjust loc_descriptor callers.
(add_location_or_const_value_attribute): Likewise.  For single
location loc_lists attempt to use add_const_value_attribute
for constant decls.  Add DW_AT_const_value even if
NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING
in its expression.
* cfgbuild.c (inside_basic_block_p): Handle debug insns.
(control_flow_insn_p): Likewise.
* tree-parloops.c (eliminate_local_variables_stmt): Handle debug
stmt.
(separate_decls_in_region_debug_bind): New.
(separate_decls_in_region): Process debug bind stmts afterwards.
* recog.c (verify_changes): Handle debug insns.
(extract_insn): Likewise.
(peephole2_optimize): Skip debug insns.
* dse.c (scan_insn): Skip debug insns.
* sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument.
Pass it on.
(setup_id_for_insn): Handle debug insns.
(maybe_tidy_empty_bb): Adjust whitespace.
(tidy_control_flow): Skip debug insns.
(sel_remove_insn): Adjust for debug insns.
(sel_estimate_number_of_insns): Skip debug insns.
(create_insn_rtx_from_pattern): Handle debug insns.
(create_copy_of_insn_rtx): Likewise.
* sel-sched-.h (sel_bb_end): Declare.
(sel_bb_empty_or_nop_p): New.
(get_all_loop_exits): Use it.
(_eligible_successor_edge_p): Likewise.
(return_nop_to_pool): Adjust.
* tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts.
* ira-lives.c (process_bb_node_lives): Skip debug insns.
* gimple-pretty-print.c (dump_gimple_debug): New.
(dump_gimple_stmt): Use it.
(dump_bb_header): Skip gimple debug stmts.
* regmove.c (optimize_reg_copy_1): Discount debug insns.
(fixup_match_2): Likewise.
(regmove_backward_pass): Likewise.  Simplify combined
replacement.  Handle debug insns.
* function.c (instantiate_virtual_regs): Handle debug insns.
* function.h (struct emit_status): Add x_cur_debug_insn_uid.
* print-rtl.h: Include cselib.h.
(print_rtx): Print VALUEs.  Split out and recurse for
VAR_LOCATIONs.
* df.h (df_inns_rescan_debug_internal): Declare.
* gcse.c (alloc_hash_table): Estimate n_insns.
(cprop_insn): Don't regard debug insns as changes.
(bypass_conditional_jumps): Skip debug insns.
(one_pre_gcse_pass): Adjust.
(one_code_hoisting_pass): Likewise.
(compute_ld_motion_mems): Skip debug insns.
(one_cprop_pass): Adjust.
* tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts.
(if_convertible_stmt_p): Handle debug stmts.
* init-regs.c (initialize_uninitialized_regs): Skip debug insns.
* tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts.
* ira-build.c (create_bb_allocnos): Skip debug insns.
* tree-flow-inline.h (has_zero_uses): Discount debug stmts.
(has_single_use): Likewise.
(single_imm_use): Likewise.
(num_imm_uses): Likewise.
* tree-ssa-phiopt.c (empty_block_p): Skip debug stmts.
* tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts.
(create_outofssa_var_map): Likewise.
* lower-subreg.c (adjust_decomposed_uses): New.
(resolve_debug): New.
(decompose_multiword_subregs): Use it.
* tree-dfa.c (find_referenced_vars): Skip debug stmts.
* emit-rtl.c: Include params.h.
(cur_debug_insn_uid): Define.
(set_new_first_and_last_insn): Set cur_debug_insn_uid too.
(copy_rtx_if_shared_1): Handle debug insns.
(reset_used_flags): Likewise.
(set_used_flags): LIkewise.
(get_max_insn_count): New.
(next_nondebug_insn): New.
(prev_nondebug_insn): New.
(make_debug_insn_raw): New.
(emit_insn_before_noloc): Handle debug insns.
(emit_jump_insn_before_noloc): Likewise.
(emit_call_insn_before_noloc): Likewise.
(emit_debug_insn_before_noloc): New.
(emit_insn_after_noloc): Handle debug insns.
(emit_jump_insn_after_noloc): Likewise.
(emit_call_insn_after_noloc): Likewise.
(emit_debug_insn_after_noloc): Likewise.
(emit_insn_after): Take loc from earlier non-debug insn.
(emit_jump_insn_after): Likewise.
(emit_call_insn_after): Likewise.
(emit_debug_insn_after_setloc): New.
(emit_debug_insn_after): New.
(emit_insn_before): Take loc from later non-debug insn.
(emit_jump_insn_before): Likewise.
(emit_call_insn_before): Likewise.
(emit_debug_insn_before_setloc): New.
(emit_debug_insn_before): New.
(emit_insn): Handle debug insns.
(emit_debug_insn): New.
(emit_jump_insn): Handle debug insns.
(emit_call_insn): Likewise.
(emit): Likewise.
(init_emit): Take min-nondebug-insn-uid into account.
Initialize cur_debug_insn_uid.
(emit_copy_of_insn_after): Handle debug insns.
* cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite
location of single rhs in place.
(maybe_dump_rtl_for_gimple_stmt): Dump lineno.
(floor_sdiv_adjust): New.
(cell_sdiv_adjust): New.
(cell_udiv_adjust): New.
(round_sdiv_adjust): New.
(round_udiv_adjust): New.
(wrap_constant): Moved from cselib.
(unwrap_constant): New.
(expand_debug_expr): New.
(expand_debug_locations): New.
(expand_gimple_basic_block): Drop hiding redeclaration.  Expand
debug bind stmts.
(gimple_expand_cfg): Expand debug locations.
* cselib.c: Include tree-pass.h.
(struct expand_value_data): New.
(cselib_record_sets_hook): New.
(PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New.
(cselib_clear_table): Move, and implemnet in terms of...
(cselib_reset_table_with_next_value): ... this.
(cselib_get_next_unknown_value): New.
(discard_useless_locs): Don't discard preserved values.
(cselib_preserve_value): New.
(cselib_preserved_value_p): New.
(cselib_preserve_definitely): New.
(cselib_clear_preserve): New.
(cselib_preserve_only_values): New.
(new_cselib_val): Take rtx argument.  Dump it in details.
(cselib_lookup_mem): Adjust.
(expand_loc): Take regs_active in struct.  Adjust.  Silence
dumps unless details are requested.
(cselib_expand_value_rtx_cb): New.
(cselib_expand_value_rtx): Rename and reimplment in terms of...
(cselib_expand_value_rtx_1): ... this.  Adjust.  Silence dumps
without details.  Copy more subregs.  Try to resolve values
using a callback.  Wrap constants.
(cselib_subst_to_values): Adjust.
(cselib_log_lookup): New.
(cselib_lookup): Call it.
(cselib_invalidate_regno): Don't count preserved values as
useless.
(cselib_invalidate_mem): Likewise.
(cselib_record_set): Likewise.
(struct set): Renamed to cselib_set, moved to cselib.h.
(cselib_record_sets): Adjust.  Call hook.
(cselib_process_insn): Reset table when it would be cleared.
(dump_cselib_val): New.
(dump_cselib_table): New.
* tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts.
(remove_forwarder_block): Support moving debug stmts.
* cselib.h (cselib_record_sets_hook): Declare.
(cselib_expand_callback): New type.
(cselib_expand_value_rtx_cb): Declare.
(cselib_reset_table_with_next_value): Declare.
(cselib_get_next_unknown_value): Declare.
(cselib_preserve_value): Declare.
(cselib_preserved_value_p): Declare.
(cselib_preserve_only_values): Declare.
(dump_cselib_table): Declare.
* cfgcleanup.c (flow_find_cross_jump): Skip debug insns.
(try_crossjump_to_edge): Likewise.
(delete_unreachable_blocks): Remove dominant GIMPLE blocks after
dominated blocks when debug stmts are present.
* simplify-rtx.c (delegitimize_mem_from_attrs): New.
* tree-ssa-live.c (remove_unused_locals): Skip debug stmts.
(set_var_live_on_entry): Likewise.
* loop-invariant.c (find_invariants_bb): Skip debug insns.
* cfglayout.c (curr_location, last_location): Make static.
(set_curr_insn_source_location): Don't avoid bouncing.
(get_curr_insn_source_location): New.
(get_curr_insn_block): New.
(duplicate_insn_chain): Handle debug insns.
* tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate
into debug stmts.
* common.opt (fcompare-debug): Move to sort order.
(fdump-unnumbered-links): Likewise.
(fvar-tracking-assignments): New.
(fvar-tracking-assignments-toggle): New.
* tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks
because of debug stmts.
(mark_stmt_if_obviously_necessary): Mark debug stmts.
(eliminate_unnecessary_stmts): Walk dominated blocks before
dominators.
* tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts.
* ira.c (memref_used_between_p): Skip debug insns.
(update_equiv_regs): Likewise.
* sched-deps.c (sd_lists_size): Accept empty list.
(sd_init_insn): Mark debug insns.
(sd_finish_insn): Unmark them.
(sd_add_dep): Reject non-debug deps on debug insns.
(fixup_sched_groups): Give debug insns group treatment.
Skip debug insns.
(sched_analyze_reg): Don't mark debug insns for sched before call.
(sched_analyze_2): Handle debug insns.
(sched_analyze_insn): Compute next non-debug insn.  Handle debug
insns.
(deps_analyze_insn): Handle debug insns.
(deps_start_bb): Skip debug insns.
(init_deps): Initialize last_debug_insn.
* tree-ssa.c (target_for_debug_bind): New.
(find_released_ssa_name): New.
(propagate_var_def_into_debug_stmts): New.
(propagate_defs_into_debug_stmts): New.
(verify_ssa): Skip debug bind stmts without values.
(warn_uninialized_vars): Skip debug stmts.
* target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default.
* rtl.c (rtx_equal_p_cb): Handle VALUEs.
(rtx_equal_p): Likewise.
* ira-costs.c (scan_one_insn): Skip debug insns.
(process_bb_node_for_hard_reg_moves): Likewise.
* rtl.h (DEBUG_INSN_P): New.
(NONDEBUG_INSN_P): New.
(MAY_HAVE_DEBUG_INSNS): New.
(INSN_P): Accept debug insns.
(RTX_FRAME_RELATED_P): Likewise.
(INSN_DELETED_P): Likewise
(PAT_VAR_LOCATION_DECL): New.
(PAT_VAR_LOCATION_LOC): New.
(PAT_VAR_OCATION_STATUS): New.
(NOTE_VAR_LOCATION_DECL): Reimplement.
(NOTE_VAR_LOCATION_LOC): Likewise.
(NOTE_VAR_LOCATION_STATUS): Likewise.
(INSN_VAR_LOCATION): New.
(INSN_VAR_LOCATION_DECL): New.
(INSN_VAR_LOCATION_LOC): New.
(INSN_VAR_LOCATION_STATUS): New.
(gen_rtx_UNKNOWN_VAR_LOC): New.
(VAR_LOC_UNKNOWN_P): New.
(NOTE_DURING_CALL_P): New.
(SCHED_GROUP_P): Accept debug insns.
(emit_debug_insn_before): Declare.
(emit_debug_insn_before_noloc): Declare.
(emit_debug_insn_beore_setloc): Declare.
(emit_debug_insn_after): Declare.
(emit_debug_insn_after_noloc): Declare.
(emit_debug_insn_after_setloc): Declare.
(emit_debug_insn): Declare.
(make_debug_insn_raw): Declare.
(prev_nondebug_insn): Declare.
(next_nondebug_insn): Declare.
(delegitimize_mem_from_attrs): Declare.
(get_max_insn_count): Declare.
(wrap_constant): Declare.
(unwrap_constant): Declare.
(get_curr_insn_source_location): Declare.
(get_curr_insn_block): Declare.
* tree-inline.c (insert_debug_decl_map): New.
(processing_debug_stmt): New.
(remap_decl): Don't create new mappings in debug stmts.
(remap_gimple_op_r): Don't add references in debug stmts.
(copy_tree_body_r): Likewise.
(remap_gimple_stmt): Handle debug bind stmts.
(copy_bb): Skip debug stmts.
(copy_edges_for_bb): Likewise.
(copy_debug_stmt): New.
(copy_debug_stmts): New.
(copy_body): Copy debug stmts at the end.
(insert_init_debug_bind): New.
(insert_init_stmt): Take id.  Skip and emit debug stmts.
(setup_one_parameter): Remap variable earlier, register debug
mapping.
(estimate_num_insns): Skip debug stmts.
(expand_call_inline): Preserve debug_map.
(optimize_inline_calls): Check for no debug_stmts left-overs.
(unsave_expr_now): Preserve debug_map.
(copy_gimple_seq_and_replace_locals): Likewise.
(tree_function_versioning): Check for no debug_stmts left-overs.
Init and destroy debug_map as needed.  Split edges unconditionally.
(build_duplicate_type): Init and destroy debug_map as needed.
* tree-inline.h: Include gimple.h instead of pointer-set.h.
(struct copy_body_data): Add debug_stmts and debug_map.
* sched-int.h (struct ready_list): Add n_debug.
(struct deps): Add last_debug_insn.
(DEBUG_INSN_SCHED_P): New.
(BOUNDARY_DEBUG_INSN_P): New.
(SCHEDULE_DEBUG_INSN_P): New.
(sd_iterator_cond): Accept empty list.
* combine.c (create_log_links): Skip debug insns.
(combine_instructions): Likewise.
(cleanup_auto_inc_dec): New.  From Jakub Jelinek: Make sure the
return value is always unshared.
(struct rtx_subst_pair): New.
(auto_adjust_pair): New.
(propagate_for_debug_subst): New.
(propagate_for_debug): New.
(try_combine): Skip debug insns.  Propagate removed defs into
debug insns.
(next_nonnote_nondebug_insn): New.
(distribute_notes): Use it.  Skip debug insns.
(distribute_links): Skip debug insns.
* tree-outof-ssa.c (set_location_for_edge): Likewise.
* resource.c (mark_target_live_regs): Likewise.
* var-tracking.c: Include cselib.h and target.h.
(enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and
MO_VAL_SET.
(micro_operation_type_name): New.
(enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN.
(struct micro_operation_def): Update comments.
(decl_or_value): New type.  Use instead of decls.
(struct emit_note_data_def): Add vars.
(struct attrs_def): Use decl_or_value.
(struct variable_tracking_info_def): Add permp, flooded.
(struct location_chain_def): Update comment.
(struct variable_part_def): Use decl_or_value.
(struct variable_def): Make var_part a variable length array.
(valvar_pool): New.
(scratch_regs): New.
(cselib_hook_called): New.
(dv_is_decl_p): New.
(dv_is_value_p): New.
(dv_as_decl): New.
(dv_as_value): New.
(dv_as_opaque): New.
(dv_onepart_p): New.
(dv_pool): New.
(IS_DECL_CODE): New.
(check_value_is_not_decl): New.
(dv_from_decl): New.
(dv_from_value): New.
(dv_htab_hash): New.
(variable_htab_hash): Use it.
(variable_htab_eq): Support values.
(variable_htab_free): Free from the right pool.
(attrs_list_member, attrs_list_insert): Use decl_or_value.
(attrs_list_union): Adjust.
(attrs_list_mpdv_union): New.
(tie_break_pointers): New.
(canon_value_cmp): New.
(unshare_variable): Return possibly-modified slot.
(vars_copy_1): Adjust.
(var_reg_decl_set): Adjust.  Split out of...
(var_reg_set): ... this.
(get_init_value): Adjust.
(var_reg_delete_and_set): Adjust.
(var_reg_delete): Adjust.
(var_regno_delete): Adjust.
(var_mem_decl_set): Split out of...
(var_mem_set): ... this.
(var_mem_delete_and_set): Adjust.
(var_mem_delete): Adjust.
(val_store): New.
(val_reset): New.
(val_resolve): New.
(variable_union): Adjust.  Speed up merge of 1-part vars.
(variable_canonicalize): Use unshared slot.
(VALUED_RECURSED_INTO): New.
(find_loc_in_1pdv): New.
(struct dfset_merge): New.
(insert_into_intersection): New.
(intersect_loc_chains): New.
(loc_cmp): New.
(canonicalize_loc_order_check): New.
(canonicalize_values_mark): New.
(canonicalize_values_star): New.
(variable_merge_over_cur): New.
(variable_merge_over_src): New.
(dataflow_set_merge): New.
(dataflow_set_equiv_regs): New.
(remove_duplicate_values): New.
(struct dfset_post_merge): New.
(variable_post_merge_new_vals): New.
(variable_post_merge_perm_vals): New.
(dataflow_post_merge_adjust): New.
(find_mem_expr_in_1pdv): New.
(dataflow_set_preserve_mem_locs): New.
(dataflow_set_remove_mem_locs): New.
(dataflow_set_clear_at_call): New.
(onepart_variable_different_p): New.
(variable_different_p): Use it.
(dataflow_set_different_1): Adjust.  Make detailed dump
more verbose.
(track_expr_p): Add need_rtl parameter.  Don't generate rtl
if not needed.
(track_loc_p): Pass it true.
(struct count_use_info): New.
(find_use_val): New.
(replace_expr_with_values): New.
(log_op_type): New.
(use_type): New, partially split out of...
(count_uses): ... this.  Count new micro-ops.
(count_uses_1): Adjust.
(count_stores): Adjust.
(count_with_sets): New.
(VAL_NEEDS_RESOLUTION): New.
(VAL_HOLDS_TRACK_EXPR): New.
(VAL_EXPR_IS_COPIED): New.
(VAL_EXPR_IS_CLOBBERED): New.
(add_uses): Adjust.  Generate new micro-ops.
(add_uses_1): Adjust.
(add_stores): Generate new micro-ops.
(add_with_sets): New.
(find_src_status): Adjust.
(find_src_set_src): Adjust.
(compute_bb_dataflow): Use dataflow_set_clear_at_call.
Handle new micro-ops.  Canonicalize value equivalances.
(vt_find_locations): Compute total size of hash tables for
dumping.  Perform merge for var-tracking-assignments.  Don't
disregard single-block loops.
(dump_attrs_list): Handle decl_or_value.
(dump_variable): Take variable.  Deal with decl_or_value.
(dump_variable_slot): New.
(dump_vars): Use it.
(dump_dataflow_sets): Adjust.
(set_slot_part): New, extended to support one-part variables
after splitting out of...
(set_variable_part): ... this.
(clobber_slot_part): New, split out of...
(clobber_variable_part): ... this.
(delete_slot_part): New, split out of...
(delete_variable_part): .... this.
(check_wrap_constant): New.
(vt_expand_loc_callback): New.
(vt_expand_loc): New.
(emit_note_insn_var_location): Adjust.  Handle values.  Handle
EMIT_NOTE_AFTER_CALL_INSN.
(emit_notes_for_differences_1): Adjust.  Handle values.
(emit_notes_for_differences_2): Likewise.
(emit_notes_for_differences): Adjust.
(emit_notes_in_bb): Take pointer to set.  Emit AFTER_CALL_INSN
notes.  Adjust.  Handle new micro-ops.
(vt_add_function_parameters): Adjust.  Create and bind values.
(vt_initialize): Adjust.  Initialize scratch_regs and
valvar_pool, flooded and perm..  Initialize and use cselib.  Log
operations.  Move some code to count_with_sets and add_with_sets.
(delete_debug_insns): New.
(vt_debug_insns_local): New.
(vt_finalize): Release permp, valvar_pool, scratch_regs.  Finish
cselib.
(var_tracking_main): If var-tracking-assignments is enabled
but var-tracking isn't, delete debug insns and leave.  Likewise
if we exceed limits or fail the stack adjustments tests, and
after all var-tracking processing.
More in var-tracking, from Jakub Jelinek <jakub@redhat.com>:
(dataflow_set): Add traversed_vars.
(value_chain, const_value_chain): New typedefs.
(value_chain_pool, value_chains): New variables.
(value_chain_htab_hash, value_chain_htab_eq, add_value_chain,
add_value_chains, add_cselib_value_chains, remove_value_chain,
remove_value_chains, remove_cselib_value_chains): New functions.
(shared_hash_find_slot_unshare_1, shared_hash_find_slot_1,
shared_hash_find_slot_noinsert_1, shared_hash_find_1): New
static inlines.
(shared_hash_find_slot_unshare, shared_hash_find_slot,
shared_hash_find_slot_noinsert, shared_hash_find): Update.
(dst_can_be_shared): New variable.
(unshare_variable): Unshare set->vars if shared, use shared_hash_*.
Clear dst_can_be_shared.  If set->traversed_vars is non-NULL and
different from set->vars, look up slot again instead of using the
passed in slot.
(dataflow_set_init): Initialize traversed_vars.
(variable_union): Use shared_hash_*.  Use initially NO_INSERT
lookup if set->vars is shared.  Don't keep slot cleared before
calling unshare_variable.  Unshare set->vars if needed.  Adjust
unshare_variable callers.  Clear dst_can_be_shared if needed.
Even ->refcount == 1 vars must be unshared if set->vars is shared
and var needs to be modified.
(dataflow_set_union): Set traversed_vars during canonicalization.
(VALUE_CHANGED, DECL_CHANGED): Define.
(set_dv_changed, dv_changed_p): New static inlines.
(track_expr_p): Clear DECL_CHANGED.
(dump_dataflow_sets): Set it.
(variable_was_changed): Call set_dv_changed.
(emit_note_insn_var_location): Likewise.
(changed_variables_stack): New variable.
(check_changed_vars_1, check_changed_vars_2): New functions.
(emit_notes_for_changes): Do nothing if changed_variables is
empty.  Traverse changed_variables with check_changed_vars_1,
call check_changed_vars_2 on each changed_variables_stack entry.
(emit_notes_in_bb): Add SET argument.  Just clear it at the
beginning, use it instead of local &set, don't destroy it at the
end.
(vt_emit_notes): Call dataflow_set_clear early on all
VTI(bb)->out sets, never use them, instead use emit_notes_in_bb
computed set, dataflow_set_clear also VTI(bb)->in when we are
done with the basic block.  Initialize changed_variables_stack,
free it afterwards.  If ENABLE_CHECKING verify that after noting
differences to an empty set value_chains hash table is empty.
(vt_initialize): Initialize value_chains and value_chain_pool.
(vt_finalize): Delete value_chains htab, free value_chain_pool.
(variable_tracking_main): Call dump_dataflow_sets before calling
vt_emit_notes, not after it.
* tree-flow.h (propagate_defs_into_debug_stmts): Declare.
(propagate_var_def_into_debug_stmts): Declare.
* df-problems.c (df_lr_bb_local_compute): Skip debug insns.
(df_set_note): Reject debug insns.
(df_whole_mw_reg_dead_p): Take added_notes_p argument.  Don't
add notes to debug insns.
(df_note_bb_compute): Adjust.  Likewise.
(df_simulate_uses): Skip debug insns.
(df_simulate_initialize_backwards): Likewise.
* reg-stack.c (subst_stack_regs_in_debug_insn): New.
(subst_stack_regs_pat): Reject debug insns.
(convert_regs_1): Handle debug insns.
* Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H.
(print-rtl.o): Depend on cselib.h.
(cselib.o): Depend on TREE_PASS_H.
(var-tracking.o): Depend on cselib.h and TARGET_H.
* sched-rgn.c (rgn_estimate_number_of_insns): Discount
debug insns.
(init_ready_list): Skip boundary debug insns.
(add_branch_dependences): Skip debug insns.
(free_block_dependencies): Check for blocks with only debug
insns.
(compute_priorities): Likewise.
* gimple.c (gss_for_code): Handle GIMPLE_DEBUG.
(gimple_build_with_ops_stat): Take subcode as unsigned.  Adjust
all callers.
(gimple_build_debug_bind_stat): New.
(empty_body_p): Skip debug stmts.
(gimple_has_side_effects): Likewise.
(gimple_rhs_has_side_effects): Likewise.
* gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New.
(gimple_build_debug_bind_stat): Declare.
(gimple_build_debug_bind): Define.
(is_gimple_debug): New.
(gimple_debug_bind_p): New.
(gimple_debug_bind_get_var): New.
(gimple_debug_bind_get_value): New.
(gimple_debug_bind_get_value_ptr): New.
(gimple_debug_bind_set_var): New.
(gimple_debug_bind_set_value): New.
(GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro.
(gimple_debug_bind_reset_value): New.
(gimple_debug_bind_has_value_p): New.
(gsi_next_nondebug): New.
(gsi_prev_nondebug): New.
(gsi_start_nondebug_bb): New.
(gsi_last_nondebug_bb): New.
* sched-vis.c (print_pattern): Handle VAR_LOCATION.
(print_insn): Handle DEBUG_INSN.
* tree-cfg.c (remove_bb): Walk stmts backwards.  Let loc
of first insn prevail.
(first_stmt): Skip debug stmts.
(first_non_label_stmt): Likewise.
(last_stmt): Likewise.
(has_zero_uses_1): New.
(single_imm_use_1): New.
(verify_gimple_debug): New.
(verify_types_in_gimple_stmt): Handle debug stmts.
(verify_stmt): Likewise.
(debug_loop_num): Skip debug stmts.
(remove_edge_and_dominated_blocks): Remove dominators last.
* tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into
debug stmts.
(linearize_expr): Likewise.
* config/i386/i386.c (ix86_delegitimize_address): Call
default implementation.
* config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug
insns.
(group_barrier_needed): Skip debug insns.
(emit_insn_group_barriers): Likewise.
(emit_all_insn_group_barriers): Likewise.
(ia64_variable_issue): Handle debug insns.
(ia64_dfa_new_cycle): Likewise.
(final_emit_insn_group_barriers): Skip debug insns.
(ia64_dwarf2out_def_steady_cfa): Take frame argument.  Don't
def cfa without frame.
(process_set): Likewise.
(process_for_unwind_directive): Pass frame on.
* config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define.
(rs6000_delegitimize_address): New.
(rs6000_debug_adjust_cost): Handle debug insns.
(is_microcoded_insn): Likewise.
(is_cracked_insn): Likewise.
(is_nonpipeline_insn): Likewise.
(insn_must_be_first_in_group): Likewise.
(insn_must_be_last_in_group): Likewise.
(force_new_group): Likewise.
* cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block
contains only debug insns.
(rtl_merge_blocks): Skip debug insns.
(purge_dead_edges): Likewise.
(rtl_block_ends_with_call_p): Skip debug insns.
* dce.c (deletable_insn_p): Handle VAR_LOCATION.
(mark_reg_dependencies): Skip debug insns.
* params.def (PARAM_MIN_NONDEBUG_INSN_UID): New.
* tree-ssanames.c (release_ssa_name): Propagate def into
debug stmts.
* tree-ssa-threadedge.c
(record_temporary_equivalences_from_stmts): Skip debug stmts.
* regcprop.c (replace_oldest_value_addr): Skip debug insns.
(replace_oldest_value_mem): Use ALL_REGS for debug insns.
(copyprop_hardreg_forward_1): Handle debug insns.
* reload1.c (reload): Skip debug insns.  Replace unassigned
pseudos in debug insns with their equivalences.
(eliminate_regs_in_insn): Skip debug insns.
(emit_input_reload_insns): Skip debug insns at first, adjust
them later.
* tree-ssa-operands.c (add_virtual_operand): Reject debug stmts.
(get_indirect_ref_operands): Pass opf_no_vops on.
(get_expr_operands): Likewise.  Skip debug stmts.
(parse_ssa_operands): Scan debug insns with opf_no_vops.
gcc/testsuite/ChangeLog:
* gcc.dg/guality/guality.c: New.
* gcc.dg/guality/guality.h: New.
* gcc.dg/guality/guality.exp: New.
* gcc.dg/guality/example.c: New.
* lib/gcc-dg.exp (cleanup-dump): Remove .gk files.
(cleanup-saved-temps): Likewise, .gkd files too.
gcc/cp/ChangeLog:
* cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
* cp-lang.c (cxx_dwarf_name): Pass it.
* error.c (count_non_default_template_args): Take flags as
argument.  Adjust all callers.  Skip counting of default
arguments if the new flag is given.
ChangeLog:
* Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug.
* Makefile.in: Rebuilt.
contrib/ChangeLog:
* compare-debug: Look for .gkd files and compare them.
config/ChangeLog:
* bootstrap-debug.mk: Add comments.
* bootstrap-debug-big.mk: New.
* bootstrap-debug-lean.mk: New.
* bootstrap-debug-ckovw.mk: Add comments.
* bootstrap-debug-lib.mk: Drop CFLAGS for stages.  Use -g0
for TFLAGS in stage1.  Drop -fvar-tracking-assignments-toggle.

From-SVN: r151312
2009-09-02 02:42:21 +00:00
Aldy Hernandez e74fe492f1 diagnostic.c (diagnostic_build_prefix): Always print columns.
gcc/
	* diagnostic.c (diagnostic_build_prefix): Always print columns.
	(diagnostic_report_current_module): Print columns.
	* common.opt (flag_show_column): Enable by default.
gcc/testsuite/
	* lib/gcc-dg.exp (dg-bogus): Override dg-bogus.
	(process-message): Expect column numbers.
	* gcc.dg/va-arg-2.c: Use line 0 to indicate no column.
	* gcc.dg/pch/counter-2.c: Same.
	* gcc.dg/pch/valid-2.c: Same.
	* gcc.dg/pch/warn-1.c: Same.
	* gcc.dg/pch/valid-1.c: Same.
	* gcc.dg/cpp/include2a.c: Handle lack of columns.
	* gcc.dg/cpp/syshdr.c: Same.
	* gcc.dg/cpp/19940712-1.c: Same.
	* gcc.dg/cpp/missing-header-1.c: Same.
	* gcc.dg/cpp/unc4.c: Remove -fno-show-column.
	* gcc.dg/cpp/tr-warn3.c: Same.
	* gcc.dg/cpp/pr29612-2.c: Same.
	* gcc.dg/cpp/tr-warn4.c: Same.
	* gcc.dg/cpp/Wtrigraphs.c: Same.
	* gcc.dg/cpp/poison.c: Same.
	* gcc.dg/cpp/arith-3.c: Same.
	* gcc.dg/cpp/sysmac2.c: Same.
	* gcc.dg/cpp/cpp.exp: Same.
	* gcc.dg/cpp/tr-warn5.c: Same.
	* gcc.dg/cpp/include2.c: Same.
	* gcc.dg/cpp/Wmissingdirs.c: Same.
	* gcc.dg/cpp/Wmissingdirs.c: Same.
	* gcc.dg/cpp/tr-warn6.c: Same.
	* gcc.dg/cpp/Wtrigraphs-2.c: Same.
	* gcc.dg/cpp/macspace1.c: Same.
	* gcc.dg/cpp/escape-2.c: Same.
	* gcc.dg/cpp/assert2.c: Same.
	* gcc.dg/cpp/undef2.c: Same.
	* gcc.dg/cpp/macspace2.c: Same.
	* gcc.dg/cpp/tr-warn1.c: Same.
	* gcc.dg/cpp/extratokens2.c: Same.
	* gcc.dg/cpp/strify2.c: Same.
	* gcc.dg/cpp/Wsignprom.c: Same.
	* gcc.dg/cpp/redef2.c: Same.
	* gcc.dg/cpp/trad/trad.exp: Same.
	* gcc.dg/cpp/arith-1.c: Same.
	* gcc.dg/cpp/extratokens.c: Same.
	* gcc.dg/cpp/if-mpar.c: Same.
gcc/cp/
	* error.c (print_instantiation_partial_context): Print column
	numbers.
libcpp/
	* include/line-map.h (LAST_SOURCE_COLUMN): New.

From-SVN: r148052
2009-06-01 16:09:33 +00:00
Diego Novillo dab71827a9 diagnostic.c (diagnostic_report_diagnostic): Do not warn about loaded plugins for DK_ERROR and DK_WARNING.
* diagnostic.c (diagnostic_report_diagnostic): Do not
	warn about loaded plugins for DK_ERROR and DK_WARNING.
	* c-decl.c (declspecs_add_type): Move call to
	invoke_plugin_callbacks ...
	* c-parser.c (c_parser_declspecs): ... here.
	* plugin.c (dump_active_plugins): Tidy output.

cp/ChangeLog

	* parser.c (cp_parser_type_specifier_seq): Move call to
	invoke_plugin_callbacks ...
	(cp_parser_type_specifier_seq): ... here.

From-SVN: r146078
2009-04-14 23:41:28 -04:00
Diego Novillo 68a607d814 [multiple changes]
2009-04-14  Diego Novillo  <dnovillo@google.com>
	    Le-Chun Wu  <lcwu@google.com>

	* configure.ac: Add --enable-plugin support.
	Define ENABLE_PLUGIN and PLUGINLIBS when specified.
	* Makefile.in (PLUGIN_H): Define.
	Export ENABLE_PLUGIN and GMPINC to site.exp.
	Add PLUGINLIBS to link command.
	Add/modify dependencies for plugin.o and files including plugin.h.
	(plugin.o): New.
	* config.in: Regenerate.
	
	* opts.c (common_handle_option): Handle OPT_fplugin_ and
	OPT_fplugin_arg_.

2009-04-14  Le-Chun Wu  <lcwu@google.com>

	* tree-pass.h (register_one_dump_file): Add a prototype for
	register_one_dump_file.
	* toplev.c (compile_file): Call initialize_plugins.
	(do_compile): Call invoke_plugin_callbacks.
	(toplev_main): Call invoke_plugin_callbacks.
	* common.opt: Add -fplugin= and -fplugin-arg-.
	* gcc-plugin.h: New public header file for plugins to include.
	* plugin.c: New source file.
	* plugin.h: New internal header file.
	* passes.c (register_one_dump_file): Make it external.
	
	* c-parser.c (c_parser_declspecs): Call invoke_plugin_callbacks.

2009-04-14  Diego Novillo  <dnovillo@google.com>

	* doc/plugins.texi: New.
	* doc/gccint.texi: Add reference to Plugins chapter.
	* doc/invoke.texi: Document -fplugin and -fplugin-arg
	* diagnostic.c (diagnostic_report_diagnostic): Warn about
	loaded plugins, if any.
	* timevar.def (TV_PLUGIN_INIT): Define.
	(TV_PLUGIN_RUN): Define.
	* plugin.c: Include timevar.h
	(plugins_active_p): New.
	(dump_active_plugins): New.
	(debug_active_plugins): New.


cp/ChangeLog

2009-04-14  Le-Chun Wu  <lcwu@google.com>

	* Make-lang.in: Modify dependencies of files including plugin.h.
	* decl.c (finish_function): Call invoke_plugin_callbacks.
	* parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.

From-SVN: r146059
2009-04-14 16:18:49 -04:00
Joseph Myers 148e4216a4 re PR preprocessor/34695 (Preprocessor warning->error conversion from -Werror is silent)
PR preprocessor/34695

gcc:
	* Makefile.in (c-opts.o): Depend on c-tree.h.
	* c-common.c: Move down include of diagnostic.h.
	(done_lexing, c_cpp_error): New.
	* c-common.h (done_lexing): Declare.
	* c-decl.c (c_write_global_declarations): Don't check cpp_errors
	(parse_in).
	* c-opts.c: Include c-tree.h.
	(c_common_init_options): Set preprocessor error callback.
	(c_common_handle_option): Do not set preprocessor
	inhibit_warnings, warnings_are_errors, warn_system_headers,
	pedantic_errors or inhibit_warnings flags.
	(c_common_post_options): Do not check cpp_errors (parse_in).
	(c_common_finish): Do not output dependencies if there were
	errors.  Do not check return value of cpp_finish.
	* c-ppoutput.c (pp_file_change): Set input_location.
	* c-tree.h (c_cpp_error): Declare.
	* diagnostic.c (diagnostic_set_info_translated): Also initialize
	override_column.
	(diagnostic_build_prefix): Check override_column.
	* diagnostic.h (diagnostic_info): Add override_column field.
	(diagnostic_override_column): Define.

gcc/cp:
	* cp-tree.h (cp_cpp_error): Remove.
	* error.c (cp_cpp_error): Remove.
	* parser.c (cp_lexer_new_main): Set done_lexing instead of
	client_diagnostic and error callback.

gcc/fortran:
	* cpp.c (cb_cpp_error): New.
	(gfc_cpp_post_options): Don't set cpp_option->inhibit_warnings.
	Don't check cpp_errors (cpp_in).
	(gfc_cpp_init_0): Set cb->error.

gcc/testsuite:
	* gcc.dg/builtin-redefine.c, gcc.dg/cpp/redef2.c,
	gcc.dg/cpp/redef3.c, gcc.dg/cpp/trad/redef2.c: Use dg-message
	instead of dg-warning for "previous definition" messages.
	* gcc.dg/cpp/Wvariadic-1.c, gcc.dg/cpp/Wvariadic-3.c: Expect
	"warnings being treated as errors" message.
	* gcc.dg/fltconst-1.c: Use -fshow-column.

libcpp:
	* makedepend.c: Remove.
	* Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
	(all, clean, TAGS_SOURCES, include): Remove makedepend handling.
	* directives.c (cpp_errors): Remove.
	* errors.c (print_location, _cpp_begin_message, v_message):
	Remove.
	(cpp_error, cpp_error_with_line): Always use error callback.
	(cpp_error, cpp_error_with_line, cpp_errno): Return bool.
	* include/cpplib.h (cpp_options): Remove pedantic_errors,
	inhibit_warnings, warn_system_headers, inhibit_errors,
	warnings_are_errors, client_diagnostic.
	(cpp_callbacks): Add extra arguments to error callback; make it
	return bool.
	(cpp_finish): Return void.
	(cpp_destroy): Remove inaccurate comment about return value.
	(cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
	(CPP_DL_NOTE): Define.
	* include/line-map.h (linemap_print_containing_files): Remove.
	* init.c (cpp_finish): Do not check for or return number of
	errors.
	* internal.h (cpp_reader): Remove errors field.
	* line-map.c (linemap_print_containing_files): Remove.
	* macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
	about previous definition.  Only emit it if previous diagnostic
	was emitted.

From-SVN: r145263
2009-03-29 23:56:07 +01:00
Aldy Hernandez a63068b6dd diagnostic.c (error_at): New.
* diagnostic.c (error_at): New.
        * toplev.h (error_at): New prototype.
        * c-typeck.c (build_array_ref): Call error_at instead of error.
        Pass location to pedwarn.
cp/
        * typeck.c (build_array_ref): Use new location argument.
        * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
        * call.c (build_new_op): Same.
        * decl2.c (grok_array_decl): Same.
        * cp-tree.h (build_array_ref): Add location argument to prototype.

From-SVN: r139924
2008-09-03 01:00:04 +00:00
Manuel López-Ibáñez 509c9d60e4 diagnostic.c (pedwarn_at): Rename as pedwarn.
2008-08-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* diagnostic.c (pedwarn_at): Rename as pedwarn.
	(pedwarn): Delete.
	* toplev.h (pedwarn_at): Likewise.
	* builtins.c: Update all calls to pedwarn.
	* c-lex.c: Likewise.
	* toplev.c: Likewise.
	* c-tree.h: Likewise.
	* c-decl.c: Likewise.
	* c-errors.c: Likewise.
	* c-typeck.c: Likewise.
	* c-common.c: Likewise.
	* c-parser.c: Likewise.
cp/
	* typeck.c: Update all calls to pedwarn.
	* decl.c: Likewise.
	* call.c: Likewise.
	* error.c: Likewise.
	* pt.c: Likewise.
	* name-lookup.c: Likewise.
	* parser.c: Likewise.
fortran/	
	* f95-lang.c: Update all calls to pedwarn.

From-SVN: r139373
2008-08-21 10:55:13 +00:00
Manuel López-Ibáñez 1f5b386928 diagnostic.c (inform): Add an explicit location_t parameter.
2008-08-18  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* diagnostic.c (inform): Add an explicit location_t parameter.
	* toplev.h (inform): Update declaration.
	* builtins.c: Update all calls to inform.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* c-pch.c: Likewise.
	* c-pragma.c: Likewise.
	* c-typeck.c: Likewise.
	* coverage.c: Likewise.
	* opts.c: Likewise.
	* toplev.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-ssa.c: Likewise.
cp/	
	* parser.c: Update all calls to inform.
	* typeck.c: Likewise.
	* init.c: Likewise.
	* class.c: Likewise.
	* call.c: Likewise.
	* method.c: Likewise.
	* friend.c: Likewise.
	* typeck2.c: Likewise.
	* pt.c: Likewise.
	* name-lookup.c: Likewise.
	* lex.c: Likewise.

From-SVN: r139293
2008-08-20 13:35:00 +00:00
Manuel López-Ibáñez cbe5f3b371 diagnostics.c (permerror_at): Rename as permerror.
2008-08-18  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* diagnostics.c (permerror_at): Rename as permerror.
	(permerror): Delete.
	* toplev.h: Likewise.
cp/	
	* typeck.c: Update all callers.
	* init.c: Likewise.
	* class.c: Likewise.
	* decl.c: Likewise.
	* call.c: Likewise.
	* except.c: Likewise.
	* cvt.c: Likewise.
	* typeck2.c: Likewise.
	* pt.c: Likewise.
	* semantics.c: Likewise.
	* name-lookup.c: Likewise.
	* lex.c: Likewise.
	* decl2.c: Likewise.
	* parser.c: Likewise.

From-SVN: r139193
2008-08-18 11:17:52 +00:00
Manuel López-Ibáñez 85790e6677 re PR c/15236 (pedantic switch modifies treatment of non-ISO compliant enumerations)
2008-08-13  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR c/15236
	* diagnostic.c (pedwarn_at): New.
	* toplev.h (pedwarn_at): Declare.
	* c-tree.h (build_enumerator): Update declaration.
	* c-decl.c (finish_enum): Update comment.
	(build_enumerator): Take a location parameter. Give a pedwarn but do
	not perform any conversion.
	* c-parser.c (c_parser_enum_specifier): Set correct location for
	enumerator.
testsuite/
	* gcc.dg/pr15236.c: New.
	* gcc.dg/torture/pr25183.c: Update.

From-SVN: r139050
2008-08-13 10:19:03 +00:00
Manuel López-Ibáñez 71205d170c re PR other/36901 (pedwarn() + -pedantic-errors + -w (inhibit_warnings) should not emit errors)
2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 36901
	* diagnostic.def (DK_PEDWARN, DK_PERMERROR): New.  
	* diagnostic.c (pedantic_warning_kind, permissive_error_kind):
	Moved from diagnostic.h
	(diagnostic_report_diagnostic): Return bool. Handle DK_PEDWARN and
	DK_PERMERROR.
	(emit_diagnostic): New.
	(warning0, pedwarn0): Delete.
	(warning, warning_at, pedwarn, permerror): Return bool.  
	* diagnostic.h (pedantic_warning_kind, permissive_error_kind):
	Moved to diagnostic.c.
	(struct diagnostic_context): Use correct type for
	classify_diagnostic.
	(diagnostic_report_diagnostic): Update declaration.
	(emit_diagnostic): Declare.
	* errors.c (warning): Return bool.  
	* errors.h (warning): Update declaration.
	* toplev.h (warning0, pedwarn0): Delete.
	(warning, warning_at, pedwarn, permerror): Return bool.
	* c-errors.c (pedwarn_c99, pedwarn_c90): Use DK_PEDWARN.
	* c-decl.c (locate_old_decl): Delete 'diag' argument. Always use
	inform. Update all calls.
	(diagnose_mismatched_decls): Check return value of warning/pedwarn
	before giving informative note.
	(implicit_decl_warning): Likewise.  
	* c-typeck.c (build_function_call): Likewise.  
	* tree-sssa.c (warn_uninit): Likewise.  
	* builtins.c (gimplify_va_arg_expr): Likewise.
fortran/
	* f95-lang.c (gfc_mark_addressable): Use "pedwarn (0," instead of
	'pedwarn0'.
cp/
	* cp-tree.h (struct diagnostic_context, struct diagnostic_info):
	Delete forward declarations. Check that toplev.h has not been
	included before this file. Include toplev.h and diagnostic.h.
	* error.c (cp_cpp_error): Use DK_PEDWARN.
	(cxx_incomplete_type_diagnostic): Update declaration.
	(cxx_incomplete_type_error): Use DK_ERROR.
	* typeck2.c (cxx_incomplete_type_diagnostic): Take a diagnostic_t
	as argument. Use emit_diagnostic.
	(cxx_incomplete_type_error): Use DK_ERROR.
	(add_exception_specifier): Use diagnostic_t instead of custom
	codes.  
	* typeck.c (complete_type_or_else): Update call to
	cxx_incomplete_type_diagnostic.
	* init.c (build_delete): Likewise.  
	* call.c (diagnostic_fn_t): Remove unused typedef.
	(build_temp): Pass a pointer to diagnostic_t.
	(convert_like_real): Use emit_diagnostic.
	(joust): Check return value of warning before giving informative
	note.  
	* friend.c (do_friend): Check return value of warning
	before giving informative note.
	* parser.c (cp_parser_template_id): Likewise.

testsuite/
	* gcc.dg/pr36901-1.c: New.
	* gcc.dg/pr36901-3.c: New.
	* gcc.dg/pr36901-2.c: New.
	* gcc.dg/pr36901-4.c: New.
	* gcc.dg/pr36901-system.h: New.
	* gcc.dg/pr36901.h: New.
	* gcc.target/powerpc/altivec-macros.c: Update.
	* gcc.target/i386/regparm.c: Update.
	* gcc.dg/funcdef-var-1.c: Update.
	* gcc.dg/parm-mismatch-1.c: Update.
	* gcc.dg/attr-noinline.c: Update.
	* gcc.dg/wtr-static-1.c: Update.
	* gcc.dg/redecl-11.c: Update.
	* gcc.dg/pr27953.c: Update.
	* gcc.dg/proto-1.c: Update.
	* gcc.dg/decl-3.c: Update.
	* gcc.dg/redecl-13.c: Update.
	* gcc.dg/pr15360-1.c: Update.
	* gcc.dg/redecl-15.c: Update.
	* gcc.dg/enum-compat-1.c: Update.
	* gcc.dg/dll-3.c: Update.
	* gcc.dg/array-5.c: Update.
	* gcc.dg/Wredundant-decls-2.c: Update.
	* gcc.dg/inline4.c: Update.
	* gcc.dg/redecl-2.c: Update.
	* gcc.dg/inline-14.c: Update.
	* gcc.dg/tls/diag-3.c: Update.
	* gcc.dg/funcdef-var-2.c: Update.
	* gcc.dg/20041213-1.c: Update.
	* gcc.dg/old-style-then-proto-1.c: Update.
	* gcc.dg/decl-2.c: Update.
	* gcc.dg/redecl-12.c: Update.
	* gcc.dg/decl-4.c: Update.
	* gcc.dg/Wshadow-1.c: Update.
	* gcc.dg/transparent-union-2.c: Update.
	* gcc.dg/visibility-7.c: Update.
	* gcc.dg/dll-2.c: Update.
	* gcc.dg/redecl-16.c: Update.
	* gcc.dg/inline1.c: Update.
	* gcc.dg/decl-8.c: Update.
	* gcc.dg/nested-redef-1.c: Update.
	* gcc.dg/inline3.c: Update.
	* gcc.dg/redecl-1.c: Update.
	* gcc.dg/inline5.c: Update.
	* gcc.dg/pr35899.c: Update.
	* gcc.dg/noncompile/label-lineno-1.c: Update.
	* gcc.dg/noncompile/label-1.c: Update.
	* gcc.dg/noncompile/20020220-1.c: Update.
	* gcc.dg/noncompile/redecl-1.c: Update.
	* gcc.dg/redecl-5.c: Update.
	* gcc.dg/qual-return-3.c: Update.
	* gcc.dg/label-decl-4.c: Update.

From-SVN: r138893
2008-08-08 23:57:19 +00:00
Manuel López-Ibáñez 7e99f74bbb re PR c++/26785 ("extra qualification" error gives line number of end of declaration)
2008-08-06  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 26785
	* diagnostic.c (permerror_at): New.
	* toplev.h (permerror_at): Declare.
cp/
	* decl.c (grokdeclarator): Use explicit location with
        permerror_at.
testsuite/
	* g++.dg/warn/pr26785.C: New.

From-SVN: r138816
2008-08-06 16:37:06 +00:00
Manuel López-Ibáñez fcf73884fb re PR c/35058 (-Werror= works only with some warnings)
2008-07-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 35058
	* diagnostic.c (pedwarn): Add opt parameter.
	(pedwarn0): New.
	* c-tree.h (pedwarn_init): Add opt parameter.
	(pedwarn_c90): Likewise.
	(pedwarn_c99): Likewise.
	* c-errors.c (pedwarn_c99): Likewise.
	(pedwarn_c90): Likewise.
	* toplev.h (pedwarn): Update declaration.
	(pedwarn0): Declare.
	* c-lex.c: All calls to pedwarn changed.
	* builtins.c: All calls to pedwarn changed.
	* toplev.c: All calls to pedwarn changed.
	* c-decl.c: All calls to pedwarn changed.
	* c-typeck.c: All calls to pedwarn changed.
	* c-common.c: All calls to pedwarn changed.
	* c-parser.c: All calls to pedwarn changed.
cp/
	* typeck.c: All calls to pedwarn changed.
	* decl.c: All calls to pedwarn changed.
	* call.c: All calls to pedwarn changed.
	* error.c: All calls to pedwarn changed.
	* typeck2.c: All calls to pedwarn changed.
	* pt.c: All calls to pedwarn changed.
	* name-lookup.c: All calls to pedwarn changed.
	* parser.c: All calls to pedwarn changed.
fortran/
	* f95-lang.c (gfc_mark_addressable): All calls to pedwarn changed.
testsuite/
	* gcc.dg/Wdeclaration-after-statement-3.c: New.
	* gcc/testsuite/gcc.dg/Wpointer-arith.c: New.

From-SVN: r138089
2008-07-23 15:57:49 +00:00
Rafael Avila de Espindola aa14403d28 Makefile.in: Replace toplev.h with TOPLEV_H.
2007-07-21  Rafael Avila de Espindola  <espindola@google.com>

	* Makefile.in: Replace toplev.h with TOPLEV_H.
	* c-decl.c (merge_decls): Don't set DECL_IN_SYSTEM_HEADER.
	* c-lex.c (fe_file_change): Don't set in_system_header.
	* c-parser.c (c_token): Remove in_system_header.
	(c_lex_one_token): Don't set in_system_header.
	(c_parser_set_source_position_from_token): Don't set in_system_header.
	* diagnostic.c (diagnostic_report_diagnostic): Use location from
	diagnostic_info.
	(warning_at): New.
	* diagnostic.h (diagnostic_report_warnings_p): Add LOC argument.
	* flags.h (in_system_header): Remove.
	* function.c (saved_in_system_header): Remove.
	(push_cfun): Don't set in_system_header.
	(pop_cfun): Don't set in_system_header.
	(push_struct_function): Don't set in_system_header.
	* input.h (expanded_location): Add sysp.
	(in_system_header_at): New.
	(in_system_header): New.
	* toplev.c (in_system_header): Remove.
	* toplev.h: Include input.h
	(warning_at): New.
	* tree-cfg.c (execute_warn_function_return): Call warning_at.
	* tree-ssa.c (warn_uninit): Call warning_at.
	(warn_uninitialized_var): Update calls to warn_uninit.
	(warn_uninitialized_phi): Update calls to warn_uninit.
	* tree.c (make_node_stat): Don't set DECL_IN_SYSTEM_HEADER.
	(expand_location): Initialize xloc.sysp.
	* tree.h (DECL_IN_SYSTEM_HEADER): Use in_system_header_at.
	(tree_decl_with_vis): Remove in_system_header_flag.

2007-07-21  Rafael Avila de Espindola  <espindola@google.com>

	* parser.c (cp_token): Remove in_system_header.
	(eof_token): Remove in_system_header.
	(cp_lexer_get_preprocessor_token): Don't set in_system_header.
	(cp_lexer_set_source_position_from_token): Don't set in_system_header.
	(cp_parser_member_declaration):  Use in_system_header_at.
	* pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
	(pop_tinst_level): Don't set in_system_header.
	(instantiate_class_template): Don't set in_system_header.
	(instantiate_decl): Don't set in_system_header.
	(instantiate_pending_templates): Don't set in_system_header.

From-SVN: r138031
2008-07-21 14:29:27 +00:00
Manuel López-Ibáñez 52249a2e3f diagnostic.c (diagnostic_count_diagnostic): Delete.
2008-03-24  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* diagnostic.c (diagnostic_count_diagnostic): Delete.
	(diagnostic_report_diagnostic): Update. Handle ICEs here.

From-SVN: r133478
2008-03-24 14:19:55 +00:00
Manuel López-Ibáñez 393eda6a41 re PR c++/24924 (front end and preprocessor pedantic_errors settings should agree)
2008-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org> 

	PR 24924
	* c-common.c (flag_permissive): Delete.
	(constant_expression_warnings): Check flags first.
	(constant_expression_error): New.
	* c-common.h (flag_permissive): Delete.
	(constant_expression_error): Declare.
	* flags.h (flag_permissive): Declare. Update description.
	* diagnostic.c (pedwarn): Update.
	(permerror): New.
	* diagnostic.h: (pedantic_error_kind): Rename as pedantic_warning_kind.
	(permissive_error_kind): New.
	* toplev.c (flag_permissive): Define. Update description.
	* toplev.h (permissive_error_kind): Declare.
	* c-errors.c (pedwarn_c99): Use pedantic_warning_kind.
	(pedwarn_c90): Use pedantic_warning_kind.
	* c-opts.c (c_common_post_options): flag_permissive does not affect
	flag_pedantic_errors.
cp/
	* class.c (finish_struct_anon): Use permerror instead of pedwarn.
	(check_field_decls): Likewise.
	(note_name_declared_in_class): Likewise.
	* call.c (build_new_op): Likewise.
	(convert_like_real): Likewise.
	(build_over_call): Likewise.
	* lex.c (unqualified_fn_lookup_error): Likewise.
	* parser.c (cp_parser_template_id): Likewise.
	* cvt.c (warn_ref_binding): Likewise.
	(convert_to_reference): Likewise.
	(ocp_convert): Likewise.
	(convert_to_void): Use error instead of pedwarn.
	* error.c (cp_cpp_error): Use pedantic_warning_kind.
	* decl.c (compute_array_index_type): Use constant_expression_error.
testsuite/
	* g++.dg/cpp/string-2.C: This is a warning now.
	* g++.dg/cpp/pedantic-errors.C: -pedantic-errors is not enabled by
	default, so add it.

From-SVN: r132817
2008-03-02 15:45:29 +00:00
Tom Tromey 966e8f4d3f toplev.c (input_file_stack, [...]): Remove.
gcc
	* toplev.c (input_file_stack, input_file_stack_tick, fs_p,
	input_file_stack_history, input_file_stack_restored): Remove.
	(push_srcloc, pop_srcloc, restore_input_file_stack): Likewise.
	* input.h (struct file_stack): Remove.
	(push_srcloc, pop_srcloc, restore_input_file_stack): Likewise.
	(input_file_stack, input_file_stack_tick, INPUT_FILE_STACK_BITS):
	Likewise.
	* diagnostic.h (struct diagnostic_context) <last_module>: Change
	type.
	(diagnostic_last_module_changed): Add 'map' argument.
	(diagnostic_set_last_function): Likewise.
	* diagnostic.c (undiagnostic_report_current_module): Iterate using
	line map, not input_file_stack.
	* c-lex.c (fe_file_change): Don't use push_srcloc or pop_srcloc.
gcc/cp
	* parser.c (struct cp_token) <input_file_stack_index>: Remove.
	(cp_lexer_get_preprocessor_token): Update.
	(cp_lexer_set_source_position_from_token): Don't call
	restore_input_file_stack.
	* lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
gcc/testsuite
	* g++.dg/warn/pragma-system_header2.C: Ignore "included from"
	line.

From-SVN: r132775
2008-02-29 20:09:05 +00:00
Tom Tromey 2d593c86cf system.h (USE_MAPPED_LOCATION): Poison.
gcc
	* system.h (USE_MAPPED_LOCATION): Poison.
	* Makefile.in (GTFILES): Put CPP_ID_DATA_H first.
	* tree-cfg.c (make_cond_expr_edges): Remove old location code.
	(make_goto_expr_edges): Likewise.
	(remove_bb): Likewise.
	(execute_warn_function_return): Likewise.
	* basic-block.h (struct edge_def) <goto_locus>: Change type to
	location_t.
	* c-common.c (fname_decl): Remove old location code.
	* tree-vect-transform.c (vect_finish_stmt_generation): Remove old
	location code.
	* rtl.h (ASM_OPERANDS_SOURCE_LOCATION): Remove old-location
	variant.
	(ASM_INPUT_SOURCE_LOCATION): Likewise.
	(gen_rtx_ASM_INPUT): Likewise.
	(gen_rtx_ASM_INPUT_loc): Likewise.
	(get_rtx_asm_OPERANDS): Remove.
	* cfglayout.c (insn_locators_alloc): Remove old location code.
	(set_curr_insn_source_location): Likewise.
	(curr_insn_locator): Likewise.
	* print-tree.c (print_node): Remove old location code.
	* tree-mudflap.c (mf_varname_tree): Remove old location code.
	(mf_file_function_line_tree): Remove test of USE_MAPPED_LOCATION.
	* cfgexpand.c (expand_gimple_cond_expr): Don't use
	location_from_locus.
	(construct_exit_block): Remove old location code.
	* emit-rtl.c (force_next_line_note): Remove old location code.
	* profile.c (branch_prob): Remove old location code.
	* tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE,
	LOC_LINE): Remove old-location variants.
	* langhooks.c (lhd_print_error_function): Remove old location
	code.
	* configure, config.in: Rebuilt.
	* configure.ac (--enable-mapped-location): Remove.
	* c-decl.c (c_init_decl_processing): Remove old location code.
	(finish_function): Likewise.
	* recog.c (decode_asm_operands): Remove old location code.
	* c-pch.c (c_common_read_pch): Remove old location code.
	* rtl.def (ASM_INPUT, ASM_OPERANDS): Remove old location
	variants.
	* gimple-low.c (lower_function_body): Remove old location code.
	* toplev.c (unknown_location): Remove.
	(push_srcloc): Remove old-location variant.
	(process_options): Remove old location code.
	(lang_dependent_init): Likewise.
	* input.h (UNKNOWN_LOCATION): Move definition.
	(location_t): Undeprecate.
	(source_locus): Remove.
	(location_from_locus): Remove.
	(struct location_s): Remove.
	Remove all old-location code.
	(input_line, input_filename): Remove.
	* final.c (final_scan_insn): Remove old location code.
	* diagnostic.c (diagnostic_build_prefix): Remove
	USE_MAPPED_LOCATION test.
	* tree.h (gimple_stmt) <locus>: Now a location_t.
	(tree_exp) <locus>: Likewise.
	(DECL_IS_BUILTIN): Remove old-location variant.
	(annotate_with_file_line, annotate_with_locus): Likewise.
	(expr_locus, set_expr_locus): Update.
	* tree.c (build1_stat): Remove old location code.
	(last_annotated_node): Remove.
	(annotate_with_file_line): Remove old-location variant.
	(annotate_with_locus): Likewise.
	(expr_location): Remove old location code.
	(set_expr_location): Likewise.
	(expr_has_location): Likewise.
	(expr_locus): Likewise.
	(set_expr_locus): Likewise.
	(expr_filename): Don't use location_from_locus.
	(expr_lineno): Likewise.
	* rtl-error.c (location_for_asm): Remove old location code.
	* c-lex.c (cb_line_change): Remove old location code.
	(fe_file_change): Likewise.
	(cb_def_pragma): Likewise.
	(c_lex_with_flags): Likewise.
	* gengtype.c (do_typedef): Don't special-case location types.
	(define_location_structures): Remove.
	(main): Don't call define_location_structures.
	* tree-pretty-print.c (dump_implicit_edges): Remove old location
	code.
gcc/ada
	* misc.c (internal_error_function): Remove test of
	USE_MAPPED_LOCATION.
	* trans.c (gigi): Remove test of USE_MAPPED_LOCATION.
	(Sloc_to_locus): Remove old location code.
gcc/cp
	* parser.c (eof_token): Remove old location code.
	(check_empty_body): Remove test of USE_MAPPED_LOCATION.
	* decl2.c (generate_ctor_or_dtor_function): Remove old location
	code.
	(cp_write_global_declarations): Likewise.
	* lex.c (cxx_init): Remove old location code.
	(handle_pragma_implementation): Remove test of
	USE_MAPPED_LOCATION.
	* pt.c (tsubst): Remove old location code.
	* error.c (cp_print_error_function): Remove test of
	USE_MAPPED_LOCATION.
	* decl.c (pop_label): Remove old location code.
	(finish_function): Likewise.
gcc/fortran
	* trans-io.c (set_error_locus): Remove old location code.
	* trans-decl.c (gfc_set_decl_location): Remove old location code.
	* f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION.
	* scanner.c (gfc_gobble_whitespace): Remove old location code.
	(get_file): Likewise.
	(preprocessor_line): Likewise.
	(load_file): Likewise.
	(gfc_new_file): Likewise.
	* trans.c (gfc_trans_runtime_check): Remove old location code.
	(gfc_get_backend_locus): Likewise.
	(gfc_set_backend_locus): Likewise.
	* data.c (gfc_assign_data_value): Remove old location code.
	* error.c (show_locus): Remove old location code.
	* gfortran.h (gfc_linebuf): Remove old location code.
	(gfc_linebuf_linenum): Remove old-location variant.
gcc/java
	* lang.c (java_post_options): Remove conditional.
	* expr.c (expand_byte_code): Remove old location code.
	* jcf-parse.c (set_source_filename): Remove old location code.
	(give_name_to_class): Likewise.
	(jcf_parse): Likewise.
	(duplicate_class_warning): Likewise.
	(parse_class_file): Likewise.
	(java_parse_file): Likewise.
	* decl.c (finish_method): Remove old location code.
	* class.c (push_class): Remove old location code.
gcc/objc
	* objc-act.c (objc_init): Remove old location code.
gcc/treelang
	* tree1.c (treelang_init): Remove old location code.
	(treelang_parse_file): Likewise.
	* lex.l (LINEMAP_POSITION_FOR_COLUMN): Remove.
	(update_lineno_charno): Remove old location code.

From-SVN: r132679
2008-02-26 16:05:24 +00:00
Jakub Jelinek c94ed7a1ae builtins.c (expand_builtin, [...]): Use new %K format string specifier for diagnostics.
* builtins.c (expand_builtin, expand_builtin_object_size,
	expand_builtin_memory_chk, maybe_emit_chk_warning,
	maybe_emit_sprintf_chk_warning): Use new %K format string specifier
	for diagnostics.
	* expr.c (expand_expr_real_1): Likewise.
	* langhooks-def.h (struct diagnostic_info): Add forward decl.
	(lhd_print_error_function): Add third argument.
	* langhooks.h (struct diagnostic_info): Add forward decl.
	(struct lang_hooks): Add third argument to print_error_function.
	* diagnostic.h (diagnostic_info): Add abstract_origin field.
	(diagnostic_last_function_changed, diagnostic_set_last_function): Add
	second argument.
	(diagnostic_report_current_function): Likewise.
	* toplev.c (announce_function): Pass NULL as second argument to
	diagnostic_set_last_function.
	* diagnostic.c (diagnostic_report_current_function): Add second
	argument, pass it as third argument to lang_hooks.print_error_function.
	(default_diagnostic_starter): Pass DIAGNOSTIC as second argument
	to diagnostic_report_current_function.
	(diagnostic_report_diagnostic): Initialize diagnostic->abstract_origin
	and message.abstract_origin.
	(verbatim): Initialize abstract_origin.
	* pretty-print.h (text_info): Add abstract_origin field.
	* pretty-print.c (pp_base_format): Handle %K.
	* langhooks.c (lhd_print_error_function): Add third argument.  If
	diagnostic->abstract_origin, print virtual backtrace.
	* c-format.c (gcc_diag_char_table, gcc_tdiag_char_table,
	gcc_cdiag_char_table, gcc_cxxdiag_char_table): Support %K.
	(init_dynamic_diag_info): Likewise.
cp/
	* error.c (cxx_print_error_function): Add third argument, pass
	it over to lhd_print_error_function.
	(cp_print_error_function): If diagnostic->abstract_origin, print
	virtual backtrace.
	* cp-tree.h (struct diagnostic_info): New forward decl.
	(cxx_print_error_function): Add third argument.
java/
	* lang.c (java_print_error_function): Add third argument.
testsuite/
	* lib/prune.exp: Prune also "^In function .*$" lines and
	"^    inlined from .*$" lines.

From-SVN: r128830
2007-09-27 09:24:58 +02:00
Nick Clifton 9dcd6f09a3 Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
2007-07-26 08:37:01 +00:00
Manuel López-Ibáñez 4e2bae26bf re PR other/30824 (-Werror -Wfatal-errors should stop after the first warning)
2007-02-20  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
            DJ Delorie <dj@redhat.com>

	PR other/30824
	* diagnostic.c (diagnostic_count_diagnostic): Move -Werror
	logic to...
	(diagnostic_report_diagnostic): ... here, and turn them into
	real errors. If warnings are inhibited, no need to do
	anything.

testsuite/
	* gcc.dg/Wfatal.c: New.
	* gcc.dg/Wfatal-2.c: New.
	* gcc.dg/Werror-1.c: Adjust expectations.
	* gcc.dg/Werror-5.c: Likewise.
	* gcc.dg/Werror-7.c: Likewise.
	* gcc.dg/Werror-10.c: Likewise.
	* gcc.dg/Werror-11.c: Likewise.

Co-Authored-By: DJ Delorie <dj@redhat.com>

From-SVN: r122159
2007-02-20 10:18:58 +00:00
Volker Reichelt ddaf3b8666 re PR driver/22600 (Exit code should be different from 1 for internal compiler error)
PR driver/22600	
	* system.h (ICE_EXIT_CODE): New macro.
	* diagnostic.c (diagnostic_count_diagnostic): Exit with ICE_EXIT_CODE.
	(diagnostic_action_after_output): Likewise.
	* gcc.c (fatal_ice): New function.
	(execute): Use it instead of fatal.
	(fancy_abort): Likewise.
	* doc/invoke.texi (-pass-exit-codes): Document return code for ICEs.

	* fortran/error.c (gfc_fatal_error): Return ICE_EXIT_CODE instead of 4.

From-SVN: r112292
2006-03-22 19:36:22 +00:00
Kazu Hirata c0220ea4c5 builtins.c, [...]: Fix comment typos.
* builtins.c, c-pragma.h, c-typeck.c, cgraph.c, cgraphunit.c,
	combine.c, common.opt, config/dfp-bit.c, config/i386/i386.c,
	config/m68k/m68k.c, config/m68k/m68k.md, config/mt/mt.c,
	config/mt/mt.h, config/s390/s390.md, df-core.c, df-problems.c,
	df-scan.c, df.h, diagnostic.c, expr.c, function.h, gimplify.c,
	loop-invariant.c, omp-low.c, opts.c, passes.c,
	rtl-factoring.c, rtlanal.c, struct-equiv.c, tree-cfgcleanup.c,
	tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c,
	tree-ssa-structalias.c, tree-ssa-threadedge.c,
	tree-ssa-threadupdate.c, tree-vect-patterns.c,
	tree-vect-transform.c, tree-vectorizer.h, tree-vrp.c,
	unwind-dw2.c: Fix comment typos.  Follow spelling conventions.

From-SVN: r111721
2006-03-04 23:05:24 +00:00
Marcin Dalecki 5ed6ace578 tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
2006-01-31  Marcin Dalecki  <martin@dalecki.de>

	* tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
	* regrename.c: Ditto.
	* tree-ssa-loop-im.c: Ditto.
	* tree-dump.c: Ditto.
	* tree-complex.c: Ditto.
	* genrecog.c: Ditto.
	* tree-ssa-threadupdate.c: Ditto.
	* tracer.c: Ditto.
	* java/class.c: Ditto.
	* java/jcf-parse.c: Ditto.
	* java/resource.c: Ditto.
	* java/except.c: Ditto.
	* java/jvspec.c: Ditto.
	* java/jcf-write.c: Ditto.
	* java/jcf-path.c: Ditto.
	* java/gjavah.c: Ditto.
	* java/zextract.c: Ditto.
	* java/jcf-io.c: Ditto.
	* java/jcf.h: Ditto.
	* java/buffer.c: Ditto.
	* java/lang.c: Ditto.
	* java/parse-scan.y: Ditto.
	* java/lex.c: Ditto.
	* java/lex.h: Ditto.
	* cfgloopmanip.c: Ditto.
	* postreload-gcse.c: Ditto.
	* tree-ssa-loop-manip.c: Ditto.
	* postreload.c: Ditto.
	* tree-ssa-loop-ch.c: Ditto.
	* loop.c: Ditto.
	* ipa-cp.c: Ditto.
	* cppspec.c: Ditto.
	* diagnostic.c: Ditto.
	* final.c: Ditto.
	* genoutput.c: Ditto.
	* gcc.c: Ditto.
	* cfghooks.c: Ditto.
	* cfgloopanal.c: Ditto.
	* objc/objc-act.c: Ditto.
	* gcov.c: Ditto.
	* genextract.c: Ditto.
	* genautomata.c: Ditto.
	* pretty-print.c: Ditto.
	* genemit.c: Ditto.
	* cgraphunit.c: Ditto.
	* flow.c: Ditto.
	* df-scan.c: Ditto.
	* haifa-sched.c: Ditto.
	* dominance.c: Ditto.
	* dbxout.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* df-core.c: Ditto.
	* mode-switching.c: Ditto.
	* modulo-sched.c: Ditto.
	* graph.c: Ditto.
	* ipa-pure-const.c: Ditto.
	* cse.c: Ditto.
	* fix-header.c: Ditto.
	* web.c: Ditto.
	* tree-stdarg.c: Ditto.
	* ipa-utils.c: Ditto.
	* loop-init.c: Ditto.
	* ipa-inline.c: Ditto.
	* cfganal.c: Ditto.
	* global.c: Ditto.
	* alloc-pool.c: Ditto.
	* dwarf2out.c: Ditto.
	* opts.c: Ditto.
	* genattrtab.c: Ditto.
	* tree-ssa-loop-ivcanon.c: Ditto.
	* predict.c: Ditto.
	* timevar.c: Ditto.
	* lcm.c: Ditto.
	* fortran/gfortranspec.c: Ditto.
	* regmove.c: Ditto.
	* local-alloc.c: Ditto.
	* langhooks.c: Ditto.
	* function.c: Ditto.
	* tree-vectorizer.c: Ditto.
	* gcse.c: Ditto.
	* ipa-type-escape.c: Ditto.
	* alias.c: Ditto.
	* tree-if-conv.c: Ditto.
	* profile.c: Ditto.
	* ipa.c: Ditto.
	* tree-data-ref.c: Ditto.
	* loop-unroll.c: Ditto.
	* treelang/treetree.c: Ditto.
	* calls.c: Ditto.
	* bt-load.c: Ditto.
	* ggc-common.c: Ditto.
	* except.c: Ditto.
	* coverage.c: Ditto.
	* cselib.c: Ditto.
	* tree-cfgcleanup.c: Ditto.
	* tree-ssa-pre.c: Ditto.
	* cfgcleanup.c: Ditto.
	* loop-invariant.c: Ditto.
	* loop-iv.c: Ditto.
	* ipa-prop.c: Ditto.
	* print-tree.c: Ditto.
	* conflict.c: Ditto.
	* ggc-page.c: Ditto.
	* sched-deps.c: Ditto.
	* regclass.c: Ditto.
	* tree-object-size.c: Ditto.
	* combine.c: Ditto.
	* bb-reorder.c: Ditto.
	* resource.c: Ditto.
	* var-tracking.c: Ditto.
	* cfgloop.c: Ditto.
	* df-problems.c: Ditto.
	* reg-stack.c: Ditto.
	* tlink.c: Ditto.
	* gccspec.c: Ditto.
	* sched-rgn.c: Ditto.
	* tree-ssa-structalias.c: Ditto.
	* tree-ssa-reassoc.c: Ditto.
	* config/darwin-c.c: Ditto.
	* config/darwin.c: Ditto.
	* config/arm/arm.c: Ditto.
	* cfgrtl.c: Ditto.
	* collect2.c: Ditto.
	* reload1.c: Ditto.

From-SVN: r110446
2006-01-31 20:56:55 +01:00
DJ Delorie 79cf599406 c-pragma.c (handle_pragma_diagnostic): New.
* c-pragma.c (handle_pragma_diagnostic): New.
(init_pragma): Register it.
* doc/extend.texi: Document it.

* diagnostic.def: Add DK_UNSPECIFIED and DK_IGNORED.
* diagnostic.h (diagnostic_classify_diagnostic): Declare.
(diagnostic_context): Add classify_diagnostic[].
* diagnostic.c (diagnostic_count_diagnostic): Don't count warnings
as errors if they're overridden to DK_WARNING.
(diagnostic_initialize): Initialize classify_diagnostic[].
(diagnostic_set_kind_override): New.
(diagnostic_report_diagnostic): Check for kind changes.
* opts.c (common_handle_option): Take lang_mask.  Update callers.
Handle OPT_Werror_.
* common.opt (Werror=): New.
* doc/invoke.texi: Document -Werror=*

From-SVN: r109907
2006-01-18 15:02:42 -05:00
Joseph Myers 178b58b59e re PR c++/17964 (cpp error messages contain wrong line in C++)
gcc:
	PR c++/17964
	* diagnostic.c (diagnostic_set_info_translated): New function.
	(diagnostic_set_info): Use it.  Add comment.
	* diagnostic.h (diagnostic_set_info_translated): Declare.

gcc/cp:
	* error.c (cp_cpp_error): New function.
	* cp-tree.h (cp_cpp_error): Declare.
	* parser.c (cp_lexer_new_main): Set CPP option client_diagnostic
	and error callback after lexing.

gcc/testsuite:
	* g++.dg/cpp/string-1.C: New test.

libcpp:
	* include/cpplib.h (struct cpp_options): Add client_diagnostic.
	(struct cpp_callbacks): Add error.
	* errors.c (cpp_error): If client_diagnostic, use error callback.
	* charset.c (convert_escape): Don't use %03o in diagnostic.

From-SVN: r106454
2005-11-03 23:08:18 +00:00
Andrew Pinski c50367a23c re PR other/22264 (bootstrap broken)
2005-07-01  Andrew Pinski  <pinskia@physics.uc.edu>

        PR other/22264
        * diagnostic.c (diagnostic_report_current_module): Use pp_newline to
        print out the last new line.

From-SVN: r101504
2005-07-01 07:26:18 -07:00
Zack Weinberg 39ce81c9c5 pretty-print.h (PP_NL_ARGMAX): New.
gcc:
	* pretty-print.h (PP_NL_ARGMAX): New.
	(text_info): Add locus.
	(struct chunk_info): New.
	(output_buffer): Add formatted_obstack, chunk_obstack, and
	cur_chunk_array. Change obstack to a pointer.
	(pp_wrapping_mode_t, pp_wrapping_mode, pp_set_verbatim_wrapping): New.
	(struct pretty_print_info): Replace ideal_maximum_length and
	prefixing_rule with wrapping.
	(pp_line_cutoff, pp_prefixing_rule): Update to match.
	Update prototypes and wrapper macros throughout.
	* pretty-print.c (pp_formatted_text_data, pp_append_r)
	(pp_base_clear_output_area, pp_construct, pp_base_formatted_text)
	(pp_base_last_position_in_text, pp_base_newline, pp_base_character):
	Update for changes to pp structure.
	(pp_base_prepare_to_format, pp_base_format_text): Delete.
	(pp_base_format, pp_base_output_formatted_text): New functions.
	(pp_base_format_verbatim): Use pp_set_verbatim_wrapping.
	(pp_verbatim): Clear text.locus.
	(pp_printf): Likewise.  Use pp_format and pp_output_formatted_text.
	* c-objc-common.c (c_tree_printer): Update function signature.
	* diagnostic.c (diagnostic_initialize): Update for changes to
	pp structure.
	(diagnostic_report_diagnostic): Call pp_format and then
	pp_output_formatted_text.
	(verbatim): Clear text.locus.
	* diagnostic.h (diagnostic_prefixing_rule, diagnostic_line_cutoff):
	Update for changes to pp structure.

	* c-lang.c: No need to include c-pretty-print.h.
	* Makefile.in: Remove bogus line containing only a tab.
	(c-lang.o): Update dependencies.
	* toplev.c (announce_function): Don't use verbatim.
	(default_tree_printer): Update signature.

	* objc/objc-lang.c: No need to include c-pretty-print.h.
	* objc/Make-lang.in: Update dependencies.

gcc/cp:
	* cp-lang.c: No need to include cxx-pretty-print.h.
	* error.c (cp_printer): Update signature.  No need to process
	flags.
	(print_instantiation_partial_context): Output last newline
	with pp_base_newline.
	* Make-lang.in: Update dependencies.

gcc/objcp:
	* objcp-lang.c: No need to include cxx-pretty-print.h.
	* Make-lang.in: Update dependencies.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r101481
2005-06-30 23:09:06 +00:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Jakub Jelinek 4b794eaf73 exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format.
gcc/po/
	* exgettext: Handle gmsgid and cmsgid arguments specially,
	as gcc-internal-format and c-format.  Because of xgettext
	bug, invoke xgettext once with --language=c, once with
	--language=GCC-source and then merge together.  Fail if
	xgettext is not 0.14.5 or later.
gcc/
	* intl.h (G_): New macro.
	* rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid
	instead of msgid for argument name.
	* tree-ssa.c (warn_uninit): Likewise.
	* c-parser.c (c_parser_error): Likewise.
	* config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise.
	* config/darwin-c.c (BAD): Likewise.
	* config/c4x/c4x-c.c (BAD): Likewise.
	* c-pragma.c (GCC_BAD, GCC_BAD2): Likewise.
	* c-errors.c (pedwarn_c99, pedwarn_c90): Likewise.
	* c-common.c (c_parse_error): Likewise.
	* diagnostic.c (diagnostic_set_info, verbatim, inform, warning,
	warning0, pedwarn, error, sorry, fatal_error, internal_error):
	Likewise.
	(fnotice): Use cmsgid instead of msgid for argument name.
	* gcov.c (fnotice): Likewise.
	* protoize.c (notice): Likewise.
	* final.c (output_operand_lossage): Likewise.
	* gcc.c (fatal, notice): Likewise.
	(error): Use gmsgid instead of msgid for argument name.
	* collect2.c (notice, fatal_perror, fatal): Use cmsgid instead
	of msgid for argument name.
	(error): Use gmsgid instead of msgid for argument name.
	* c-decl.c (locate_old_decl, implicit_decl_warning): Use G_()
	instead of N_().
	* c-typeck.c (readonly_error, convert_for_assignment): Likewise.
	* tree-inline.c (inline_forbidden_p_1): Likewise.
	* ABOUT-GCC-NLS: Require gettext 0.14.5 or later.  Mention the new
	conventions for marking translations.
	* doc/install.texi: Mention gettext 0.14.5 or later requirement.
gcc/cp/
	* error.c (locate_error): Use gmsgid instead of msgid for argument
	name.
	(cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise.
gcc/java/
	* jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of
	msgid for argument name.
	* gjavah.c (error): Likewise.
	* java-tree.h (parse_error_context): Likewise.
	* parse.y (parse_error_context, parse_warning_context,
	issue_warning_error_from_context): Likewise.

From-SVN: r100676
2005-06-06 21:31:40 +02:00
DJ Delorie 2098fe9ed5 common.opt (fdiagnostics-show-option): No variable is needed.
* common.opt (fdiagnostics-show-option): No variable is needed.
* diagnostic.h (diagnostic_context): Add show_option_requested flag.
* diagnostic.c (diagnostic_initialize): Initialize show_option_requested.
(diagnostic_report_diagnostic): Test for enabled diagnostics here.
Save and restore original message format.  Use flag in context
instead of global.
(warning): Don't test for enabled warnings here.
* opts.c (common_handle_option): Handle -fdiagnostics-show-option
here.

From-SVN: r99204
2005-05-03 21:36:13 -04:00
DJ Delorie ccf08a6ed7 c-decl.c (store_parm_decls_oldstyle): Let diagnostic machinery decide if the warning will be printed.
* c-decl.c (store_parm_decls_oldstyle): Let diagnostic machinery
decide if the warning will be printed.
* calls.c (expand_call): Likewise.
* function.c (init-function_start): Likewise.

* common.opt (-fdiagnostics-show-option): New.
* opts.c (option_enabled): Accept the option index instead of a
pointer to the option descriptor.
* opts.h (option_enabled): Likewise.
* toplev.c (print_switch_values): Pass option index, not option
descriptor.
* diagnostic.h (diagnostic_info): Add option_index.
* diagnostic.c: Include opts.h.
(diagnostic_set_info): Initialize option_index.
(diagnostic_report_diagnostic): Amend option name if appropriate.
(warning): Check to see if the specified warning is enabled.
Store option index.
* doc/invoke.texi (-fdiagnostics-show-options): Document.

From-SVN: r99169
2005-05-03 13:55:46 -04:00
DJ Delorie d4ee4d2525 diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.

* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.

* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.

* ada/misc.c: Adjust warning() callers.

* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.

* fortran/trans-decl.c: Adjust warning() callers.

* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.

* objc/objc-act.c: Adjust warning() callers.

* treelang/parse.y: Adjust warning() callers.

From-SVN: r98633
2005-04-23 17:29:07 -04:00
Per Bothner 8abb6b2217 Make -f[no-]show-column also control non-cpp diagnostics.
* c.opt (fshow-column): Move option from here ...
	* common.opt (fshow-column): ... to here.
	* diagnostic.c (diagnostic_build_prefix): Only print column number
	if flag_show_column.

From-SVN: r97127
2005-03-28 00:04:41 -08:00
Per Bothner 255508ddad diagnostic.c (diagnostic_build_prefix): If USE_MAPPED_LOCATION and we have a non-zero column-number, add it to the message.
* diagnostic.c (diagnostic_build_prefix): If USE_MAPPED_LOCATION
	and we have a non-zero column-number, add it to the message.
	Also factor out the diagnostic_kind_text.

From-SVN: r95746
2005-03-01 08:37:45 -08:00
Kazu Hirata 17385e0d3b cfgcleanup.c, [...]: Update copyright.
* cfgcleanup.c, df.h, diagnostic.c, rtl.c, tree-vectorizer.h,
	config/darwin7.h, config/mips/mips.c,
	config/rs6000/altivec.md, config/rs6000/darwin-tramp.asm:
	Update copyright.

From-SVN: r94704
2005-02-07 15:53:36 +00:00
Marcin Dalecki cbd13f8a73 * diagnostic.c (default_diagnostic_finalizer): Fix use of attribute.
From-SVN: r94671
2005-02-06 10:56:46 +00:00
Ben Elliston ef9af07733 re PR other/17900 (GCC's source path in ICE is wrong)
PR other/17900
	* diagnostic.c (trim_filename): Fix logic bug in walking backwards
	up the filename looking for a previous directory separator.

From-SVN: r89029
2004-10-14 17:15:37 +10:00
Zack Weinberg d5706a1eea pretty-print.c: Include tree.h.
* pretty-print.c: Include tree.h.
	(pp_base_prepare_to_format): New function, logic from
	text_specifies_location.
	(pp_base_format_text): Use gcc_assert.
	* pretty-print.h (pp_prepare_to_format): New macro.
	(pp_base_prepare_to_format): Prototype.
	* diagnostic.c (text_specifies_location): Delete.
	(bug_report_request): Delete.
	(diagnostic_set_info): Don't call text_specifies_location.
	(diagnostic_action_after_output): Put text from
	bug_report_request inline here.  Use gcc_unreachable.
	(diagnostic_report_current_function): Fix comment.
	(diagnostic_report_diagnostic): Clarify logic for error recursion.
	Call pp_prepare_to_format before diagnostic_starter.
	(trim_filename): Use IS_DIR_SEPARATOR.
	(fatal_error, internal_error): Use gcc_unreachable.
	(error_recursion): Call diagnostic_action_after_output to
	issue the bug_report_request message and exit.
	* Makefile.in (diagnostic.o, pretty-print.o): Update dependencies.

	* c-parse.in: Add list of diagnostic messages to insulate
	translation template from version of yacc/bison used to
	compile the grammar.
java:
	* parse.y, parse-scan.y: Add list of diagnostic messages to
	insulate translation template from version of yacc/bison used
	to compile the grammar.
treelang:
	* parse.y: Add list of diagnostic messages to insulate
	translation template from version of yacc/bison used to
	compile the grammar.
po:
	* gcc.pot: Regenerate.

From-SVN: r88590
2004-10-06 04:47:42 +00:00
Nathan Sidwell ced3f397be dbxout.c (dbxout_type, [...]): Use gcc_assert and gcc_unreachable.
* dbxout.c (dbxout_type, dbxout_type_name, dbxout_symbol): Use
	gcc_assert and gcc_unreachable.
	* ddg.c (create_ddg_dependence, add_deps_for_def,
	add_deps_for_use, create_ddg, add_edge_to_ddg): Likewise.
	* df.c (df_ref_unlink, df_ref_record, df_uses_record,
	df_reg_def_chain_create, df_reg_use_chain_create, df_analyze,
	df_insn_delete, df_refs_reg_replace, df_ref_reg_replace,
	df_insns_modify, df_pattern_emit_before, df_bb_reg_live_start_p,
	df_bb_reg_live_end_p, df_bb_regs_lives_compare,
	df_bb_single_def_use_insn_find, dataflow_set_a_op_b,
	dataflow_set_copy, hybrid_search, diagnostic.c,
	diagnostic_build_prefix, diagnostic_count_diagnostic): Likewise.
	* dojump.c (do_jump): Likewise.
	* dominance.c (calc_dfs_tree_nonrec, calc_dfs_tree,
	compute_dom_fast_query, calculate_dominance_info,
	free_dominance_info, get_immediate_dominator,
	set_immediate_dominator, get_dominated_by,
	redirect_immediate_dominators, nearest_common_dominator,
	dominated_by_p, verify_dominators, recount_dominator,
	iterate_fix_dominators, add_to_dominance_info,
	delete_from_dominance_info): Likewise.
	* dwarf2asm.c (size_of_encoded_value, eh_data_format_name,
	dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
	dw2_force_const_mem, dw2_asm_output_encoded_addr_rtx): Likewise.
	* dwarf2out.c (expand_builtin_init_dwarf_reg_sizes, reg_save,
	initial_return_save, stack_adjust_offset, dwarf2out_stack_adjust,
	flush_queued_reg_saves, dwarf2out_frame_debug_expr,
	dwarf2out_frame_debug, dw_cfi_oprnd1_desc, output_cfi,
	output_call_frame_info, output_loc_operands, build_cfa_loc,
	decl_ultimate_origin, AT_flag, AT_int, AT_unsigned, AT_string,
	AT_string_form, add_AT_specification, AT_ref, set_AT_ref_external,
	AT_loc, AT_loc_list, AT_addr, AT_lbl, add_child_die,
	splice_child_die, attr_checksum, same_dw_val_p,
	break_out_includes, build_abbrev_table, size_of_die, mark_dies,
	unmark_dies, value_format, output_loc_list, output_die,
	output_pubnames, output_aranges, base_type_die, is_base_type,
	modified_type_die, dbx_reg_number, multiple_reg_loc_descriptor,
	mem_loc_descriptor, loc_descriptor, loc_descriptor_from_tree_1,
	field_byte_offset, add_data_member_location_attribute,
	add_const_value_attribute, rtl_for_decl_location,
	add_location_or_const_value_attribute, add_byte_size_attribute,
	add_bit_offset_attribute, add_bit_size_attribute,
	add_abstract_origin_attribute, pop_decl_scope, scope_die_for,
	decl_start_label, gen_formal_parameter_die,
	gen_type_die_for_member, gen_subprogram_die, gen_label_die,
	gen_typedef_die, gen_type_die, gen_tagged_type_instantiation_die,
	force_decl_die, force_type_die, gen_decl_die,
	dwarf2out_imported_module_or_decl, prune_unused_types_prune,
	dwarf2out_finish): Likewise.

From-SVN: r87176
2004-09-08 07:47:45 +00:00
Gabriel Dos Reis 7783b40203 c-opts.c (c_common_handle_option): <case OPT_Werror> set global_dc->warning_as_error_requested.
* c-opts.c (c_common_handle_option): <case OPT_Werror> set
        global_dc->warning_as_error_requested.
        * diagnostic.c (diagnostic_initialize): Tidy.
        * diagnostic.h (diagnostic_context::x_data): Remove
        (diagnostic_context::issue_warnings_are_errors_message): Rename
        from warnings_are_errors_message.
        (diagnostic_context::warning_as_error_requested): New.

From-SVN: r86750
2004-08-30 04:48:34 +00:00
Per Bothner 6773e15fa5 Conditionally compile support for --enable-mapped_location.
* cfgexpand.c:  Handle USE_MAPPED_LOCATION case for function_end_locus.
	* cfglayout.c (insn_locators_initialize):  Const cleanup.  New macros.
	* cfgrtl.c (delete_insn):  Use new NOTE_DELETED_LABEL_NAME macro.
	* print-rtl.c (print_rtx):  Likewise.
	* emit-rtl.c:  Don't clear NOTE_SOURCE_FILE if USE_MAPPED_LOCATION.
	* combine.c:  Use new SET_INSN_DELETED macro.
	* flow.c:  Likewise.
	* haifa-sched.c:  Likewise.
	* ifcvt.c:  Likewise.
	* recog.c:  Likewise.
	* reload1.c:  Likewise.
	* diagnostic.c:  Use expand_location macro.
	* pretty-print.c (pp_base_format_text):  Likewise.
	* profile.c:  Likewise.
 	* dwarf2out.c:  Likewise.  Also use expand_location, DECL_IS_BUILTIN.
 	* dwarf2out.c (dwarf2out_decl:  Use BUILTINS_LOCATION.
	* emit-rtl.c (emit_line_note):  Simplify if USE_MAPPED_LOCATION.
	(force_next_line_note, insn_emit):  Handle USE_MAPPED_LOCATION case.
	* final.c (final):  Likewise.
	* haifa-sched.c:  Likewise.
	* integrate.c:  Likewise.
	* jump.c:  Likewise.
	* rtl-error.c:  Likewise.
	* stmt.c (check_seenlabel):  Likewise.
	* tree-pretty-print.c:  Likewise.

From-SVN: r83921
2004-06-30 11:18:01 -07:00
Zdenek Dvorak 50431bc428 Makefile.in (FLAGS_H): New.
* Makefile.in (FLAGS_H): New.
	(flags.h): Replace by FLAGS_H.
	* c.opt: Document Var, VarExists, Init and Report attributes.
	* common.opt: Fill the values of the attributes.
	* diagnostic.c (flag_fatal_errors): Do not define.
	* except.c (flag_non_call_exceptions): Do not define.
	* flags.h: Include options.h.  Remove declarations conflicting with
	the automatically defined ones.
	* opts.c: Remove automatically defined variables.
	(handle_option): Perform default initialization.
	(common_handle_option): Do not handle options covered by the
	default initialization.
	* opts.h (struct cl_option): Add flag_var, has_set_value and set_value
	fields.
	(CL_REPORT): New.
	* opts.sh: Generate variable declarations, handle CL_REPORT.
	* toplev.c: Remove automatically defined variables.
	(f_options): Removed.
	(print_switch_values): Use cl_options instead of f_options.
	* toplev.h (version_flag): Declaration removed.

From-SVN: r83105
2004-06-14 14:18:01 +00:00
Mark G. Adams a757585a22 tree.h: Remove include of version.h
* tree.h: Remove include of version.h
	* c-cppbuiltin.c: Include version.h
	* diagnostic.c: Include version.h
	* dwarf2out.c: Include version.h
	* toplev.c: Include version.h
	* vmsdbgout.c: Include version.h
	* Makefile.in: Remove dependency on version.h from TREE_H, and
	add dependencies to required .o targets
	* gjavah.c: Include version.h

From-SVN: r82601
2004-06-03 18:48:28 +00:00
Richard Guenther c65a01af06 Patch from Richard Guenther.
* commom.opt (Wfatal-errors): Add it.
* diagnostic.c (flag_fatal_errors): Define it.
(diagnostic_action_after_output): Check for flag_fatal_errors.
* flags.h (flag_fatal_errors): Declare it.
* opts.c (common_handle_option): Add OPT_Wfatal_errors.
* doc/invoke.texi (Warning Options): Document -Wfatal-errors.

From-SVN: r81323
2004-04-29 22:29:23 -07:00
Roger Sayle ae2bcd98fa alias.c (get_alias_set): Replace calls via (*lang_hooks.foo) () with lang_hooks.foo ().
* alias.c (get_alias_set): Replace calls via (*lang_hooks.foo) ()
	with lang_hooks.foo ().
	* builtins.c (expand_builtin_va_arg): Likewise.
	* c-common.c (fname_as_string, c_common_truthvalue_conversion,
	c_common_type_for_mode, c_common_nodes_and_builtins,
	handle_mode_attribute, handle_vector_size_attribute): Likewise.
	* c-convert.c (convert): Likewise.
	* c-format.c (check_format_types): Likewise.
	* c-objc-common.c (c_tree_printer): Likewise.
	* c-typeck.c (build_unary_op, build_conditional_expr,
	build_binary_op): Likewise.
	* calls.c (try_to_integrate, expand_call,
	emit_library_call_value_1): Likewise.
	* cgraph.c (cgraph_node_name, cgraph_function_possibly_inlined_p):
	Likewise.
	* cgraphunit.c (record_call_1, cgraph_analyze_function,
	cgraph_expand_function): Likewise.
	* convert.c (convert_to_pointer, convert_to_integer): Likewise.
	* coverage.c (build_fn_info_type, build_ctr_info_type,
	build_gcov_info, create_coverage): Likewise.
	* dbxout.c (dbxout_init): Likewise.
	* diagnostic.c (diagnostic_report_current_function): Likewise.
	* dojump.c (do_jump): Likewise.
	* dwarf2out.c (dwarf2_name): Likewise.
	* except.c (init_eh): Likewise.
	* explow.c (expr_size, int_expr_size): Likewise.
	* expmed.c (make_tree, const_mult_add_overflow_p, expand_mult_add):
	Likewise.
	* expr.c (store_expr, store_constructor, safe_from_p,
	expand_expr_real, do_store_flag, try_casesi): Likewise.
	* function.c (push_function_context_to, pop_function_context_from,
	free_after_parsing, assign_stack_local_1, assign_stack_temp_for_type,
	put_var_into_stack, allocate_struct_function, current_function_name):
	Likewise.
	* integrate.c (copy_decl_for_inlining, expand_inline_function):
	Likewise.
	* langhooks.c (lhd_clear_binding_stack, write_global_declarations,
	lhd_print_error_function): Likewise.
	* opts.c (handle_option, decode_options): Likewise.
	* passes.c (open_dump_file): Likewise.
	* print-tree.c (print_node): Likewise.
	* stmt.c (expand_fixup, fixup_gotos, expand_asm_operands,
	expand_decl_cleanup, emit_case_nodes): Likewise.
	* stor-layout.c (variable_size): Likewise.
	* toplev.c (announce_function, wrapup_global_declarations,
	check_global_declarations, compile_file, default_tree_printer,
	process_options, lang_dependent_init, finalize): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-inline.c (remap_decl, remap_block, copy_body_r,
	initialize_inlined_parameters, declare_return_variable,
	inlinable_function_p, expand_call_inline, optimize_inline_calls,
	walk_tree, copy_tree_r): Likewise.
	* tree-optimize.c (tree_rest_of_compilation): Likewise.
	* tree.c (decl_assembler_name, tree_size, size_in_bytes, staticp,
	unsafe_for_reeval, get_unwidened, get_narrower, get_callee_fndecl,
	variably_modified_type_p, dump_tree_statistics): Likewise.
	* varasm.c (assemble_variable, compare_constant, copy_constant,
	force_const_mem, compute_reloc_for_constant, output_constant,
	output_addressed_constants, initializer_constant_valid_p): Likewise.

From-SVN: r79481
2004-03-14 22:26:14 +00:00
Kazu Hirata 88462c42d2 bb-reorder.c, [...]: Update copyright.
gcc/
	* bb-reorder.c, cfgbuild.c, diagnostic.c, explow.c, profile.c,
	ra-build.c, read-rtl.c, tracer.c, unwind-dw2-fde-glibc.c,
	value-prof.c, config/darwin-protos.h, config/frv/frv-abi.h,
	config/i386/pmmintrin.h, config/pa/pa-hpux.h: Update
	copyright.

gcc/java/
	* java/parse.h: Update copyright.

From-SVN: r78566
2004-02-27 14:50:47 +00:00
Richard Henderson f6db1481a7 passes.c: New file.
* passes.c: New file.
        * Makefile.in (OBJS-common): Add it.
        * diagnostic.c (rtl_dump_and_exit): Move decl ...
        * flags.h (rtl_dump_and_exit): ... here.
        * output.h (size_directive_output, last_assemble_variable_decl):
        Move from toplev.c.
        * rtl.h (reg_alloc): Move from toplev.c.
        * toplev.c (HAVE_conditional_execution, DUMPFILE_FORMAT,
        struct dump_file_info, enum dump_file_index, dump_file_tbl,
        open_dump_file, close_dump_file, rest_of_decl_compilation,
        rest_of_type_compilation, rest_of_handle_final,
        rest_of_handle_delay_slots, rest_of_handle_stack_regs,
        rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
        rest_of_handle_new_regalloc, rest_of_handle_old_regalloc,
        rest_of_handle_regrename, rest_of_handle_reorder_blocks,
        rest_of_handle_sched, rest_of_handle_sched2, rest_of_handle_regmove,
        rest_of_handle_tracer, rest_of_handle_if_conversion,
        rest_of_handle_if_after_combine, rest_of_handle_web,
        rest_of_handle_branch_prob,
        rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
        rest_of_handle_addressof, rest_of_handle_sibling_calls,
        rest_of_handle_jump_bypass, rest_of_handle_inlining,
        rest_of_handle_null_pointer, rest_of_handle_combine,
        rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
        rest_of_handle_gcse, rest_of_handle_loop_optimize,
        rest_of_handle_loop2, rest_of_compilation): Move to passes.c.
        (decode_d_option): Use enable_rtl_dump_file.
        (compile_file, finalize, do_compile): Move profile+combine+graph
        cleanup to finish_optimization_passes.
        * toplev.h (init_optimization_passes, finish_optimization_passes,
        enable_rtl_dump_file): Declare.

From-SVN: r78561
2004-02-27 00:54:31 -08:00
Richard Henderson f31686a322 Revert DECL_SOURCE_LOCATION -> TREE_LOCUS change.
From-SVN: r71641
2003-09-21 22:09:32 -07:00
Richard Henderson 7e2af53a14 tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
* tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
	(TREE_FILENAME, TREE_LINENO): Likewise.
	(set_tree_locus, copy_tree_locus, set_tree_file_line): New.
	(TREE_LOCUS_SET_P): New.
	* c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c,
	diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c,
	print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c,
	tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c,
	config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match.

ada/
	* trans.c, utils.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

cp/
	* class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c,
	method.c, optimize.c, pt.c, semantics.c, tree.c: Update for
	DECL_SOURCE_LOCATION rename and change to const.

f/
	* com.c, ste.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

java/
	* class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
	resource.c: Update for DECL_SOURCE_LOCATION rename and change to const.

treelang/
	* treetree.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

From-SVN: r71636
2003-09-21 16:39:40 -07:00
Richard Henderson ddd2d57e72 c-format.c (gcc_diag_char_table): Add %J.
* c-format.c (gcc_diag_char_table): Add %J.
        (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise.
        (check_format_types): Fix wanted_type name lookup.
        (init_dynamic_diag_info): Setup %J.
        * diagnostic.c (text_specifies_location): Implement %J.
        * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c,
        dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c,
        tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c,
        config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c,
        config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics.

        * tree-inline.c: Include intl.h
        (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason.
        * Makefile.in (tree-inline.o): Update.
cp/
        * decl.c, decl2.c, pt.c: Use %J in diagnostics.
java/
        * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
testsuite/
        * gcc.dg/format/gcc_diag-1.c: Add tests for %J.

From-SVN: r71619
2003-09-20 22:07:20 -07:00
Gabriel Dos Reis 43f9ce0256 * diagnostic.c (warn_deprecated_use): Move to toplev.c
From-SVN: r71168
2003-09-07 11:59:52 +00:00
Gabriel Dos Reis dba65e798f langhooks.c (lhd_print_error_function): Move from diagnostic.c.
* langhooks.c (lhd_print_error_function): Move from diagnostic.c.
	* Makefile.in (langhooks.o): Depend on diagnostic.h

From-SVN: r71165
2003-09-07 10:11:28 +00:00