144972 Commits

Author SHA1 Message Date
Paul Thomas
70112e2a64 re PR fortran/70031 (Error in recursive module subroutine declaration if declared as "module recursive")
2016-03-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/70031
	* decl.c (gfc_match_prefix): Treat the 'module' prefix in the
	same way as the others, rather than fixing it to come last.
	(gfc_match_function_decl, gfc_match_subroutine): After errors
	in 'copy_prefix', emit them immediately in the case of module
	procedures to prevent a later ICE.

	PR fortran/69524
	* decl.c (gfc_match_submod_proc): Permit 'module procedure'
	declarations within the contains section of modules as well as
	submodules.
	* resolve.c (resolve_fl_procedure): Likewise.
	*trans-decl.c (build_function_decl): Change the gcc_assert to
	allow all forms of module procedure declarations within module
	contains sections.

2016-03-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/70031
	* gfortran.dg/submodule_14.f08: New test

	PR fortran/69524
	* gfortran.dg/submodule_15.f08: New test

From-SVN: r234161
2016-03-12 13:59:10 +00:00
Eric Botcazou
0529235de5 re PR ada/70017 (c52103x and c52104x test failure on s390x)
PR ada/70017
	* calls.c (emit_library_call_value_1): Clear the ECF_NOTHROW flag if
	the libcall is LCT_THROW.
	* explow.c (probe_stack_range): Pass LCT_THROW to emit_library_call
	for the checking routine.

From-SVN: r234160
2016-03-12 11:32:54 +00:00
Patrick Palka
3f1e5d3afe Fix PR c++/70106 (type of parenthesized qualified-id has wrong cv-qualifiers)
gcc/cp/ChangeLog:

	PR c++/70106
	* semantics.c (force_paren_expr): Just build a PAREN_EXPR when
	processing_template_decl and EXPR is a SCOPE_REF.

gcc/testsuite/ChangeLog:

	PR c++/70106
	* g++.dg/cpp1y/paren3.C: New test.

From-SVN: r234159
2016-03-12 02:05:17 +00:00
GCC Administrator
c1e8846526 Daily bump.
From-SVN: r234158
2016-03-12 00:16:15 +00:00
Michael Meissner
a3f6d680ea re PR target/70131 (PowerPC ISA 2.07 is inefficient at doint (float)(int)x.)
[gcc]
2016-03-11  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/70131
	* config/rs6000/rs6000.md (round32<mode>2_fprs): Do not do the
	optimization if we have direct move.
	(roundu32<mode>2_fprs): Likewise.

[gcc/testsuite]
2016-03-11  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/70131
	* gcc.target/powerpc/ppc-round2.c: New test.

From-SVN: r234155
2016-03-12 00:10:54 +00:00
Joseph Myers
089d955fa0 * sv.po: Update.
From-SVN: r234153
2016-03-12 00:00:52 +00:00
Bernd Schmidt
92348f098d re PR target/70123 (Miscompilation of cfitsio testcase on s390x-linux starting with r222144)
PR target/70123
	* lra-remat.c (operand_to_remat): Disallow hard regs in the value t
	be rematerialized.
	(reg_overlap_for_remat_p): Renamed from input_regno_present_p.
	Arguments swapped.  All callers changed.  Take reg_renumber into
	account, and Calculate and compare register ranges for hard regs.

	PR target/70123
	* gcc.dg/torture/pr70123.c: New test.

From-SVN: r234152
2016-03-11 15:38:41 -07:00
Jeff Law
cebde9e9eb re PR tree-optimization/70190 (ICE (segfault) at -O2 and -O3 on x86_64-linux-gnu)
PR tree-optimization/70190
	* tree-ssa-threadbackward.c (fsm_find_control_statement_thread_paths):
	Handle cases where we can not extract the taken edge, even though we
	found a constant value.

	PR tree-optimization/70190
	* gcc.c-torture/compile/pr70190.c: New test.

From-SVN: r234151
2016-03-11 15:32:11 -07:00
Jeff Law
015782a5ae re PR tree-optimization/64058 (Performance degradation after r216304)
PR tree-optimization/64058
	* tree-ssa-coalesce.c (struct coalesce_pair): Add new field INDEX.
	(num_coalesce_pairs): Move up earlier in file.
	(find_coalesce_pair): Initialize the INDEX field for each pair
	discovered.
	(compare_pairs): No longer sort on the elements in each pair.
	Instead break ties with the index of the coalesce pair.

