Commit Graph

153733 Commits

Author SHA1 Message Date
Martin Sebor
631238ac3f PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c
gcc/c-family/ChangeLog:

	PR translation/80280
	* c-format.h (struct format_flag_spec): Add new member.
	(T89_T): New macro.
	* c-format.c (local_tree_type_node): New global.
	(printf_flag_specs, asm_fprintf_flag_spec): Initialize new data.
	(gcc_diag_flag_specs, scanf_flag_specs, strftime_flag_specs): Ditto.
	(strfmon_flag_specs): Likewise.
	(gcc_diag_char_table, gcc_cdiag_char_table): Split up specifiers
	with distinct quoting properties.
	(gcc_tdiag_char_table, gcc_cxxdiag_char_table): Same.
	(flag_chars_t::validate): Add argument and handle bad quoting.
	(check_format_info_main): Handle quoting problems.
	(init_dynamic_diag_info): Simplify.

gcc/testsuite/ChangeLog:

	PR translation/80280
	* gcc.dg/format/gcc_diag-10.c: New test.

From-SVN: r247778
2017-05-08 20:47:14 -06:00
Kelvin Nilsen
6ba86ba72f re PR target/80101 (ICE in store_data_bypass_p, at recog.c:3737)
gcc/testsuite/ChangeLog:

2017-05-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80101
	* gcc.target/powerpc/pr80101-1.c: New test.


gcc/ChangeLog:

2017-05-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80101
	* config/rs6000/power6.md: Replace store_data_bypass_p calls with
	rs6000_store_data_bypass_p in seven define_bypass directives and
	in several comments.
	* config/rs6000/rs6000-protos.h: Add prototype for
	rs6000_store_data_bypass_p function.
	* config/rs6000/rs6000.c (rs6000_store_data_bypass_p): New
	function implements slightly different (rs6000-specific) semantics
	than store_data_bypass_p, returning false rather than aborting
	with assertion error when arguments do not satisfy the
	requirements of store data bypass.
	(rs6000_adjust_cost): Replace six calls of store_data_bypass_p with
	rs6000_store_data_bypass_p.

From-SVN: r247777
2017-05-09 01:15:46 +00:00
GCC Administrator
6abd0017dd Daily bump.
From-SVN: r247776
2017-05-09 00:16:18 +00:00
Max Filippov
5057f9e00f xtensa: add support for SSP
gcc/
2017-05-08  Max Filippov  <jcmvbkbc@gmail.com>

	* config/xtensa/xtensa-protos.h
       	(xtensa_initial_elimination_offset): New declaration.
	* config/xtensa/xtensa.c (xtensa_initial_elimination_offset):
	New function. Move its body from the INITIAL_ELIMINATION_OFFSET
	macro definition, add case for FRAME_POINTER_REGNUM when
	FRAME_GROWS_DOWNWARD.
	* config/xtensa/xtensa.h (FRAME_GROWS_DOWNWARD): New macro
	definition.
	(INITIAL_ELIMINATION_OFFSET): Replace body with call to
	xtensa_initial_elimination_offset.

From-SVN: r247771
2017-05-08 23:53:14 +00:00
Nathan Sidwell
26ffe6942c * doc/invoke.texi: Alphabetize -fdump options.
From-SVN: r247760
2017-05-08 21:52:53 +00:00
Martin Sebor
ea494cd74f re PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)
gcc/ChangeLog:

	PR translation/80280
	* config/sol2-c.c (solaris_pragma_align): Correct quoting.

From-SVN: r247758
2017-05-08 14:50:24 -06:00
Jason Merrill
f3ec182d6c PR c++/80178 - parameter passing for uncopyable classes
* tree.c (type_has_nontrivial_copy_init): True for classes with only
	deleted copy/move ctors.
	(remember_deleted_copy, maybe_warn_parm_abi): New.
	* decl.c (require_complete_types_for_parms, check_function_type):
	Call maybe_warn_parm_abi.
	* call.c (convert_for_arg_passing, build_cxx_call): Likewise.

