Commit Graph

160590 Commits

Author SHA1 Message Date
GCC Administrator
f2a3aa64a7 Daily bump.
From-SVN: r259111
2018-04-05 00:16:23 +00:00
Jason Merrill
a7ec7182db PR c++/84938 - ICE with division by ~-1.
* call.c (set_up_extended_ref_temp): Call cp_fully_fold.

From-SVN: r259108
2018-04-04 20:09:10 -04:00
Jason Merrill
0dd285f9a8 PR c++/84936 - ICE with unexpanded pack in mem-initializer.
* parser.c (cp_parser_mem_initializer_list): Call
	check_for_bare_parameter_packs.

From-SVN: r259107
2018-04-04 20:09:05 -04:00
Jason Merrill
01e1df9ff6 re PR c++/84221 (spurious -Wunused warning on a variable of a template type declared unused)
PR c++/84221
* g++.dg/warn/Wunused-var-32.C: Test explicit specialization.

From-SVN: r259106
2018-04-04 15:59:20 -04:00
Paolo Carlini
dbaee5894c re PR c++/80026 ([pending testcase installation] passing unresolved function pointer to variadic function template yields "too many arguments" error)
2018-04-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/80026
	* g++.dg/cpp0x/variadic174.C: New.

From-SVN: r259105
2018-04-04 19:57:33 +00:00
Jakub Jelinek
2ff7172ad6 re PR inline-asm/85172 (internal compiler error: unexpected expression '<statement>' of kind asm_expr)
PR inline-asm/85172
	* constexpr.c (cxx_eval_builtin_function_call): For calls to
	builtin_valid_in_constant_expr_p functions, don't call
	cxx_eval_constant_expression if argument is not
	potential_constant_expression.

	* g++.dg/ext/builtin13.C: New test.
	* g++.dg/ext/atomic-4.C: New test.

From-SVN: r259104
2018-04-04 21:55:56 +02:00
Jakub Jelinek
628a15343e re PR c++/85146 (ICE with __direct_bases for declared but not defined struct)
PR c++/85146
	* cp-tree.h (calculate_bases, calculate_direct_bases): Add complain
	argument.
	* semantics.c (calculate_bases): Add complain argument.  Use
	complete_type_or_maybe_complain instead of just complete_type and
	return an empty vector if it fails.  Move make_tree_vector () call
	after early return.  Formatting fixes.
	(calculate_direct_bases): Likewise.  Call release_tree_vector at the
	end.
	(dfs_calculate_bases_post, calculate_bases_helper): Formatting fixes.
	* pt.c (tsubst_pack_expansion): Adjust calculate_bases and
	calculate_direct_bases callers, formatting fixes.

	* g++.dg/ext/bases2.C: Expect extra error diagnostics.
	* g++.dg/ext/bases3.C: New test.

From-SVN: r259101
2018-04-04 21:34:18 +02:00
Jason Merrill
001db6cf52 PR c++/85006 - -fconcepts ICE with A<auto...> return type
* pt.c (tsubst_pack_expansion): Allow unsubstituted auto pack.

From-SVN: r259100
2018-04-04 15:19:34 -04:00
Jason Merrill
8859913ea3 PR c++/85200 - ICE with constexpr if in generic lambda.
* tree.c (cp_walk_subtrees): Walk into DECL_EXPR in templates.

From-SVN: r259099
2018-04-04 15:10:38 -04:00
Jason Merrill
3dba92a96d PR c++/84221 - bogus -Wunused with attribute and template.
* decl2.c (is_late_template_attribute): Handle unused and used
	normally on non-TYPE_DECL.

From-SVN: r259098
2018-04-04 15:10:32 -04:00
Thomas Preud'homme
f4d43ef086 [ARM] Fix PR85203: cmse_nonsecure_caller returns wrong result
__builtin_cmse_nonsecure_caller implementation returns true in almost
all cases due to 2 separate bugs:

* gen_addsi is used instead of gen_andsi to retrieve the lsb
* the lsb boolean value is not negated but the specification says
  the intrinsic should return true for a nonsecure caller and a
  nonsecure caller is characterized with LR's lsb being 0

This was not caught due to (1) lack of runtime test and (2) the existing
RTL scan not taking into account that '.' matches newline in Tcl regular
expressions.

This commit fixes the implementation issues and improves testing of
cmse_nonsecure_caller by (1) adding a runtime test for the secure caller
case and (2) looking for an SET insn of an AND expression in the right
function. This leaves the nonsecure caller case only partly tested
since the exact value being AND and the negation are not covered by the
scan and the existing test infrastructure does not allow 2 separate
compilation and link to be performed. It is enough though to catch the
current incorrect behavior.

