Commit Graph

30092 Commits

Author SHA1 Message Date
Jeff Law dd68669b66 re PR middle-end/80422 (ICE on valid code at -O3 in 32-bit mode on x86_64-linux-gnu: in operator[], at vec.h:732)
PR middle-end/80422
	* cfgcleanup.c (try_crossjump_to_edge): Verify SRC1 and SRC2 have
	predecessors after walking up the insn chain.

	PR middle-end/80422
	* gcc.c-torture/compile/pr80422.c: New test.

From-SVN: r246975
2017-04-18 11:31:30 -06:00
Jakub Jelinek 1cda61fc28 re PR debug/80263 (gcc's internal type "sizetype" leaks out as base type name in the DWARF info)
PR debug/80263
	* dwarf2out.c (modified_type_die): Try harder not to emit internal
	sizetype type into debug info.

	* gcc.dg/debug/dwarf2/pr80263.c: New test.

From-SVN: r246973
2017-04-18 18:58:48 +02:00
Michael Meissner 1997025337 re PR target/80099 (ICE in rs6000_expand_vector_extract, at config/rs6000/rs6000.c:7450)
[gcc]
2017-04-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80099
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Eliminate
	unneeded test for TARGET_UPPER_REGS_SF.
	* config/rs6000/vsx.md (vsx_extract_v4sf_var): Likewise.

[gcc/testsuite]
2017-04-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80099
	* gcc.target/powerpc/pr80099-1.c: New test.
	* gcc.target/powerpc/pr80099-2.c: Likewise.
	* gcc.target/powerpc/pr80099-3.c: Likewise.
	* gcc.target/powerpc/pr80099-4.c: Likewise.
	* gcc.target/powerpc/pr80099-5.c: Likewise.

From-SVN: r246972
2017-04-18 16:41:06 +00:00
Jakub Jelinek 3b5fb3cb5b re PR sanitizer/80444 (-fcompare-debug failures with -fsanitize-coverage=trace-pc)
PR sanitizer/80444
	* sancov.c (sancov_pass): Use gsi_start_nondebug_after_labels_bb
	instead of gsi_after_labels.

	* gcc.dg/sancov/pr80444.c: New test.

From-SVN: r246971
2017-04-18 17:02:06 +02:00
Jakub Jelinek 8487c9a550 re PR middle-end/79788 (ICE in expand_expr_real_2, at expr.c:9557)
PR middle-end/79788
	PR middle-end/80375
	* c-common.c (c_common_type_for_mode): Don't handle
	widest_*_literal_type_node here.
	c_common_signed_or_unsigned_type): Likewise.
	(c_common_nodes_and_builtins): Set widest_*_literal_type_node
	to *intTI_type_node or *intDI_type_node depending on whether
	TImode is supported by the target or not.

	* gcc.dg/pr79788-1.c: New test.
	* gcc.dg/pr79788-2.c: New test.

From-SVN: r246965
2017-04-18 15:15:46 +02:00
Marek Polacek d6e3e8a54c PR c++/80241 - ICE with alignas pack expansion.
* error.c (dump_expr): Handle TREE_LIST.
	* parser.c (cp_parser_std_attribute_list): Return error_mark if
	make_pack_expansion returns an error.

	* g++.dg/cpp0x/alignas11.C: New test.

From-SVN: r246963
2017-04-18 09:38:55 +00:00
Marek Polacek be7c73ae35 PR c++/80244 - ICE with attribute in template alias.
* tree.c (strip_typedefs): Handle UNDERLYING_TYPE.

	* g++.dg/cpp0x/alias-decl-59.C: New test.

From-SVN: r246962
2017-04-18 09:34:10 +00:00
Bernd Edlinger 1adb82e117 017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/80287
        * class.c (fixup_may_alias): Fix all type variants.

gcc/testsuite
2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de> 

        PR c++/80287
        * g++.dg/lto/pr80287_0.C: New test.