From-SVN: r247757
2017-05-08 15:08:07 -04:00
Jason Merrill
49f0c04c37 Bump C++ ABI version.
* c-opts.c (c_common_post_options): Update defaults for
	flag_abi_version and flag_abi_compat_version.

From-SVN: r247756
2017-05-08 14:45:42 -04:00
Thomas Koenig
0f6ed1211d re PR fortran/79930 (Potentially Missed Optimisation for MATMUL / DOT_PRODUCT)
2017-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/79930
	* frontend-passes.c (matmul_to_var_expr): New function,
	add prototype.
	(matmul_to_var_code):  Likewise.
	(optimize_namespace):  Use them from gfc_code_walker.

2017-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/79930
	* gfortran.dg/inline_transpose_1.f90:  Add
	-finline-matmul-limit=0 to options.
	* gfortran.dg/matmul_5.f90:  Likewise.
	* gfortran.dg/vect/vect-8.f90: Likewise.
	* gfortran.dg/inline_matmul_14.f90:  New test.
	* gfortran.dg/inline_matmul_15.f90:  New test.

From-SVN: r247755
2017-05-08 18:22:44 +00:00
Nathan Sidwell
507e429b2f decl.c (builtin_function_1): Set DCL_ANTICIPATED before pushing.
* decl.c (builtin_function_1): Set DCL_ANTICIPATED before pushing.
	(start_preparsed_function): Do decl pushing before setting
	current_funciton_decl and announcing it.

From-SVN: r247754
2017-05-08 17:59:03 +00:00
Thomas Koenig
fd9910392b re PR libfortran/80602 (Reduce stack usage for blocked matmul)
2017-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/80602
	* m4/matmul_internal.m4:  'matmul_name`:  Change
	t1 to a VLA of the required size.
        * generated/matmul_c10.c: Regenerated.
        * generated/matmul_c16.c: Regenerated.
        * generated/matmul_c4.c: Regenerated.
        * generated/matmul_c8.c: Regenerated.
        * generated/matmul_i1.c: Regenerated.
        * generated/matmul_i16.c: Regenerated.
        * generated/matmul_i2.c: Regenerated.
        * generated/matmul_i4.c: Regenerated.
        * generated/matmul_i8.c: Regenerated.
        * generated/matmul_r10.c: Regenerated.
        * generated/matmul_r16.c: Regenerated.
        * generated/matmul_r4.c: Regenerated.
        * generated/matmul_r8.c: Regenerated.

2017-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/80602
	* gfortran.dg/matmul_15.f90:  New test case.

From-SVN: r247753
2017-05-08 17:56:13 +00:00
Nathan Sidwell
d16d5eac2a name-lookup.h (pushdecl_with_scope): Replace with ...
* name-lookup.h (pushdecl_with_scope): Replace with ...
	(pushdecl_outermost_localscope): ... this.
	* name-lookup.c (pushdecl_with_scope): Replace with ...
	(pushdecl_outermost_localscope): ... this.
	(pushdecl_namespace_level): Adjust.
	* decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
	* lambda.c (insert_capture_proxy): Likewise.

From-SVN: r247752
2017-05-08 17:54:55 +00:00
Bernd Edlinger
29eb9a442b target.def (compute_frame_layout): New optional target hook.
2017-05-08  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * target.def (compute_frame_layout): New optional target hook.
        * doc/tm.texi.in (TARGET_COMPUTE_FRAME_LAYOUT): Add hook.
        * doc/tm.texi (TARGET_COMPUTE_FRAME_LAYOUT): Add documentation.
        * lra-eliminations.c (update_reg_eliminate): Call compute_frame_layout
        target hook.
        * reload1.c (verify_initial_elim_offsets): Likewise.
        * config/arm/arm.c (TARGET_COMPUTE_FRAME_LAYOUT): Define.
        (use_simple_return_p): Call arm_compute_frame_layout if needed.
        (arm_get_frame_offsets): Split up into this ...
        (arm_compute_frame_layout): ... and this function.