The commit also reorganize the scan directives in cmse-1.c to more
easily identify what function they are intended to test in the file.

2018-04-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gcc/
    PR target/85203
    * config/arm/arm-builtins.c (arm_expand_builtin): Change
    expansion to perform a bitwise AND of the argument followed by a
    boolean negation of the result.

gcc/testsuite/
    PR target/85203
    * gcc.target/arm/cmse/cmse-1.c: Tighten cmse_nonsecure_caller RTL scan
    to match a single insn of the baz function.  Move scan directives at
    the end of the file below the functions they are trying to test for
    better readability.
    * gcc.target/arm/cmse/cmse-16.c: New testcase.

From-SVN: r259097
2018-04-04 17:31:46 +00:00
Jakub Jelinek
c5c4b2ae6e re PR other/85161 (Test case failures in libbacktrace on powerpc64 BE starting with r253456)
PR other/85161
	* elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
	big endian, only use 32-bit loads if endianity macros are predefined
	and indicate big or little endian.

From-SVN: r259096
2018-04-04 19:18:14 +02:00
Jason Merrill
600583ab73 PR c++/85135 - ICE with omitted template arguments.
* decl.c (grokdeclarator): Catch deduced class type in trailing
	return type.

From-SVN: r259092
2018-04-04 12:42:55 -04:00
Jason Merrill
6173fb512f PR c++/85133 - ICE with missing concept initializer.
* decl.c (cp_finish_decl): If a concept initializer is missing, use
	true.

From-SVN: r259091
2018-04-04 12:42:50 -04:00
Jason Merrill
bd40bc8ea3 PR c++/85118 - wrong error with generic lambda and std::bind.
* call.c (add_template_conv_candidate): Disable if there are any
	call operators.

From-SVN: r259090
2018-04-04 12:42:44 -04:00
Jason Merrill
7447f1d7e2 PR c++/85141 - ICE with compound assignment and static member fn.
* typeck.c (cp_build_modify_expr): Call decay_conversion for RHS of
	compound assignment.

From-SVN: r259089
2018-04-04 12:42:39 -04:00
Jason Merrill
239209c4c4 PR c++/85148 - ICE with 'this' in array NSDMI.
* tree.c (replace_placeholders_r): Use handled_component_p.

From-SVN: r259088
2018-04-04 12:42:33 -04:00
Ville Voutilainen
1229c56cb9 re PR c++/65923 (False positive for warning about literal operator suffix and using)
PR c++/65923

gcc/cp

PR c++/65923
* decl.c (grokfndecl): Handle standard UDL diagnostics here..
* parser.c (cp_parser_unqualified_id): ..not here.

testsuite/

PR c++/65923
* g++.dg/diagnostic/pr65923.C: New.

From-SVN: r259087
2018-04-04 19:05:11 +03:00
Peter Bergner
8c760464d0 re PR rtl-optimization/84878 (ICE: Segmentation fault (in add_cross_iteration_register_deps))
gcc/
	PR rtl-optimization/84878
	* ddg.c (add_cross_iteration_register_deps): Use DF_REF_BB to determine
	the basic block.  Assert the use reference is not artificial and that
	it has an associated insn.

gcc/testsuite/
	PR rtl-optimization/84878
	* gcc.target/powerpc/pr84878.c: New test.

From-SVN: r259085
2018-04-04 10:35:03 -05:00
Michael Matz
f1acdcd066 Fix -Wstringop-overflow regression
we shouldn't claim string overflows for character arrays at
end of structures; the code that tries to avoid these
accidentally passed the address of the accessed member to
array_at_struct_end_p(), but that one wants the component_ref
or array_ref itself.  Needs updating of one testcase that
incorrectly expected warning to occur in this situation.

From-SVN: r259083
2018-04-04 14:49:06 +00:00
Jakub Jelinek
eefecf6546 re PR testsuite/85189 (g++.dg/inherit/override-attribs.C FAILs on 32-bit x86)
PR testsuite/85189
	* g++.dg/inherit/override-attribs.C: Use dg-message instead of dg-error
	for the diagnostics of overridden functions.  Adjust for new wording.

From-SVN: r259082
2018-04-04 16:14:08 +02:00
Richard Biener
f3ac6d2c51 re PR debug/85176 (ICE in force_decl_die, at dwarf2out.c:25910)
2018-04-04  Richard Biener  <rguenther@suse.de>

	PR lto/85176
	* dwarf2out.c (dwarf2out_register_external_die): Peel namespaces
	from contexts for DINFO_LEVEL_TERSE and below.

	* g++.dg/lto/pr85176_0.C: New testcase.