From-SVN: r246955
2017-04-17 20:41:40 +00:00
Kelvin Nilsen fb5e562100 re PR target/80315 (Calling __builtin_crypto_vshasigmaw with argument 3 out of range creates an unrecognizable insn)
gcc/testsuite/ChangeLog:

2017-04-12  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80315
	* gcc.target/powerpc/pr80315-1.c: New test.
	* gcc.target/powerpc/pr80315-2.c: New test.
	* gcc.target/powerpc/pr80315-3.c: New test.
	* gcc.target/powerpc/pr80315-4.c: New test.

From-SVN: r246949
2017-04-17 16:16:43 +00:00
Tom de Vries afeaeb708e Remove braces around line number in dejagnu directive
2017-04-16  Tom de Vries  <tom@codesourcery.com>

	* g++.dg/parse/error11.C: Remove braces around line number in dejagnu
	  directive.
	* g++.dg/parse/error3.C: Same.
	* g++.old-deja/g++.pt/niklas01a.C: Same.
	* gcc.dg/990506-0.c: Same.
	* gcc.dg/cpp/19990413-1.c: Same.
	* gcc.dg/cpp/pragma-1.c: Same.
	* gcc.dg/cpp/pragma-2.c: Same.
	* gcc.dg/m-un-2.c: Same.
	* objc.dg/private-1.m: Same.

From-SVN: r246945
2017-04-16 08:17:14 +00:00
Uros Bizjak 604f37cde8 pr54669.c: Fix dg-do directive.
* gcc.dg/pr54669.c: Fix dg-do directive.
	* gcc.dg/pr78582.c: Ditto.
	* gcc.dg/pr80020.c: Ditto.
	* gcc.dg/torture/pr57993-2.cpp: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-3.c: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-4.c: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-5.c: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-6.c: Ditto.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-5.c: Ditto.
	* gcc.dg/tree-ssa/pr79327-2.c: Ditto.
	* gcc.dg/tree-ssa/pr79352.c: Ditto.
	* gcc.dg/tree-ssa/pr79376.c: Ditto.
	* gcc.dg/tree-ssa/pr79691.c: Ditto.

From-SVN: r246941
2017-04-15 22:07:47 +02:00
Dominique d'Humieres 35cfdb17fa deferred_character_3.f90: Fix dg directive.
2017-04-15  Dominique d'Humieres  <dominiq@lps.ens.fr>

	* gfortran.dg/deferred_character_3.f90: Fix dg directive.
	* gfortran.dg/generic_29.f90: Likewise.
	* gfortran.dg/goacc/multi-clause.f90: Likewise.
	* gfortran.dg/pr41922.f90: Likewise.
	* gfortran.dg/pr70006.f90: Likewise.

From-SVN: r246940
2017-04-15 20:17:11 +02:00
Segher Boessenkool f378be388e rs6000: Testcase 20050830-1.c no longer fails (PR66612)
Bin's commit r246810, for PR80153, fixes 20050830-1.c for -m64 (it
already passed for -m32).  So, this patch removes the remaining xfail.


gcc/testsuite/
	PR tree-optimization/66612
	* gcc.target/powerpc/20050830-1.c: Remove xfail.

From-SVN: r246939
2017-04-15 06:11:35 +02:00
Janus Weil 4307649214 re PR fortran/80361 ([OOP] bogus recursive call to nonrecursive procedure with -fcheck=recursion)
2017-04-14  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80361
	* class.c (generate_finalization_wrapper): Give the finalization wrapper
	the recursive attribute.

2017-04-14  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80361
	* gfortran.dg/class_62.f90: New test case.

From-SVN: r246934
2017-04-14 23:17:52 +02:00
Andrew Burgess dd3d6a42fc arc: Fix for loop end detection
We use a negative ID number to link together the doloop_begin and
doloop_end instructions.  This negative ID number is setup within
doloop_begin, at this point the ID is stored into the loop end
instruction (doloop_end_i) and placed into the doloop_begin_i
instruction.