From-SVN: r247750
2017-05-08 17:44:36 +00:00
Jonathan Wakely
9057edd30c Tweak static assertions in std::optional
* include/std/optional: Use a separate static_assert per condition.
	* testsuite/20_util/optional/cons/value_neg.cc: Update dg-error line
	numbers.

From-SVN: r247748
2017-05-08 18:13:38 +01:00
Nathan Sidwell
7574e45845 class.c (build_vtbl_initializer): Don't shadow outer variable with static var.
* class.c (build_vtbl_initializer): Don't shadow outer variable
	with static var.

From-SVN: r247747
2017-05-08 16:58:44 +00:00
Richard Sandiford
564cf83d79 [AArch64] Tighten move constraints for symbolic operands
The movsi and movdi constraints allowed the source to be any
absolute symbolic expression ("S").  That's OK for operands that
have already been vetted by the aarch64_mov_operand predicate but
causes problems if the register allocator substitutes an equivalence
(the usual "the constraints can't accept more than the predicates"
restriction).

Although all other uses of "S" in the backend are redundant and could
in principle be removed, "S" itself is a publicly-documented constraint
and so we'd have to keep its definition.  This patch therefore adds a
new "Usa" constraint for legitimate absolute address operands.

2017-05-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/constraints.md (Usa): New constraint.
	* config/aarch64/aarch64.md (*movsi_aarch64, *movdi_aarch64): Use it.

From-SVN: r247746
2017-05-08 16:18:49 +00:00
Nathan Sidwell
06aa549005 Revert _binding -> _value change.
* name-lookup.h (get_namespace_value, set_global_value): Rename to
	...
	(get_namespace_binding, set_global_binding): ... these.
	* name-lookup.c (get_namespace_value, set_global_value): Rename to
	...
	(get_namespace_binding, set_global_binding): ... these.
	(arg_assoc_namespace, pushdecl_maybe_friend_1)
	check_for_out_of_scope_variable, push_overloaded_decl_1,
	lookup_name_innermost_nonclass_level, push_namespace): Adjust.
	* cp-tree.h (IDENTIFIER_GLOBAL_VALUE)
	SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
	* decl.c (poplevel): Adjust.
	* pt.c (make_constrained_auto): Likewise.