From-SVN: r234149
2016-03-11 14:07:31 -07:00
David Malcolm
3edc5da4a6 Wmisleading-indentation.c: add more test cases for PR c/68187
gcc/testsuite/ChangeLog:
	PR c/68187
	* c-c++-common/Wmisleading-indentation.c (test43_a): New test
	case.
	(test43_b): Likewise.
	(test43_c): Likewise.
	(test43_d): Likewise.
	(test43_e): Likewise.
	(test43_f): Likewise.
	(test43_g): Likewise.
	(test44_a): Likewise.
	(test44_b): Likewise.
	(test44_c): Likewise.
	(test44_d): Likewise.
	(test44_e): Likewise.

From-SVN: r234146
2016-03-11 19:54:43 +00:00
David Malcolm
318c120418 Wmisleading-indentation: add reproducer for PR c/70085
PR c/70085 reported a false-positive from -Wmisleading-indentation.

The warning was fixed by the fix for PR c/68187 (r233972), but it seems
worth capturing the reproducer for PR c/70085 as an additional test case,
as it's slightly different to those seen in PR c/68187.

gcc/testsuite/ChangeLog:
	PR c/70085
	* c-c++-common/Wmisleading-indentation.c (pr70085): New test case.

From-SVN: r234145
2016-03-11 19:48:49 +00:00
Kyrylo Tkachov
bc062234d6 [AArch64] Fix gcc.target/aarch64/vect-reduc-or_1.c for -mcpu=cortex-a57
* gcc.target/aarch64/vect-reduc-or_1.c: Add -fno-vect-cost-model to
	dg-options.

From-SVN: r234142
2016-03-11 15:36:03 +00:00
Kyrylo Tkachov
acfc1ac169 [AArch64] PR target/70002: Make aarch64_set_current_function play nice with pragma resetting
PR target/70002
	* config/aarch64/aarch64-protos.h
	(aarch64_save_restore_target_globals): New prototype.
	* config/aarch64/aarch64-c.c (aarch64_pragma_target_parse):
	Call the above when popping pragma.
	* config/aarch64/aarch64.c (aarch64_save_restore_target_globals):
	New function.
	(aarch64_set_current_function): Rewrite using the above.

	PR target/70002
	PR target/69245
	* gcc.target/aarch64/pr69245_2.c: New test.

From-SVN: r234141
2016-03-11 15:27:24 +00:00
Jakub Jelinek
d1e2bb2d01 re PR tree-optimization/70177 (ICE in extract_ops_from_tree starting with r233660)
PR tree-optimization/70177
	* gimple-expr.h (extract_ops_from_tree_1): Renamed to ...
	(extract_ops_from_tree): ... this.  In the 2 argument
	overload remove _1 suffix.
	* gimple-expr.c (extract_ops_from_tree_1): Renamed to ...
	(extract_ops_from_tree): ... this.
	* gimple.c (gimple_build_assign, gimple_assign_set_rhs_from_tree):
	Adjust callers.
	* tree-ssa-loop-niter.c (derive_constant_upper_bound): Likewise.
	* tree-ssa-forwprop.c (defcodefor_name): Call 3 operand
	extract_ops_from_tree instead of 2 operand one.

	* gcc.dg/pr70177.c: New test.

From-SVN: r234140
2016-03-11 13:28:50 +01:00
Alan Lawrence
07350627b6 Re: Add -funconstrained-commons to work around PR/69368 (and others) in SPEC2006
gcc/testsuite:

	* gfortran.dg/unconstrained_commons.f: Widen regexp to match j_<N>.

From-SVN: r234139
2016-03-11 12:27:58 +00:00
Alan Lawrence
5c6706f77e Fix PR/70013
gcc:

	PR tree-optimization/70013
	* tree-sra.c (analyze_access_subtree): Also set grp_unscalarized_data
	for constant-pool entries.

gcc/testsuite:

	* gcc.dg/tree-ssa/sra-20.c: New.

From-SVN: r234138
2016-03-11 12:08:01 +00:00
Jakub Jelinek
686d390a8f re PR rtl-optimization/70174 (ICE at -O1 and above on x86_64-linux-gnu in gen_lowpart_general, at rtlhooks.c:63)
PR rtl-optimization/70174
	* expmed.c (store_bit_field_using_insv): Use gen_lowpart_if_possible
	followed by gen_lowpart on force_reg instead of just gen_lowpart.

	* gcc.dg/pr70174.c: New test.