In arc.c (arc_reorg) we extract the ID from the doloop_end_i
instruction in order to find the matching doloop_begin_i instruction,
though the ID is only used in some cases.

Currently in arc_reorg when we extract the ID we negate it.  This
negation is invalid.  The ID stored in both doloop_end_i and
doloop_begin_i is already negative, the negation in arc_reorg means
that if we need to use the ID to find the doloop_begin_i then we will
never find it (as the IDs will never match).

This commit removes the unneeded negation, moves the extraction of the
ID into a more appropriately scoped block and adds a new test for this
issue.

gcc/ChangeLog:

	* config/arc/arc.c (arc_reorg): Move loop_end_id into a more local
	block, and do not negate it, the stored id is already negative.

gcc/testsuite/ChangeLog:

	* gcc.target/arc/loop-1.c: New file.


Co-Authored-By: Guy Benyei <guybe@mellanox.com>

From-SVN: r246933
2017-04-14 22:14:34 +01:00
Michael Meissner 31a07c8102 re PR target/80098 (ICE in curr_insn_transform, at lra-constraints.c:3816 on ppc64le)
[gcc]
2017-04-14  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80098
	* config/rs6000/rs6000-cpus.def (OTHER_P9_VECTOR_MASKS): Define
	masks of options that should be turned off if the VSX vector
	options are turned off.
	(OTHER_P8_VECTOR_MASKS): Likewise.
	(OTHER_VSX_VECTOR_MASKS): Likewise.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Call
	rs6000_disable_incompatible_switches to validate no type switches
	like -mvsx.
	(rs6000_incompatible_switch): New function to disallow turning on
	other vector options if -mno-vsx, -mno-power8-vector, or
	-mno-power9-vector are specified.

[gcc/testsuite]
2017-04-14  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80098
	* gcc.target/powerpc/pr80098-1.c: New test.
	* gcc.target/powerpc/pr80098-2.c: Likewise.
	* gcc.target/powerpc/pr80098-3.c: Likewise.
	* gcc.target/powerpc/pr80098-4.c: Likewise.

From-SVN: r246930
2017-04-14 20:27:18 +00:00
Jakub Jelinek 099560172f re PR sanitizer/80403 (UBSAN: compile time crash with "type mismatch in binary expression" message in / and % expr)
PR sanitizer/80403
	* fold-const.c (fold_ternary_loc): Revert
	use op0 instead of fold_convert_loc (loc, type, arg0) part of
	2017-04-12 change.

	* g++.dg/ubsan/pr80403-2.C: New test.

From-SVN: r246917
2017-04-13 21:52:58 +02:00
Vladimir Makarov bc04239603 re PR rtl-optimization/80343 (ICE in extract_constrain_insn, at recog.c:2213 (error: insn does not satisfy its constraints))
2017-04-13  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/80343
	* lra-remat.c (update_scratch_ops): Assign original hard reg to
	new scratch pseudo.

2017-04-13  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/80343
	* gcc.target/powerpc/pr80343.c: New.

From-SVN: r246914
2017-04-13 18:08:51 +00:00
Denis Khalikov abac4c3400 re PR sanitizer/80414 ([UBSAN] segfault with -fsanitize=undefined)
PR sanitizer/80414
	* ubsan.c (ubsan_expand_bounds_ifn): Pass original index
	to ubsan_encode_value.

	* c-c++-common/ubsan/bounds-15.c: New test.

From-SVN: r246909
2017-04-13 17:52:23 +03:00
Richard Biener 43a3aa03ac re PR testsuite/80416 (FAIL: g++.dg/torture/pr79671.C -O2 execution test)
2017-04-13  Richard Biener  <rguenther@suse.de>

	PR testsuite/80416
	* g++.dg/torture/pr79671.C: Fix asm constraints.

From-SVN: r246902
2017-04-13 11:17:38 +00:00
Jakub Jelinek 031fbdb9c9 re PR debug/80321 (infinite recursion with inlining of nested function and debug info)
PR debug/80321
	* dwarf2out.c (decls_for_scope): Ignore declarations of
	current_function_decl in BLOCK_NONLOCALIZED_VARS.

	* gcc.dg/debug/pr80321.c: New test.