((--This line, and those below, will be ignored--

M    cp/cp-tree.h
M    cp/name-lookup.c
M    cp/name-lookup.h
M    cp/decl.c
M    cp/ChangeLog
M    cp/pt.c

From-SVN: r247745
2017-05-08 15:51:57 +00:00
Joseph Myers
1e5c24003b * es.po, sv.po: Update.
From-SVN: r247743
2017-05-08 16:42:27 +01:00
Jonathan Wakely
6d430cbd12 Clarify mt_allocator documentation w.r.t deallocation
* doc/xml/manual/mt_allocator.xml: Clarify deallocation behaviour.
	* doc/html/*: Regenerate.

From-SVN: r247742
2017-05-08 16:09:08 +01:00
Thomas Preud'homme
c2f46874fd Define TM_MULTILIB_CONFIG for ARM multilib
TM_MULTILIB_CONFIG is not set in config.gcc when building with multilib
for arm targets, leading to config/arm/t-multilib not including any of
the files (t-aprofile and t-rmprofile) definining the architecture and
FPU to build multilib for. This patch fixes that by setting
TM_MULTILIB_CONFIG to with_multilib_list's value after it has been
checked. It also fix a trailing whitespace issue.

2017-05-08  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config.gcc (arm*-*-*): Set TM_MULTILIB_CONFIG from
    with_multilib_list after it has been checked.

From-SVN: r247741
2017-05-08 14:35:56 +00:00
Richard Biener
a92464ddb2 tree-ssa-pre.c (bitmap_set_and): Avoid bitmap copy.
2017-05-08  Richard Biener  <rguenther@suse.de>

	* tree-ssa-pre.c (bitmap_set_and): Avoid bitmap copy.
	(bitmap_set_subtract_values): Likewise.

From-SVN: r247739
2017-05-08 13:35:29 +00:00
Richard Biener
da11a720a3 tree-vrp.c (gimple_assign_nonzero_warnv_p): Rename to ...
2017-05-08  Richard Biener  <rguenther@suse.de>

	* tree-vrp.c (gimple_assign_nonzero_warnv_p): Rename to ...
	(gimple_assign_nonzero): ... this and remove strict_overflow_p
	argument.
	(gimple_stmt_nonzero_warnv_p): Rename to ...
	(gimple_stmt_nonzero_p): ... this and remove strict_overflow_p
	argument.
	(vrp_stmt_computes_nonzero): Remove strict_overflow_p argument.
	(extract_range_basic): Adjust, do not disable propagation on
	strict overflow sensitive simplification.
	(vrp_visit_cond_stmt): Likewise.

From-SVN: r247738
2017-05-08 12:52:44 +00:00
Wilco Dijkstra
18b8c294e2 This fixes a few failures on ARM and AArch64 due to a recent change in...
This fixes a few failures on ARM and AArch64 due to a recent change in
alignment peeling by switching the vector cost model off.

Tested on AArch64, ARM and x64 - committed as obvious.

    testsuite/
	* gcc.dg/vect/vect-44.c: Add -fno-vect-cost-model.
	* gcc.dg/vect/vect-50.c: Likewise.

From-SVN: r247737
2017-05-08 12:38:52 +00:00
GCC Administrator
41e97de9d5 Daily bump.
From-SVN: r247733
2017-05-08 00:16:30 +00:00
Jan Hubicka
5a8d501f0d ipa-inline-analysis.c (estimate_function_body_sizes): Recompute body size unconditionally.
* ipa-inline-analysis.c (estimate_function_body_sizes): Recompute
	body size unconditionally.

From-SVN: r247729
2017-05-07 22:21:05 +00:00
Volker Reichelt
d4a5c4ebc7 re PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)
PR translation/80280
        * call.c (print_z_candidate): Fix quoting.

From-SVN: r247728
2017-05-07 19:41:09 +00:00
Jeff Law
8637c116c5 revert: re PR tree-optimization/78496 (Missed opportunities for jump threading)
2017-05-07  Jeff Law  <law@redhat.com>

	Revert:
	2017-05-06  Jeff Law  <law@redhat.com>
	PR tree-optimization/78496
	* tree-vrp.c (simplify_assert_expr_using_ranges): Remove debugging
	code.

	PR tree-optimization/78496
	* tree-vrp.c (simplify_assert_expr_using_ranges): New function.
	(simplify_stmt_using_ranges): Call it.
	(vrp_dom_walker::before_dom_children): Extract equivalences
	from an ASSERT_EXPR with an equality comparison against a
	constant.

	Revert:
	2017-05-06  Jeff Law  <law@redhat.com>
	PR tree-optimization/78496
	* gcc.dg/tree-ssa/ssa-thread-16.c: New test.
	* gcc.dg/tree-ssa/ssa-thread-17.c: New test.

From-SVN: r247727
2017-05-07 09:10:55 -06:00
GCC Administrator
9267267a3d Daily bump.
From-SVN: r247726
2017-05-07 00:16:25 +00:00
Jeff Law
10dfbcba38 re PR tree-optimization/78496 (Missed opportunities for jump threading)
PR tree-optimization/78496
	* tree-vrp.c (simplify_assert_expr_using_ranges): Remove debugging
	code.

From-SVN: r247722
2017-05-06 12:20:31 -06:00
Jeff Law
973dfbb4a6 re PR tree-optimization/78496 (Missed opportunities for jump threading)
PR tree-optimization/78496
	* tree-vrp.c (simplify_assert_expr_using_ranges): New function.
	(simplify_stmt_using_ranges): Call it.
	(vrp_dom_walker::before_dom_children): Extract equivalences
	from an ASSERT_EXPR with an equality comparison against a
	constant.

	PR tree-optimization/78496
	* gcc.dg/tree-ssa/ssa-thread-16.c: New test.
	* gcc.dg/tree-ssa/ssa-thread-17.c: New test.

From-SVN: r247721
2017-05-06 09:03:40 -06:00
Richard Sandiford
8ffa3150d3 Record equivalences for spill registers
If we decide to allocate a call-clobbered register R to a value that
is live across a call, LRA will create a new spill register TMPR,
insert:

   TMPR <- R

before the call and

   R <- TMPR

after it.  But if we then failed to allocate a register to TMPR, we would
always spill it to the stack, even if R was known to be equivalent to
a constant or to some existing memory location.  And on AArch64, we'd
always fail to allocate such a register for 128-bit Advanced SIMD modes,
since no registers of those modes are call-preserved.

This patch avoids the problem by copying the equivalence information
from the original pseudo to the spill register.  It means that the
code for the testcase is as good with -O2 as it is with -O,
whereas previously the -O code was better.

[Based on the code ARM contributed in branches/ARM/sve-branch@247248]

2017-05-06  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* lra-constraints.c (lra_copy_reg_equiv): New function.
	(split_reg): Use it to copy equivalence information from the
	original register to the spill register.

gcc/testsuite/
	* gcc.target/aarch64/spill_1.c: New test.

From-SVN: r247720
2017-05-06 07:46:48 +00:00
Richard Sandiford
2a3f79973f PR 75964: Invalid integer ABS handling in simplify-rtx.c
RTL has no distinction between signed and unsigned values, so it
doesn't make sense to test for signed overflow.

2017-05-06  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	PR rtl-optimization/75964
	* simplify-rtx.c (simplify_const_relational_operation): Remove
	invalid handling of comparisons of integer ABS.

gcc/testsuite/
	PR rtl-optimization/75964
	* gcc.dg/torture/pr75964.c: New test.

From-SVN: r247719
2017-05-06 07:44:13 +00:00
Tom de Vries
d554bf236e Remove default_packed lines from i386/avx-vtestp{d,s}*
2017-05-06  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80606
	* gcc.target/i386/avx-vtestpd-1.c: Remove default_packed lines.
	* gcc.target/i386/avx-vtestpd-2.c: Same.
	* gcc.target/i386/avx-vtestpd-256-1.c: Same.
	* gcc.target/i386/avx-vtestpd-256-2.c: Same.
	* gcc.target/i386/avx-vtestpd-256-3.c: Same.
	* gcc.target/i386/avx-vtestpd-3.c: Same.
	* gcc.target/i386/avx-vtestps-1.c: Same.
	* gcc.target/i386/avx-vtestps-2.c: Same.
	* gcc.target/i386/avx-vtestps-256-1.c: Same.
	* gcc.target/i386/avx-vtestps-256-2.c: Same.
	* gcc.target/i386/avx-vtestps-256-3.c: Same.
	* gcc.target/i386/avx-vtestps-3.c: Same.

From-SVN: r247718
2017-05-06 07:31:27 +00:00
Tom de Vries
7a976fe79d Add absolute line number comment in gcc.target/avr/progmem-error-1.cpp
2017-05-06  Tom de Vries  <tom@codesourcery.com>

	* gcc.target/avr/progmem-error-1.cpp: Add abolute line number comment.

From-SVN: r247717
2017-05-06 07:17:16 +00:00
Tom de Vries
0e852c66f9 Replace absolute line numbers in gcc.target/powerpc
2017-05-06  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80557
	* gcc.target/powerpc/altivec-macros.c: Replace absolute line numbers.
	* gcc.target/powerpc/altivec-types-1.c: Same.

From-SVN: r247716
2017-05-06 07:17:05 +00:00
Tom de Vries
63c40d9286 Replace absolute line numbers in gcc.target/spu
2017-05-06  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80557
	* gcc.target/spu/Wmain.c: Replace absolute line numbers.
	* gcc.target/spu/intrinsics-1.c: Same.

From-SVN: r247715
2017-05-06 07:16:53 +00:00
Tom de Vries
b25b8f9162 Replace absolute line numbers in gcc.target/arm
2017-05-06  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80557
	* gcc.target/arm/pr69180.c: Replace absolute line numbers.

From-SVN: r247714
2017-05-06 07:16:43 +00:00
Tom de Vries
6df1349133 Replace absolute line numbers in gcc.target/aarch64
2017-05-06  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80557
	* gcc.target/aarch64/spellcheck_1.c: Replace absolute line numbers.
	* gcc.target/aarch64/spellcheck_2.c: Same.
	* gcc.target/aarch64/spellcheck_3.c: Same.

From-SVN: r247713
2017-05-06 07:16:33 +00:00
Tom de Vries
e01261fef5 Replace absolute line numbers in g++.dg/{debug,goacc}
2017-05-06  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80557
	* g++.dg/debug/dwarf2/dwarf2-1.C: Replace absolute line numbers.
	* g++.dg/debug/dwarf2/dwarf2-2.C: Same.
	* g++.dg/debug/dwarf2/pr46123-2.C: Same.
	* g++.dg/debug/dwarf2/typedef5.C: Same.
	* g++.dg/goacc/data-1.C: Same.

From-SVN: r247712
2017-05-06 07:16:17 +00:00
Uros Bizjak
9f36390d42 i386.c (ext_80387_constant_init): Do not explicitly initialize to zero.
* config/i386/i386.c (ext_80387_constant_init): Do not explicitly
	initialize to zero.
	(init_regs): Remove declaration.
	(function_arg_advance_32): Initialize error_p as boolean variable.

From-SVN: r247711
2017-05-06 09:01:51 +02:00
Joshua Conner
7ab8766a8e Add fuchsia support to libgcc
* config/arm/unwind-arm.h (_Unwind_decode_typeinfo_ptr): Use
	pc-relative indirect handling for fuchsia.
	* config/t-slibgcc-fuchsia: New file.
	* config.host (*-*-fuchsia*, aarch64*-*-fuchsia*, arm*-*-fuchsia*,
	x86_64-*-fuchsia*): Add definitions.

From-SVN: r247710
2017-05-06 00:22:38 +00:00
GCC Administrator
08dd548e8d Daily bump.
From-SVN: r247709
2017-05-06 00:16:44 +00:00
Nathan Sidwell
5cf5c9dabf store-motion.c (remove_reachable_equiv_notes): Reformat long lines.
* store-motion.c (remove_reachable_equiv_notes): Reformat long
	lines.  Use for (;;).

From-SVN: r247705
2017-05-05 23:24:41 +00:00
Bill Schmidt
9945596cef rs6000.c (rs6000_vect_nonmem): New static var.
[gcc]

2017-05-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_vect_nonmem): New static var.
	(rs6000_init_cost): Initialize rs6000_vect_nonmem.
	(rs6000_add_stmt_cost): Update rs6000_vect_nonmem.
	(rs6000_finish_cost): Avoid vectorizing simple copy loops with
	VF=2 that require versioning.

[gcc/testsuite]

2017-05-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/versioned-copy-loop.c: New file.

From-SVN: r247671
2017-05-05 21:27:54 +00:00
David Malcolm
ba82e6b5c8 Convert CARET_LINE_MARGIN to const int
gcc/ChangeLog:
	* diagnostic.h (CARET_LINE_MARGIN): Convert from macro to const
	int.

From-SVN: r247666
2017-05-05 21:07:38 +00:00
David Malcolm
62a77bdfe9 Convert diagnostic_override_option_index from macro to inline function
gcc/ChangeLog:
	* diagnostic.h (diagnostic_override_option_index): Convert from
	macro to inline function.

From-SVN: r247665
2017-05-05 21:05:15 +00:00
David Malcolm
26d5ed6cea Get rid of macros for diagnostic_report_current_module
diagnostic.h has a couple of macros (diagnostic_last_module_changed
and diagnostic_set_last_module) which are only used within
diagnostic_report_current_module.

This patch eliminates the macros in favor of static functions within
diagnostic.c.

No functional change intended.

gcc/ChangeLog:
	* diagnostic.c (last_module_changed_p): New function.
	(set_last_module): New function.
	(diagnostic_report_current_module): Convert macro usage to
	the above functions.
	* diagnostic.h (diagnostic_context::last_module): Strengthen
	from const line_map * to const line_map_ordinary *.
	(diagnostic_last_module_changed): Delete macro.
	(diagnostic_set_last_module): Delete macro.

From-SVN: r247664
2017-05-05 21:03:07 +00:00
David Malcolm
56d3558517 Eliminate report_diagnostic macro
This patch eliminates the report_diagnostic macro, manually
expanding it in all sites in the code.

No functional change intended.

gcc/c-family/ChangeLog:
	* c-common.c (c_cpp_error): Replace report_diagnostic
	with diagnostic_report_diagnostic.

gcc/c/ChangeLog:
	* c-decl.c (warn_defaults_to): Replace report_diagnostic
	with diagnostic_report_diagnostic.
	* c-errors.c (pedwarn_c99): Likewise.
	(pedwarn_c90): Likewise.

gcc/cp/ChangeLog:
	* error.c (pedwarn_cxx98): Replace report_diagnostic
	with diagnostic_report_diagnostic.

gcc/ChangeLog:
	* diagnostic.c (diagnostic_impl): Replace report_diagnostic
	with diagnostic_report_diagnostic.
	(diagnostic_n_impl_richloc): Likewise.
	* diagnostic.h (report_diagnostic): Delete macro.
	* rtl-error.c (diagnostic_for_asm): Replace report_diagnostic
	with diagnostic_report_diagnostic.
	* substring-locations.c (format_warning_va): Likewise.

gcc/fortran/ChangeLog:
	* cpp.c (cb_cpp_error): Replace report_diagnostic
	with diagnostic_report_diagnostic.
	* error.c (gfc_warning): Likewise.
	(gfc_warning_now_at): Likewise.
	(gfc_warning_now): Likewise.
	(gfc_warning_internal): Likewise.
	(gfc_error_now): Likewise.
	(gfc_fatal_error): Likewise.
	(gfc_error_opt): Likewise.
	(gfc_internal_error): Likewise.

From-SVN: r247663
2017-05-05 21:01:05 +00:00
David Malcolm
80ceac09a5 diagnostic.c: add print_option_information
This patch simplifies diagnostic_report_diagnostic by moving
option-printing to a new subroutine.

Doing so required a slight rewrite.  In both the old and new
code, context->option_name returns a malloc-ed string.
The old behavior was to then use ACONCAT to manipulate the
format_spec, appending the option metadata.
ACONCAT calcs the buffer size, then uses alloca, and then copies the
data to the on-stack buffer.

Given the alloca, this needs rewriting when moving the printing to
a subroutine.  In the new version, the metadata is simply printed
using pp_* calls (so it's hitting the obstack within the
pretty_printer).

This means we can get rid of the save/restore of format_spec: I don't
believe anything else in the code modifies it.

It also seems inherently simpler; it seems odd to me to be
appending metadata to the formatting string, rather than simply
printing the metadata after the formatted string is printed
(the old code also assumed that no option name contained a '%').

No functional change intended.

gcc/ChangeLog:
	* diagnostic.c (diagnostic_report_diagnostic): Eliminate
	save/restor of format_spec.  Move option-printing code to...
	(print_option_information): ...this new function, and
	reimplement by simply printing to the pretty_printer,
	rather than appending to the format string.

From-SVN: r247661
2017-05-05 20:56:36 +00:00
David Malcolm
dc41c9b07d diagnostic_report_diagnostic: refactor pragma-handling
This patch simplifies diagnostic_report_diagnostic by moving the
pragma-handling logic into a subroutine.

No functional change intended.

gcc/ChangeLog:
	* diagnostic.c (diagnostic_report_diagnostic): Split out pragma
	handling logic into...
	(update_effective_level_from_pragmas): ...this new function.

From-SVN: r247660
2017-05-05 20:51:18 +00:00