From-SVN: r234137
2016-03-11 13:07:01 +01:00
Jakub Jelinek
02d472a2cb re PR tree-optimization/70169 (ICE at -O1 and above on x86_64-linux-gnu in gen_lsm_tmp_name, at tree-ssa-loop.c:791)
PR tree-optimization/70169
	* tree-ssa-loop.c (gen_lsm_tmp_name): Handle FUNCTION_DECL and
	LABEL_DECL like VAR_DECL.  Emit nothing instead of gcc_unreachable
	for unknown codes.

	* gcc.dg/pr70169.c: New test.

From-SVN: r234136
2016-03-11 13:05:58 +01:00
Ilya Enkovich
0f9befa141 re PR rtl-optimization/70160 (gcc ICE at -O2 (seg fault) and above on valid code on x86_64-linux-gnu)
gcc/

	PR target/70160
	* config/i386/i386.c (scalar_chain::convert_reg): Skip uses
	of uninitialized values.

gcc/testsuite/

	PR target/70160
	* gcc.target/i386/pr70160.c: New test.

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

From-SVN: r234135
2016-03-11 11:25:29 +00:00
Andreas Krebbel
432d4670c0 S/390: Fix rounding for _Decimal128 to _Decimal32 conversion
We do not have a direct conversion instruction from 128 bit DFP to 32
bit DFP so this needs to be done in two steps.  The first needs to be
done with the "prepare for shorter precision rounding mode" in order
to produce a correct result.

gcc/ChangeLog:

2016-03-11  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md ("trunctddd2"): Turn former define_insn into
	define_expand.
	("*trunctddd2"): New pattern definition.
	("trunctdsd2"): Set prep_for_short_prec rounding mode for the
	TD->DD truncation.

gcc/testsuite/ChangeLog:

2016-03-11  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/dfp-1.c: New test.

From-SVN: r234134
2016-03-11 07:47:47 +00:00
Andreas Krebbel
ae8e301e08 S/390: Define macros for rounding mode constants
This patch replaces a few magic numbers used for floating point
rounding modes with macros.  This is mostly a NoOp change apart from:

fixuns_truncdddi2, fixuns_trunctddi2, fixuns_trunc<mode>si2: Replace 5
with DFP_RND_TOWARD_0 (which is 9).

5 as well as 9 represent round towards 0 with the difference that for
5 the new DFP quantum exception is enabled as well.  This exception
isn't IEEE754 and we do not have an interface to enable and test it
anyway.  So we do not intend to enable it.  This so far should not
have any noticable effect since the quantum exception was not
observable through the Posix functions.

Some pattern ("fix_trunc<mode>di2") is already using rounding mode 9
correctly.

gcc/ChangeLog:

2016-03-11  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md (BFP_RND_*, DFP_RND_*): Add new constant
	definitions for BFP and DFP rounding modes.
	("fixuns_truncdddi2", "fixuns_trunctddi2")
	("fixuns_trunc<BFP:mode><GPR:mode>2", "fixuns_trunc<mode>si2")
	("fix_trunc<DSF:mode><GPR:mode>2", "fix_trunc<mode>di2")
	("fix_trunctf<mode>2"): Use the new constants instead of magic
	numbers.

From-SVN: r234133
2016-03-11 07:24:41 +00:00
Andreas Krebbel
dd95128ba9 S/390: Rename shift_count_or_setmem_operand to setmem_operand
The shift_count_or_setmem_operand predicate is now only used for
setmem patterns anymore.  Rename it together with the related
functions.

gcc/ChangeLog:

2016-03-11  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/constraints.md: Adjust comment.
	("Y"): Adjust comment.  Rename s390_decompose_shift_count to
	s390_decompose_addrstyle_without_index.
	* config/s390/predicates.md (shift_count_or_setmem_operand):
	Rename to setmem_operand.
	* config/s390/s390-protos.h
	(s390_decompose_shift_count): Rename to
	s390_decompose_addrstyle_without_index.
	* config/s390/s390.c (s390_decompose_shift_count)
	(s390_mem_constraint, print_shift_count_operand)
	(print_operand_address, print_operand): Rename
	s390_decompose_shift_count to
	s390_decompose_addrstyle_without_index and rename
	print_shift_count_operand to print_addrstyle_operand troughout the
	file.
	* config/s390/s390.md ("setmem_long_<P:mode>", "*setmem_long")
	("*setmem_long_and", "*setmem_long_31z", "*setmem_long_and_31z"):
	Rename shift_count_or_setmem_operand to setmem_operand.
	* config/s390/vx-builtins.md ("vec_insert<mode>")
	("vec_promote<mode>"): Replace shift_count_or_setmem_operand with
	nonmemory_operand.