2017-04-13  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/debug10.adb: New test.
	* gnat.dg/debug10_pkg.ads: New helper.

From-SVN: r246900
2017-04-13 13:05:09 +02:00
Jakub Jelinek deed3da9af re PR tree-optimization/79390 (10% performance drop in SciMark2 LU after r242550)
PR tree-optimization/79390
	* optabs.c (emit_conditional_move): If the preferred op2/op3 operand
	order does not result in usable sequence, retry with reversed operand
	order.

	* gcc.target/i386/pr70465-2.c: Xfail the scan-assembler-not test.

From-SVN: r246882
2017-04-12 20:09:47 +02:00
Jakub Jelinek b96a3e1157 re PR sanitizer/80403 (UBSAN: compile time crash with "type mismatch in binary expression" message in / and % expr)
PR sanitizer/80403
	PR sanitizer/80404
	PR sanitizer/80405
	* fold-const.c (fold_ternary_loc): Use op1 instead of arg1 as argument
	to fold_build2_loc.  Convert TREE_OPERAND (tem, 0) to type.  Use
	op0 instead of fold_convert_loc (loc, type, arg0).

	* g++.dg/ubsan/pr80403.C: New test.
	* g++.dg/ubsan/pr80404.C: New test.
	* g++.dg/ubsan/pr80405.C: New test.

From-SVN: r246881
2017-04-12 20:08:29 +02:00
Jakub Jelinek 7687375840 re PR middle-end/80163 (ICE on hopefully valid code)
PR c/80163
	* expr.c <CASE_CONVERT>: For EXPAND_INITIALIZER determine SIGN_EXTEND
	vs. ZERO_EXTEND based on signedness of treeop0's type rather than
	signedness of the result type.

	* gcc.dg/torture/pr80163.c: New test.

From-SVN: r246876
2017-04-12 15:57:45 +02:00
Richard Biener 940c9a7c2c re PR tree-optimization/80359 (DSE causes error: invalid reference prefix)
2017-04-12  Richard Biener  <rguenther@suse.de>
	Jeff Law  <law@redhat.com>

	PR tree-optimization/80359
	* tree-ssa-dse.c (maybe_trim_partially_dead_store): Do not
	trim stores to TARGET_MEM_REFs.

	* gcc.dg/torture/pr80359.c: New testcase.

Co-Authored-By: Jeff Law <law@redhat.com>

From-SVN: r246875
2017-04-12 13:47:26 +00:00
Richard Biener 350792ffae re PR target/79671 (mapnik miscompilation on armv7hl since r235622)
2017-04-12  Richard Biener  <rguenther@suse.de>
	Bernd Edlinger  <bernd.edlinger@hotmail.de>

	PR middle-end/79671
	* alias.c (component_uses_parent_alias_set_from): Handle
	TYPE_TYPELESS_STORAGE.
	(get_alias_set): Likewise.
	* tree-core.h (tree_type_common): Add typeless_storage flag.
	* tree.h (TYPE_TYPELESS_STORAGE): New macro.
	* stor-layout.c (place_union_field): Set TYPE_TYPELESS_STORAGE
	for types containing members with TYPE_TYPELESS_STORAGE.
	(place_field): Likewise.
	(layout_type): Likewise for ARRAY_TYPE.
	* lto-streamer-out.c (hash_tree): Hash TYPE_TYPELESS_STORAGE.
	* tree-streamer-in.c (unpack_ts_type_common_value_fields): Stream
	TYPE_TYPELESS_STORAGE.
	* tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise.

	lto/
	* lto.c (compare_tree_sccs_1): Compare TYPE_TYPELESS_STORAGE.

	cp/
	* tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
	for arrays of character or std::byte type.

	* g++.dg/torture/pr79671.C: New testcase.
	* g++.dg/lto/pr79671_0.C: Likewise.
	* g++.dg/lto/pr79671_1.c: Likewise.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>