From-SVN: r259080
2018-04-04 14:11:39 +00:00
Kito Cheng
b43502719f [NDS32] Restrict mov pattern that has at least one register operand.
gcc/
	* config/nds32/nds32-doubleword.md (move_<mode>): Require
	resiter_operand condition.
	* config/nds32/nds32.md (*move<mode>): Ditto.

From-SVN: r259077
2018-04-04 12:38:04 +00:00
Richard Biener
f46de383ed re PR tree-optimization/85191 (gcc.dg/vect/slp-perm-9.c FAILs)
2018-04-04  Richard Biener  <rguenther@suse.de>

	PR testsuite/85191
	* lib/target-supports.exp (check_effective_target_vect_perm_short):
	Fix typo.

From-SVN: r259075
2018-04-04 12:16:21 +00:00
Martin Liska
46cbaa50ed Disable anchors and msdata for ASAN test-case (PR sanirizer/85174).
2018-04-04  Martin Liska  <mliska@suse.cz>

	PR sanitizer/85174
	* c-c++-common/asan/pointer-compare-1.c: Disable section anchors
	and msdata as a workaround for powerpc.

From-SVN: r259074
2018-04-04 10:40:57 +00:00
Kito Cheng
2cf09a9966 [NDS32] Implement movmisalignsi and movmisaligndi pattern.
gcc/
	* config/nds32/nds32.md (movmisalign<mode>): New pattern.

Co-Authored-By: Monk Chiang <sh.chiang04@gmail.com>

From-SVN: r259073
2018-04-04 09:32:31 +00:00
Thomas Koenig
bb347ee227 re PR libfortran/85166 ([nvptx, libgfortran] Libgomp fortran tests using stop in offloaded fns fail to compile)
2018-04-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/85166
	* runtime/minimal.c (stop_numeric): Add new function in order to
	implement numeric stop on minimal targets.

From-SVN: r259072
2018-04-04 09:26:13 +00:00
Chung-Ju Wu
76dc9cb597 [NDS32] Merge movqi and movhi patterns.
gcc/
	* config/nds32/nds32.md (movqi, movhi): Merge into mov<mode>.

From-SVN: r259071
2018-04-04 09:19:39 +00:00
Chung-Ju Wu
6e9ca9328a [NDS32] Refine movcc, cmov, cstore and cbranch patterns.
gcc/
	* config/nds32/nds32-md-auxiliary.c (nds32_inverse_cond_code,
	nds32_cond_code_str, output_cond_branch,
	output_cond_branch_compare_zero, nds32_expand_cbranch,
	nds32_expand_cstore, nds32_expand_movcc,
	nds32_output_cbranchsi4_equality_zero,
	nds32_output_cbranchsi4_equality_reg,
	nds32_output_cbranchsi4_equality_reg_or_const_int,
	nds32_output_cbranchsi4_greater_less_zero: New functions.
	* config/nds32/nds32-protos.h (nds32_expand_cbranch,
	nds32_expand_cstore, nds32_expand_movcc,
	nds32_output_cbranchsi4_equality_zero,
	nds32_output_cbranchsi4_equality_reg,
	nds32_output_cbranchsi4_equality_reg_or_const_int,
	nds32_output_cbranchsi4_greater_less_zero): Declare.
	* config/nds32/predicates.md (nds32_movecc_comparison_operator,
	nds32_rimm11s_operand): New predicates.
	* config/nds32/nds32.h (nds32_expand_result_type): New enum type.
	* config/nds32/nds32.md: Rewrite all the branch and conditional move
	patterns.

Co-Authored-By: Kito Cheng <kito.cheng@gmail.com>

From-SVN: r259070
2018-04-04 08:48:56 +00:00
Kito Cheng
5ba6d58573 [NDS32] Refine instruction type attribute.
gcc/
	* config/nds32/nds32-doubleword.md: Refine all the instruction type.
	* config/nds32/nds32.md: Ditto.
	* config/nds32/pipelines.md: Ditto.

From-SVN: r259069
2018-04-04 08:25:36 +00:00
Richard Biener
7d048870c1 re PR tree-optimization/85168 (ICE in tree-ssa-coalesce.c: SSA corruption: Unable to coalesce ssa_names which are marked as MUST COALESCE when -O2 is used)
2018-04-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/85168
	* tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address): Avoid
	propagating abnormals.

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