From-SVN: r234132
2016-03-11 07:23:49 +00:00
GCC Administrator
a0232c64e7 Daily bump.
From-SVN: r234130
2016-03-11 00:16:14 +00:00
Ulrich Weigand
8287dbce7b re PR target/70168 (Wrong code generation in __sync_val_compare_and_swap on PowerPC)
PR target/70168
	* config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap):
	Handle overlapping retval and newval.

From-SVN: r234126
2016-03-10 23:58:44 +00:00
Cesar Philippidis
f6c1032d03 re PR testsuite/70009 (test case libgomp.oacc-c-c++-common/vprop.c fails starting with its introduction in r233607)
libgomp/
	PR testsuite/70009
	* testsuite/libgomp.oacc-c-c++-common/vprop.c: Make test data signed.

From-SVN: r234124
2016-03-10 14:50:40 -08:00
Jason Merrill
2ed21e590f * g++.dg/ubsan/pr70135.C: Don't rely on C++17 static_assert.
From-SVN: r234120
2016-03-10 15:19:47 -05:00
Nick Clifton
a3dc87600f re PR target/7044 (vax casesi breakage)
PR target/7044
	* config/aarch64/aarch64.c
	(aarch64_override_options_after_change_1): When forcing
	flag_omit_frame_pointer to be true, use a special value that can
	be detected if this function is called again, thus preventing
	flag_omit_leaf_frame_pointer from being forced to be false.

	* gcc.target/aarch64/pr70044.c: New test.

From-SVN: r234118
2016-03-10 17:24:16 +00:00
Patrick Palka
b87a8d7de7 re PR c++/70001 (Infinity compilation time)
PR c++/70001
	* constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
	return value from cxx_eval_constant_expression from earlier
	elements if it is valid constant initializer requiring no
	relocations.

	* g++.dg/cpp0x/constexpr-70001-1.C: New test.
	* g++.dg/cpp0x/constexpr-70001-2.C: New test.
	* g++.dg/cpp0x/constexpr-70001-3.C: New test.

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

From-SVN: r234117
2016-03-10 18:23:06 +01:00
Kyrylo Tkachov
48090169ea [AArch64] Fix thinko in handling of -momit-leaf-frame-pointer option
* common/config/aarch64/aarch64-common.c (aarch64_handle_option):
	Set x_flag_omit_leaf_frame_pointer when handling
	-momit-leaf-frame-pointer.

From-SVN: r234116
2016-03-10 16:24:26 +00:00
Jan Hubicka
4f4ada6afb re PR ipa/69589 (ICE in initialize_node_lattices, at ipa-cp.c:971)
PR lto/69589
	* cgraph.c (cgraph_node::dump): Dump split_part and indirect_call_target.
	* cgraph.h (cgraph_node): Add indirect_call_target flag.
	* ipa.c (has_addr_references_p): Cleanup.
	(is_indirect_call_target_p): New.
	(walk_polymorphic_call_targets): Do not mark virtuals that may be
	called indirectly as local.
	(symbol_table::remove_unreachable_nodes): Compute indirect_call_target.

	* g++.dg/lto/pr69589_0.C: New testcase
	* g++.dg/lto/pr69589_1.C: New testcase

From-SVN: r234115
2016-03-10 16:11:14 +00:00
Jan Hubicka
079cd8548b re PR lto/69630 (LTO ICE in types_same_for_odr at ipa-devirt.c:402)
PR ipa/69630
	* ipa-devirt.c (possible_polymorphic_call_targets): Do not ICE
	on cxa_pure_virtual.

From-SVN: r234114
2016-03-10 16:05:59 +00:00
Jan Hubicka
2b9c477e7c re PR ipa/69589 (ICE in initialize_node_lattices, at ipa-cp.c:971)
PR lto/69589
	* tree.c (free_lang_data_in_decl): Clear visibility of TYPE_DECL.