From-SVN: r246866
2017-04-12 07:35:49 +00:00
Jakub Jelinek d62e6f1078 re PR sanitizer/80349 (UBSAN: compile time crash with "type mismatch in binary expression" message)
PR sanitizer/80349
	* fold-const.c (fold_binary_loc) <case BIT_IOR_EXPR>: Convert arg0's
	first argument to type.

	* g++.dg/ubsan/pr80349.C: New test.

From-SVN: r246865
2017-04-12 08:12:26 +02:00
Jakub Jelinek 347e1f7769 re PR c++/80370 (ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names))
PR c++/80370
	* decl.c (cp_finish_decomp): If processing_template_decl on
	non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
	change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
	sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
	processing.
	* pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
	with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
	dependent.

	* g++.dg/cpp1z/decomp28.C: New test.

From-SVN: r246857
2017-04-11 22:51:16 +02:00
Jakub Jelinek df1c878ec2 re PR middle-end/80100 (simplify-rtx.c sanitizer detects undefined behaviour with optimization)
PR middle-end/80100
	* simplify-rtx.c (simplify_binary_operation_1) <case IOR>: Perform
	left shift in unsigned HOST_WIDE_INT type.

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

From-SVN: r246851
2017-04-11 19:21:51 +02:00
Jakub Jelinek 8585103f05 re PR rtl-optimization/80385 (Segfault in commutative_operand_precedence() rtlanal.c:3373)
PR rtl-optimization/80385
	* simplify-rtx.c (simplify_unary_operation_1): Don't transform
	(not (neg X)) into (plus X -1) for complex or non-integral modes.

	* g++.dg/opt/pr80385.C: New test.

From-SVN: r246850
2017-04-11 19:19:56 +02:00
Martin Liska c6cf6ef7c0 Add function part to a same comdat group (PR ipa/80212).
2017-04-11  Martin Liska  <mliska@suse.cz>

	PR ipa/80212
	* cgraph.c (cgraph_node::dump): Dump calls_comdat_local.
	* ipa-split.c (split_function): Create a local comdat symbol
	if caller is in a comdat group.
2017-04-11  Martin Liska  <mliska@suse.cz>

	PR ipa/80212
	* g++.dg/ipa/pr80212.C: New test.

From-SVN: r246848
2017-04-11 16:38:19 +00:00
Martin Sebor 3812f46046 PR middle-end/80364 - sanitizer detects signed integer overflow in gimple-ssa-sprintf.c
gcc/ChangeLog:
	PR middle-end/80364
	* gimple-ssa-sprintf.c (get_int_range): Remove second argument and
	always use the int type.  Use INTEGRAL_TYPE_P() rather than testing
	for INTEGER_TYPE.
	(directive::set_width, directive::set_precision, format_character):
	Adjust.
	(parse_directive): Use INTEGRAL_TYPE_P() rather than testing for
	INTEGER_TYPE.

gcc/testsuite/ChangeLog:
	PR middle-end/80364
	* gcc.dg/tree-ssa/builtin-sprintf-warn-16.c: New test.

From-SVN: r246846
2017-04-11 10:35:34 -06:00
Martin Liska 9f67937000 Do not instrument register variables in object-size sanitizer (PR sanitizer/70878).
2017-04-11  Martin Liska  <mliska@suse.cz>

	PR sanitizer/70878
	* ubsan.c (instrument_object_size): Do not instrument register
	variables.
2017-04-11  Martin Liska  <mliska@suse.cz>

	PR sanitizer/70878
	* gcc.dg/ubsan/pr70878.c: New test.