From-SVN: r259068
2018-04-04 07:52:20 +00:00
Alexandre Oliva
24d21a0bc0 [PR c++/84943] mark function as used when taking its address
fn[0]() ICEd because we would fold the INDIRECT_REF used for the
array indexing while building the address for the call, after not
finding the decl hiding there at first.  But the decl would be exposed
by the folding, and then lower layers would complain we had the decl,
after all, but it wasn't one of the artificial or special functions
that could be called without being marked as used.

This patch arranges for a FUNCTION_DECL to be marked as used when
taking its address, just like we already did when taking the address
of a static function to call it as a member function (i.e. using the
obj.fn() notation).  However, we shouldn't mark functions as used when
just performing overload resolution, lest we might instantiate
templates we shouldn't, as in g++.dg/overload/template1.C, so we
adjust mark_used to return early when testing conversions.


for  gcc/cp/ChangeLog

	PR c++/84943
	* typeck.c (cp_build_addr_expr_1): Mark FUNCTION_DECL as
	used.
	* decl2.c (mark_used): Return without effects if tf_conv.

for  gcc/testsuite/ChangeLog

	PR c++/84943
	* g++.dg/pr84943.C: New.
	* g++.dg/pr84943-2.C: New.

From-SVN: r259067
2018-04-04 03:40:29 +00:00
Chung-Ju Wu
30feb954d0 [NDS32] Change enabled attribute to yes/no instead of 1/0.
gcc/
	* config/nds32/nds32.md (enabled): Use yes/no for this attribute.

From-SVN: r259066
2018-04-04 01:35:01 +00:00
Chung-Ju Wu
cc48a87f9d [NDS32] Refine implementation of sibcall patterns.
gcc/
	* config/nds32/nds32-md-auxiliary.c (nds32_long_call_p): New function.
	* config/nds32/nds32-protos.h (nds32_long_call_p): Declare.
	* config/nds32/nds32.c (nds32_function_ok_for_sibcall): New function.
	(TARGET_FUNCTION_OK_FOR_SIBCALL): Define.
	* config/nds32/nds32.md (sibcall_internal): New.
	(sibcall_register): Remove.
	(sibcall_immediate): Remove.
	(sibcall_value_internal): New.
	(sibcall_value_register): Remove.
	(sibcall_value_immediate): Remove.
	* config/nds32/predicates.md (nds32_general_register_operand): New.
	(nds32_call_address_operand): New.

Co-Authored-By: Kito Cheng <kito.cheng@gmail.com>

From-SVN: r259065
2018-04-04 00:56:16 +00:00
GCC Administrator
a1b81a0320 Daily bump.
From-SVN: r259064
2018-04-04 00:16:19 +00:00
Jonathan Wakely
c73847e77b PR libstdc++/85183 fix std::variant move-assignment
PR libstdc++/85183
	* include/std/variant (_Move_assign_base::operator=): Fix incorrect
	value categories.
	* testsuite/20_util/variant/85183.cc: New.

From-SVN: r259059
2018-04-04 00:03:07 +01:00
Jakub Jelinek
b6a7a294ce re PR rtl-optimization/85167 (shrink-wrap.c:333:15: runtime error with UBSAN)
PR rtl-optimization/85167
	* shrink-wrap.c (move_insn_for_shrink_wrap): Don't set bb_uses and
	bb_defs if *split_p, instead preinitialize it to NULL.

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

From-SVN: r259058
2018-04-03 23:45:52 +02:00
Jakub Jelinek
0d2f7959f7 re PR tree-optimization/85156 (ICE with -O1 -g: gimplification failed)
PR tree-optimization/85156
	* builtins.c (fold_builtin_expect): Use save_expr on arg1 to avoid
	evaluating the argument multiple times.

	* c-c++-common/pr85156.c: New test.
	* gcc.c-torture/execute/pr85156.c: New test.

From-SVN: r259057
2018-04-03 23:42:51 +02:00
Jason Merrill
8d0d49f8b4 PR c++/85092 - C++17 ICE with unused list constructor.
* call.c (conv_binds_ref_to_prvalue): Also count ck_identity
	from a TARGET_EXPR.

From-SVN: r259052
2018-04-03 15:13:42 -04:00
Jason Merrill
fe736ffd2f PR c++/85113 - ICE with constexpr and __builtin_constant_p.
* constexpr.c (cxx_eval_builtin_function_call): Only defer
	__builtin_constant_p if ctx->quiet.

From-SVN: r259051
2018-04-03 15:13:36 -04:00
Bill Schmidt
8ab30b9778 emmintrin.h (_mm_cvtpd_epi32): Use __vector rather than vector.
[gcc]