From-SVN: r234113
2016-03-10 16:02:55 +00:00
Jan Hubicka
015f20e49a re PR ipa/69589 (ICE in initialize_node_lattices, at ipa-cp.c:971)
PR lto/69589
	* tree.c (need_assembler_name_p): Only record main variant type names.

From-SVN: r234112
2016-03-10 16:02:00 +00:00
Marek Polacek
d49b0aa091 re PR c++/70153 (ICE on valid C++ code)
PR c++/70153
	* cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.

	* g++.dg/delayedfold/unary-plus1.C: New test.

From-SVN: r234111
2016-03-10 15:13:01 +00:00
Andre Vieira
c81e3837a9 pr45701-1.c: Escape brackets.
2016-03-10 Andre Vieira <andre.simoesdiasvieira@arm.com>

    gcc/testsuite/
    * gcc.target/arm/pr45701-1.c: Escape brackets.
    * gcc.target/arm/pr45701-2.c: Likewise.

From-SVN: r234109
2016-03-10 13:43:29 +00:00
Christophe Lyon
48bb1a55e8 re PR target/70113 ([AArch64] -mpc-relative-literal-loads conflicts with fix-cortex-a53-843419)
2016-03-10  Christophe Lyon  <christophe.lyon@linaro.org>

	PR target/70113.
	* config/aarch64/aarch64.h (TARGET_FIX_ERR_A53_843419_DEFAULT):
	Always define to 0 or 1.
	(TARGET_FIX_ERR_A53_843419): New macro.
	* config/aarch64/aarch64-elf-raw.h
	(TARGET_FIX_ERR_A53_843419_DEFAULT): Update for above changes.
	* config/aarch64/aarch64-linux.h: Likewise.
	* config/aarch64/aarch64.c
	(aarch64_override_options_after_change_1): Do not default
	aarch64_nopcrelative_literal_loads to true if Cortex-A53 erratum
	843419 is on.
	(aarch64_attributes): Handle fix-cortex-a53-843419.
	(aarch64_can_inline_p): Likewise.
	* config/aarch64/aarch64.opt (aarch64_fix_a53_err843419): Save.

From-SVN: r234108
2016-03-10 14:29:48 +01:00
Alan Lawrence
71017a7b78 Add -funconstrained-commons to work around PR/69368 (and others) in SPEC2006
gcc/:

        * common.opt (funconstrained-commons, flag_unconstrained_commons): New.
        * tree.c (array_at_struct_end_p): Do not limit to size of decl for
        DECL_COMMONS if flag_unconstrained_commons is set.
        * tree-dfa.c (get_ref_base_and_extent): Likewise.
        * doc/invoke.texi (Optimize Options): Add -funconstrained-commons.
        (funconstrained-commons): Document.

gcc/testsuite:

	* gfortran.dg/unconstrained_commons.f: New.


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

From-SVN: r234106
2016-03-10 12:19:45 +00:00
Christophe Lyon
4b20661790 t-aarch64 (OPTIONS_H_EXTRA): Add aarch64-fusion-pairs.def and aarch64-tuning-flags.def
2016-03-10  Christophe Lyon  <christophe.lyon@linaro.org>

	* config/aarch64/t-aarch64 (OPTIONS_H_EXTRA): Add
	aarch64-fusion-pairs.def and aarch64-tuning-flags.def

From-SVN: r234105
2016-03-10 13:03:25 +01:00
Ilya Enkovich
dc6a314740 tree-vect-stmts.c (vectorizable_mask_load_store): Check mask has a proper number of elements.
gcc/

	* tree-vect-stmts.c (vectorizable_mask_load_store): Check mask
	has a proper number of elements.

From-SVN: r234104
2016-03-10 10:58:57 +00:00
Alan Modra
ba52669fc5 PR69195, Reload confused by invalid reg_equiv
Optimizing indirect jumps to direct jumps, and deleting dead insns can
lead to changes in register lifetimes, which in turn can result in bad
reg_equiv info being passed to reload.  So do these tasks before
calculating reg_equiv info.

gcc/
	PR rtl-optimization/69195
	PR rtl-optimization/47992
	* ira.c (recorded_label_ref): Delete.
	(update_equiv_regs): Return void.
	(indirect_jump_optimize): New function.
	(ira): Call indirect_jump_optimize and delete_trivially_dead_insns
	before regstat_compute_ri.  Don't rebuild_jump_labels here.
	Delete update_regstat.
gcc/testsuite/
	* gcc.dg/pr69195.c: New.
	* gcc.dg/pr69238.c: New.