From-SVN: r246837
2017-04-11 13:08:08 +00:00
Jakub Jelinek cb278caa18 re PR target/80381 (AVX512: -O3, _mm512_srai_epi32, the last argument must be an 8-bit immediate)
PR target/80381
	* config/i386/i386-builtin-types.def
	(V16HI_FTYPE_V16HI_INT_V16HI_UHI_COUNT,
	V16HI_FTYPE_V16HI_V8HI_V16HI_UHI_COUNT,
	V16SI_FTYPE_V16SI_INT_V16SI_UHI_COUNT,
	V16SI_FTYPE_V16SI_V4SI_V16SI_UHI_COUNT,
	V2DI_FTYPE_V2DI_INT_V2DI_UQI_COUNT,
	V2DI_FTYPE_V2DI_V2DI_V2DI_UQI_COUNT,
	V32HI_FTYPE_V32HI_INT_V32HI_USI_COUNT,
	V32HI_FTYPE_V32HI_V8HI_V32HI_USI_COUNT,
	V4DI_FTYPE_V4DI_INT_V4DI_UQI_COUNT,
	V4DI_FTYPE_V4DI_V2DI_V4DI_UQI_COUNT,
	V4SI_FTYPE_V4SI_INT_V4SI_UQI_COUNT,
	V4SI_FTYPE_V4SI_V4SI_V4SI_UQI_COUNT,
	V8DI_FTYPE_V8DI_INT_V8DI_UQI_COUNT,
	V8DI_FTYPE_V8DI_V2DI_V8DI_UQI_COUNT,
	V8HI_FTYPE_V8HI_INT_V8HI_UQI_COUNT,
	V8HI_FTYPE_V8HI_V8HI_V8HI_UQI_COUNT,
	V8SI_FTYPE_V8SI_INT_V8SI_UQI_COUNT,
	V8SI_FTYPE_V8SI_V4SI_V8SI_UQI_COUNT): New function type aliases.
	* config/i386/i386-builtin.def (__builtin_ia32_pslld512_mask,
	__builtin_ia32_pslldi512_mask, __builtin_ia32_psllq512_mask,
	__builtin_ia32_psllqi512_mask, __builtin_ia32_psrad512_mask,
	__builtin_ia32_psradi512_mask, __builtin_ia32_psraq512_mask,
	__builtin_ia32_psraqi512_mask, __builtin_ia32_psrld512_mask,
	__builtin_ia32_psrldi512_mask, __builtin_ia32_psrlq512_mask,
	__builtin_ia32_psrlqi512_mask, __builtin_ia32_psllwi128_mask,
	__builtin_ia32_pslldi128_mask, __builtin_ia32_psllqi128_mask,
	__builtin_ia32_psllw128_mask, __builtin_ia32_pslld128_mask,
	__builtin_ia32_psllq128_mask, __builtin_ia32_psllwi256_mask,
	__builtin_ia32_psllw256_mask, __builtin_ia32_pslldi256_mask,
	__builtin_ia32_pslld256_mask, __builtin_ia32_psllqi256_mask,
	__builtin_ia32_psllq256_mask, __builtin_ia32_psradi128_mask,
	__builtin_ia32_psrad128_mask, __builtin_ia32_psradi256_mask,
	__builtin_ia32_psrad256_mask, __builtin_ia32_psraqi128_mask,
	__builtin_ia32_psraq128_mask, __builtin_ia32_psraqi256_mask,
	__builtin_ia32_psraq256_mask, __builtin_ia32_psrldi128_mask,
	__builtin_ia32_psrld128_mask, __builtin_ia32_psrldi256_mask,
	__builtin_ia32_psrld256_mask, __builtin_ia32_psrlqi128_mask,
	__builtin_ia32_psrlq128_mask, __builtin_ia32_psrlqi256_mask,
	__builtin_ia32_psrlq256_mask, __builtin_ia32_psrawi256_mask,
	__builtin_ia32_psraw256_mask, __builtin_ia32_psrawi128_mask,
	__builtin_ia32_psraw128_mask, __builtin_ia32_psrlwi256_mask,
	__builtin_ia32_psrlw256_mask, __builtin_ia32_psrlwi128_mask,
	__builtin_ia32_psrlw128_mask, __builtin_ia32_psllwi512_mask,
	__builtin_ia32_psllw512_mask, __builtin_ia32_psrawi512_mask,
	__builtin_ia32_psraw512_mask, __builtin_ia32_psrlwi512_mask,
	__builtin_ia32_psrlw512_mask): Use _COUNT suffixed function type
	aliases.
	* config/i386/i386.c (ix86_expand_args_builtin): Rename last_arg_count
	flag to second_arg_count, handle 4 argument function type _COUNT
	aliases, handle second_arg_count on second argument rather than last.

	* gcc.target/i386/pr80381.c: New test.