2018-04-03  Bill Schmidt  <wschmidt@linux.ibm.com>

	* config/rs6000/emmintrin.h (_mm_cvtpd_epi32): Use __vector rather
	than vector.
	(_mm_cvtpd_ps): Likewise.
	(_mm_cvttpd_epi32): Likewise.
	* config/rs6000/mmintrin.h (_mm_unpacklo_pi8): Likewise.
	* config/rs6000/xmmintrin.h: For strict-ANSI C++ or C11, undefine
	vector, pixel, and bool following altivec.h include.

[gcc/testsuite]

2018-04-03  Bill Schmidt  <wschmidt@linux.ibm.com>

	* gcc.target/powerpc/powerpc.exp: Add .C suffix for main loop.
	* gcc.target/powerpc/undef-bool-1.C: New file.
	* gcc.target/powerpc/undef-bool-2.c: New file.

From-SVN: r259050
2018-04-03 19:06:28 +00:00
Paolo Carlini
e52c093a9f re PR c++/84768 (ICE with failed class template argument deduction because of invalid template parameter)
/cp
2018-04-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84768
	* pt.c (rewrite_template_parm): If the first argument is
	error_mark_node return it immediately.
	(build_deduction_guide): Check the return value of the
	latter for error_mark_node.
	(do_class_deduction): Check the return value of the latter.

/testsuite
2018-04-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84768
	* g++.dg/cpp1z/class-deduction52.C: New.

From-SVN: r259049
2018-04-03 17:53:05 +00:00
Jason Merrill
83afe9b528 * semantics.c (finish_if_stmt_cond): Use instantiation_dependent_expression_p.
From-SVN: r259044
2018-04-03 13:41:17 -04:00
Jason Merrill
1456e76410 PR c++/85149 - generic lambda and constexpr if.
* pt.c (build_extra_args, add_extra_args): Split from
	tsubst_pack_expansion.
	(tsubst_expr) [IF_STMT]: Use them.
	* cp-tree.h (IF_STMT_EXTRA_ARGS): New.

From-SVN: r259043
2018-04-03 13:41:12 -04:00
Jason Merrill
3f759575d3 Fix noexcept merging with system headers.
* typeck.c (merge_types): Limit matching attribute shortcut to
	the default case.

From-SVN: r259042
2018-04-03 13:41:06 -04:00
Martin Sebor
b4231bf26e extend.texi (Common Function Attributes): Clarify.
gcc/ChangeLog:

	* doc/extend.texi (Common Function Attributes): Clarify.
	(const attribute): Likewise.
	(pure attribute): Likewise.

From-SVN: r259041
2018-04-03 11:35:14 -06:00
Jakub Jelinek
92c59b7466 re PR c++/85147 (ICE with invalid variadic template-template parameter)
PR c++/85147
	* pt.c (fixed_parameter_pack_p_1): Punt if parm is error_mark_node.

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

From-SVN: r259040
2018-04-03 18:22:05 +02:00
Jakub Jelinek
93e544c102 re PR c++/85140 (ICE with invalid use of alignas)
PR c++/85140
	* name-lookup.c (handle_namespace_attrs): Return early if attributes
	is error_mark_node.

	* g++.dg/cpp0x/gen-attrs-64.C: New test.

From-SVN: r259039
2018-04-03 18:21:02 +02:00
Jakub Jelinek
b0493acbe6 re PR c++/85134 (ICE with invalid constexpr in 'shared' OpenMP clause)
PR c++/85134
	* decl.c (cp_finish_decl): If ensure_literal_type_for_constexpr_object
	fails, after clearing DECL_DECLARED_CONSTEXPR_P don't return early,
	instead for static data members clear init and set DECL_EXTERNAL.

	* g++.dg/gomp/pr85134.C: New test.
	* g++.dg/cpp0x/constexpr-ice19.C: Expect one further error.

From-SVN: r259038
2018-04-03 18:20:02 +02:00
Jakub Jelinek
4304d6180a re PR target/85169 (wrong code with vector member insert)
PR target/85169
	* config/i386/i386.c (ix86_expand_vector_set): Use
	HOST_WIDE_INT_1U << elt instead of 1 << elt.  Formatting fix.

	* gcc.c-torture/execute/pr85169.c: New test.
	* gcc.target/i386/avx512f-pr85169.c: New test.
	* gcc.target/i386/avx512bw-pr85169.c: New test.

From-SVN: r259037
2018-04-03 18:06:19 +02:00