From-SVN: r234101
2016-03-10 21:17:13 +10:30
Tom de Vries
2774233234 Xfail pr46032.c scan if alignment requirements not met
2016-03-10  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/68915
	* gcc.dg/vect/pr46032.c: Xfail scan if alignment requirements not met.

From-SVN: r234100
2016-03-10 08:37:01 +00:00
Richard Biener
3a81a5941f re PR tree-optimization/70128 (Linux kernel div patching optimized away)
2016-03-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/70128
	* tree-ssa-structalias.c (set_uids_in_ptset): Set
	vars_contains_nonlocal for any FUNCTION_DECL or LABEL_DECL.

	* gcc.dg/tree-ssa/alias-34.c: New testcase.
	* gcc.dg/tree-ssa/alias-35.c: Likewise.

From-SVN: r234099
2016-03-10 08:06:03 +00:00
GCC Administrator
ac58dca5fa Daily bump.
From-SVN: r234097
2016-03-10 00:16:15 +00:00
Jakub Jelinek
c2864f02e0 re PR tree-optimization/70152 (gcc ICE at -O3 and above on valid code on x86_64-linux-gnu in "replace_uses_by")
PR tree-optimization/70152
	* tree-sra.c (replace_removed_params_ssa_names): Copy over
	SSA_NAME_OCCURS_IN_ABNORMAL_PHI from old_name to new_name.

	* gcc.dg/pr70152.c: New test.

From-SVN: r234092
2016-03-09 21:12:19 +01:00
Jakub Jelinek
3433b975ae re PR target/70086 (ICE: in extract_constrain_insn_cached, at recog.c:2202 (insn does not satisfy its constraints) with -mavx512vl -ffloat-store)
PR target/70086
	* config/i386/i386.md (truncdfsf2 splitter): Use gen_vec_concatv2df
	instead of gen_sse2_loadlpd.
	* config/i386/sse.md (*vec_concatv2df): Rename to...
	(vec_concatv2df): ... this.

	* gcc.target/i386/pr70086-1.c: New test.
	* gcc.target/i386/pr70086-2.c: New test.
	* gcc.target/i386/pr70086-3.c: New test.

From-SVN: r234091
2016-03-09 21:06:59 +01:00
Jakub Jelinek
2bd8090ff5 re PR middle-end/70127 (wrong code on x86_64-linux-gnu at -O3 in 32-bit and 64-bit modes)
PR tree-optimization/70127
	* fold-const.c (operand_equal_p): Revert the 2015-10-28 change.

	* gcc.c-torture/execute/pr70127.c: New test.

From-SVN: r234090
2016-03-09 21:05:40 +01:00
Cesar Philippidis
96b3c82df1 c-parser.c (c_parser_oacc_loop): Update cclauses and clauses when calling c_finish_omp_clauses.
gcc/c/
	* c-parser.c (c_parser_oacc_loop): Update cclauses and clauses
	when calling c_finish_omp_clauses.

	gcc/cp/
	* parser.c (cp_parser_oacc_loop): Update cclauses and clauses
	when calling c_finish_omp_clauses.

	gcc/testsuite/
	* c-c++-common/goacc/combined-directives-2.c: New test.

From-SVN: r234089
2016-03-09 11:39:53 -08:00
David Malcolm
b4f3232d69 PR c++/70105: prevent nonsensical underline spew for macro expansions
diagnostic_show_locus can sometimes do the wrong thing when handling
expressions built up from macros.

PR c++/70105 (currently marked as a P3 regression) has an example of
a diagnostic where over 500 lines of irrelevant source are printed,
and underlined, giving >1000 lines of useless spew to stderr.

This patch adds extra sanitization to diagnostic-show-locus.c, so that
we only attempt to print underlines and secondary locations if such
locations are "sufficiently sane" relative to the primary location
of a diagnostic.

This "sufficiently sane" condition is implemented by a new helper
function compatible_locations_p, which requires such locations to
have the same macro expansion hierarchy as the primary location,
using linemap_macro_map_loc_unwind_toward_spelling, effectively
mimicing the expansion performed by LRK_SPELLING_LOCATION.

This may be too strong a condition, but it effectively fixes
PR c++/70105, without removing any underlines in my testing.

Successfully bootstrapped&regrtested in combination with the previous
patch on x86_64-pc-linux-gnu; adds 15 new PASS results to g++.sum
and 4 new PASS results to gcc.sum.