From-SVN: r246835
2017-04-11 10:54:54 +02:00
Jakub Jelinek 82665822b1 re PR c++/80363 (#'vec_cond_expr' not supported by dump_expr#<expression error>)
PR c++/80363
	* error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.

	* g++.dg/ext/pr80363.C: New test.

From-SVN: r246834
2017-04-11 10:51:40 +02:00
Senthil Kumar Selvaraj abde687ac3 Fix bogus builtin-sprintf-warn-{3,10}.c failures for avr.
This patch fixes a whole bunch of failures reported for
gcc.dg/tree-ssa/builtin-sprintf-warn-{3,10}.c for the avr target.

builtin-sprintf-warn-10.c fails because the bounds in the warning
messages expect 4 digit wide exponents i.e. __DBL_MAX_EXP__ > 999.
For the avr, floats and doubles are both 32 bits wide, __DBL_MAX_EXP__
== 128, and the max number of exponent digits can only be 3 .
The computed size thus ends up one short of the value the test
expects. The patch makes the test run only for targets with double64plus.

builtin-sprintf-warn-3.c fails because the test appears to assume all
non lp64 targets to be ilp32. For the avr, pointer size and int size
are equal, but both are 16 bits, not 32. The patch fixes this by
explicitly adding avr to the dejagnu selector.

gcc/testsuite

2017-04-06  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: Require double64plus.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c (void test_too_large): 
	Add avr-*-* to non-lp64 selector.

From-SVN: r246831
2017-04-11 05:09:41 +00:00
Martin Sebor 13e6ec34a8 Adjust dg-bogus pattern to match the text of the changed diagnostic.
gcc/testsuite:
	* gcc.dg/pr40340-3.c: Adjust directive pattern.
	* gcc.dg/pr40340-4.c: Same.

From-SVN: r246827
2017-04-10 17:26:17 -06:00
Nicolas Koenig a2cb1196cf re PR fortran/69498 (ICE on disjunct cases with displaced or incomplete embedded statement)
2017-04-10  Nicolas Koenig  <koenigni@student.ethz.ch>
            Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69498 
	* module.c (gfc_match_submodule): Add error
	if function is called in the wrong state.

2017-04-10  Nicolas Koenig  <koenigni@student.ethz.ch>

	PR fortran/69498 
	* gfortran.dg/submodule_unexp.f90: Modified test
	to account for new error.
	* gfortran.dg/submodule_twice.f90: New Test


Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>

From-SVN: r246826
2017-04-10 20:58:21 +00:00
Jakub Jelinek b447b28c5e re PR c++/80176 (cannot bind reference to static member function using object access expression)
PR c++/80176
	* tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
	operand, if it is a static member function, recurse on the
	BASELINK.

	* g++.dg/init/ref23.C: New test.

From-SVN: r246825
2017-04-10 22:49:11 +02:00
Thomas Koenig 3bbd6768bd re PR tree-optimization/80304 (Wrong result with do concurrent)
2017-04-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR tree-optimization/80304
	* gfortran.dg/do_concurrent_4.f90:  New test case.

From-SVN: r246824
2017-04-10 20:40:48 +00:00
Janus Weil 99827b5ca0 re PR fortran/80046 ([F03] Explicit interface required: pointer argument)
2017-04-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80046
	* expr.c (gfc_check_pointer_assign): Check if procedure pointer
	components in a pointer assignment need an explicit interface.

2017-04-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80046
	* gfortran.dg/proc_ptr_comp_48.f90: New test case.

From-SVN: r246823
2017-04-10 22:28:23 +02:00
David Edelsohn 7db31bc20c * g++.dg/torture/pr79905.C: Add -maltivec option.
From-SVN: r246820
2017-04-10 15:50:33 -04:00
Jeff Law 9058a2c5c5 re PR tree-optimization/80374 (ICE in fold_convert_loc, at fold-const.c:2384)
PR tree-optimization/80374
	* tree-ssa-dom.c (derive_equivalences_from_bit_ior): Do not try to
	record anything if we can not convert integer_zero_node to the
	desired type.

	PR tree-optimization/80374
	* g++.dg/pr80374.c: New test.

From-SVN: r246819
2017-04-10 13:19:42 -06:00
Kelvin Nilsen bd8f86429e re PR target/80108 (ICE in aggregate_value_p at function.c:2028)
gcc/ChangeLog:

2017-04-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80108
	* config/rs6000/rs6000.c (rs6000_option_override_internal):
	Enhance special handling given to the TARGET_P9_MINMAX option in
	relation to certain other options.

gcc/testsuite/ChangeLog:

2017-04-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80108
	* gcc.target/powerpc/ppc-fortran/ppc-fortran.exp: New file.
	* gcc.target/powerpc/ppc-fortran/pr80108-1.f90: New test.

From-SVN: r246818
2017-04-10 19:01:37 +00:00
Uros Bizjak f634dd47d6 unroll-7.c: Declare "a" as a pointer to external array.
* gcc.dg/unroll-7.c: Declare "a" as a pointer to external array.

From-SVN: r246817
2017-04-10 20:58:34 +02:00
Uros Bizjak 065ba17919 re PR testsuite/79356 (XPASS in attr-alloc_size-11.c)
PR testsuite/79356
	* gcc.dg/attr-alloc_size-11.c: Don't xfail on alpha.

From-SVN: r246816
2017-04-10 20:51:42 +02:00
Daniel Santos 71b838d035 re PR testsuite/79867 ([cygwin] LD_LIBRARY_PATH ignored, contaminating (nearly?) all test results)
2017-04-10  Daniel Santos <daniel.santos@pobox.com>

	PR testsuite/79867
	* lib/target-libpath.exp: Merge in cygwin fix from libffi.

From-SVN: r246813
2017-04-10 17:45:35 +00:00
Marek Polacek 98a7a34e26 re PR sanitizer/80348 (UBSAN: compile time crash in ubsan_instrument_division)
PR sanitizer/80348
	* typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
	ORIG_TYPE earlier and not only when shortening.

	* g++.dg/ubsan/div-by-zero-3.C: New test.

From-SVN: r246812
2017-04-10 17:18:15 +00:00
Bin Cheng aac69a62a1 re PR tree-optimization/80153 (ivopt generate wrong code)
PR tree-optimization/80153
	* tree-affine.c (aff_combination_to_tree): Get base pointer from
	the first element of pointer type aff_tree.  Build result expr in
	aff_tree's type.
	(add_elt_to_tree): Convert to type unconditionally.  Remove other
	fold_convert calls.
	* tree-ssa-loop-ivopts.c (alloc_iv): Pass in consistent types.
	(rewrite_use_nonlinear_expr): Check invariant using iv information.
	gcc/testsuite
	PR tree-optimization/80153
	* gcc.c-torture/execute/pr80153.c: New.

From-SVN: r246810
2017-04-10 16:51:44 +00:00
Richard Biener 737237c9b8 re PR middle-end/80362 (gcc miscompiles arithmetic with signed char)
2017-04-10  Richard Biener  <rguenther@suse.de>

	PR middle-end/80362
	* fold-const.c (fold_binary_loc): Look at unstripped ops when
	looking for NEGATE_EXPR in -A / -B to A / B folding.

	* gcc.dg/torture/pr80362.c: New testcase.

From-SVN: r246805
2017-04-10 13:02:12 +00:00