gcc/ChangeLog:
	PR c/68473
	PR c++/70105
	* diagnostic-show-locus.c (compatible_locations_p): New function.
	(layout::layout): Sanitize ranges using compatible_locations_p.

gcc/testsuite/ChangeLog:
	PR c/68473
	PR c++/70105
	* g++.dg/diagnostic/pr70105.C: New test.
	* gcc.dg/plugin/diagnostic-test-expressions-1.c (foo): New decl.
	(test_multiple_ordinary_maps): New test function.

libcpp/ChangeLog:
	PR c/68473
	PR c++/70105
	* line-map.c (linemap_macro_map_loc_unwind_toward_spelling): Move
	decl...
	* include/line-map.h
	(linemap_macro_map_loc_unwind_toward_spelling): ...here,
	converting from static to extern.

From-SVN: r234088
2016-03-09 18:23:27 +00:00
David Malcolm
40499f81a6 PR c++/70105: Defer location expansion until diagnostic_show_locus
gcc/ChangeLog:
	PR c/68473
	PR c++/70105
	* diagnostic-show-locus.c (layout_range::layout_range): Replace
	location_range param with three const expanded_locations * and a
	bool.
	(layout::layout): Replace call to
	rich_location::lazily_expand_location with get_expanded_location.
	Extract the range and perform location expansion here, passing
	the results to the layout_range ctor.
	* diagnostic.c (source_range::debug): Delete.
	* diagnostic.h (diagnostic_expand_location): Reimplement in terms
	of rich_location::get_expanded_location.
	* gcc-rich-location.c (get_range_for_expr): Delete.
	(gcc_rich_location::add_expr): Reimplement to avoid the
	rich_location::add_range overload that took a location_range,
	passing a location_t instead.

gcc/testsuite/ChangeLog:
	PR c/68473
	PR c++/70105
	* gcc.dg/plugin/diagnostic_plugin_show_trees.c (show_tree):
	Drop range information from call to inform_at_rich_loc.
	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (add_range):
	New.
	(test_show_locus): Replace calls to rich_location::add_range with
	calls to add_range.  Rewrite the tests that used the now-defunct
	rich_location ctor taking a source_range.  Simplify other tests
	by replacing calls to COMBINE_LOCATION_DATA with calls to
	make_location.

libcpp/ChangeLog:
	PR c/68473
	PR c++/70105
	* include/line-map.h (source_range::debug): Delete.
	(struct location_range): Update comment.  Replace
	expanded_location fields "m_start", "m_finish", and "m_caret" with
	a source_location field: "m_loc".
	(class rich_location): Reword comment.
	(rich_location::get_loc): Reimplement in terms of a new overloaded
	variant which takes an unsigned int.
	(rich_location::get_loc_addr): Delete.
	(rich_location::add_range): Drop params "start" and "finish" in
	favor of param "loc".  Drop overloaded variants taking a
	source_range or location_range *.
	(rich_location::lazily_expand_location): Delete in favor of...
	(rich_location::get_expanded_location): New decl.
	(rich_location::m_loc): Delete field.
	(rich_location::m_column_override): New field.
	* line-map.c (rich_location::rich_location):  Drop name of
	line_maps * param.  Update initializations for deletion of field
	"m_loc" and addition of field "m_column_override".  Reimplement
	body as a call to add_range.  Delete overloaded variant taking a
	source_range.
	(rich_location::get_loc): New function.
	(rich_location::lazily_expand_location): Delete in favor of...
	(rich_location::get_expanded_location): New function.
	(rich_location::override_column): Reimplement.
	(rich_location::add_range): Drop params "start" and "finish" in
	favor of param "loc".  Eliminate location expansion in favor of
	simply storing loc.  Drop overloaded variants taking a
	source_range or location_range *.
	(rich_location::set_range): Eliminate location expansion.

From-SVN: r234087
2016-03-09 18:14:43 +00:00
Richard Biener
c9e336624a re PR tree-optimization/70138 (wrong code at -O3 on x86_64-linux-gnu)
2016-03-09  Richard Biener  <rguenther@suse.de>
	Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/70138
	* tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer):
	Also skip vect_double_reduction_def.

	* gcc.dg/vect/pr70138-1.c: New testcase.
	* gcc.dg/vect/pr70138-2.c: Likewise.

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

From-SVN: r234086
2016-03-09 16:41:19 +00:00