Commit Graph

160864 Commits

Author SHA1 Message Date
Paolo Carlini
61f84e25f6 re PR c++/80956 (ICE with abstract class vector)
/cp
2018-04-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/80956
	* call.c (convert_like_real): Fail gracefully for a broken
	std::initializer_list, missing a definition.

	* name-lookup.c (do_pushtag): Tweak message, use %< and %>.

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

	PR c++/80956
	* g++.dg/cpp0x/initlist100.C: New.
	* g++.dg/cpp0x/initlist101.C: Likewise.

From-SVN: r259137
2018-04-05 17:08:21 +00:00
Paolo Carlini
3b4a12aa8a re PR c++/84792 (ICE with broken typedef of a struct)
/cp
2018-04-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84792
	* decl.c (grokdeclarator): Fix diagnostic about typedef name used
	as nested-name-specifier, keep type and TREE_TYPE (decl) in sync.

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

	PR c++/84792
	* g++.dg/other/pr84792-1.C: New.
	* g++.dg/other/pr84792-2.C: Likewise.

From-SVN: r259136
2018-04-05 17:05:03 +00:00
Jonathan Wakely
970d3d9011 Add another workaround to std::variant for Clang bug 31852
* include/std/variant (_VARIANT_RELATION_FUNCTION_TEMPLATE): Qualify
	__get calls to avoid ADL and avoid ambiguity due to Clang bug.

From-SVN: r259135
2018-04-05 17:59:13 +01:00
Uros Bizjak
b5f3bb7b5f re PR target/85193 (ICE: SIGSEGV in memory_operand at recog.c:1361 with -O2 -fno-tree-ccp -fno-tree-fre -mno-sse)
PR target/85193
	* config/i386/i386.md (define_attr "memory"): Handle rotate1 type.

testsuite/ChangeLog:

	PR target/85193
	* gcc.target/i386/pr85193.c: New test.

From-SVN: r259134
2018-04-05 18:50:49 +02:00
Jason Merrill
be9d76c5bf PR c++/82152 - ICE with class deduction and inherited ctor.
* pt.c (do_class_deduction): Ignore inherited ctors.

From-SVN: r259133
2018-04-05 12:42:09 -04:00
Jason Merrill
68218b64ed PR c++/84665 - ICE with array of empty class.
* decl2.c (cp_check_const_attributes): Use fold_non_dependent_expr.

From-SVN: r259132
2018-04-05 12:04:08 -04:00
Jason Merrill
4cbe585c99 PR c++/85228 - ICE with lambda in enumerator.
* pt.c (bt_instantiate_type_proc): Don't assume
	CLASSTYPE_TEMPLATE_INFO is non-null.

From-SVN: r259130
2018-04-05 10:48:40 -04:00
Ville Voutilainen
9aee04a4c0 Implement P0969
gcc/cp

Implement P0969
* decl.c (find_decomp_class_base): Check accessibility instead
of declared access, adjust diagnostic.

testsuite/

Implement P0969
* g++.dg/cpp1z/decomp4.C: Adjust.
* g++.dg/cpp1z/decomp38.C: New.

From-SVN: r259129
2018-04-05 17:43:55 +03:00
Ville Voutilainen
0fb90182d8 Implement P0961
gcc/cp

Implement P0961
* decl.c (get_tuple_decomp_init): Check the templatedness
of a member get.

testsuite/

Implement P0961
* g++.dg/cpp1z/decomp10.C: Adjust.
* g++.dg/cpp1z/decomp37.C: New.

From-SVN: r259128
2018-04-05 17:37:18 +03:00
Jason Merrill
e99d77c97f PR c++/85200 - ICE with constexpr if in generic lambda.
* pt.c (extract_locals_r): Don't record the local specs of variables
	declared within the pattern.

From-SVN: r259127
2018-04-05 10:20:53 -04:00
Tom de Vries
2ba16fd2eb [nvptx] Fix neutering of bb with only cond jump
2018-04-05  Tom de Vries  <tom@codesourcery.com>

	PR target/85204
	* config/nvptx/nvptx.c (nvptx_single): Fix neutering of bb with only
	cond jump.

	* testsuite/libgomp.oacc-c-c++-common/broadcast-1.c: New test.

From-SVN: r259125
2018-04-05 08:36:37 +00:00
Alexandre Oliva
44780b91eb [PR c++/84979] reject auto in explicit tmpl args for tmpl-fn
With concepts, we accept auto in explicit template arguments, but we
should only accept them for template classes.  Passing them to
template functions or variables is not allowed.  So, reject it, at
parse time if possible, at specialization time otherwise.


for  gcc/cp/ChangeLog

	PR c++/84979
	* pt.c (check_auto_in_tmpl_args): New.
	(tsubst_qualified_id): Use it to reject template args
	referencing auto for non-type templates.
	* parser.c (cp_parser_template_id): Likewise.
	* cp-tree.h (check_auto_in_tmpl_args): Declare.
	* typeck2.c (build_functional_cast): Report correct location
	for invalid use of auto.

for  gcc/testsuite/ChangeLog

	PR c++/84979
	* g++.dg/concepts/pr84979.C: New.
	* g++.dg/concepts/pr84979-2.C: New.
	* g++.dg/concepts/pr84979-3.C: New.

From-SVN: r259124
2018-04-05 04:26:36 +00:00
Jason Merrill
da0c8d9793 PR c++/85215 - ICE with copy-init from conversion.
* call.c (merge_conversion_sequences): Fix type of direct binding
	sequence.

From-SVN: r259123
2018-04-05 00:01:15 -04:00
Shiva Chen
67e1eb3d2d [NDS32] Fine-tune memory address type.
gcc/
	* config/nds32/constraints.md (U33): Fine-tune checking condition.
	* config/nds32/nds32-md-auxiliary.c (nds32_mem_format): Ditto.
	* config/nds32/nds32.h (nds32_16bit_address_type): Add
	ADDRESS_POST_MODIFY_LO_REG_IMM3U.

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

From-SVN: r259122
2018-04-05 03:35:28 +00:00
Shiva Chen
8656bbcff8 [NDS32] Add constraint for lwi45.fe instruction.
gcc/
	* config/nds32/constraints.md (Ufe): New memory constraint.
	* config/nds32/nds32-md-auxiliary.c (nds32_mem_format,
	nds32_output_16bit_load): Consider r8 register for lwi45.fe format.
	* config/nds32/nds32.c (nds32_print_operand): Output lwi45.fe
	operands.
	* config/nds32/nds32.h (nds32_16bit_address_type): Add ADDRESS_R8_IMM7U.
	* config/nds32/nds32.md (*mov<mode>): Adjust pattern.

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

From-SVN: r259121
2018-04-05 03:25:20 +00:00
Chung-Ju Wu
b9774a97af [NDS32] Generate alu-shift instructions only for -Os.
gcc/
	* config/nds32/nds32.md: Use optimize_size in the condition for
	alu-shift instructions.

From-SVN: r259120
2018-04-05 03:10:42 +00:00
Chung-Ju Wu
50ea1e4ad5 [NDS32] Add divsi4 and udivsi4 patterns.
gcc/
	* config/nds32/nds32.md (divsi4, udivsi4): New patterns.

From-SVN: r259119
2018-04-05 03:05:45 +00:00
Chung-Ju Wu
3fbbd9e5ad [NDS32] Refine negsi2 pattern.
gcc/
	* config/nds32/nds32.md (negsi2): Refine pattern.

From-SVN: r259118
2018-04-05 02:58:19 +00:00
Kito Cheng
a3b13564bf [NDS32] Refine bit-wise operation and shift patterns.
gcc/
	* config/nds32/iterators.md (shift_rotate): New code iterator.
	(shift): New code attribute.
	* config/nds32/nds32-md-auxiliary.c (nds32_expand_constant): New.
	* config/nds32/nds32-protos.h (nds32_expand_constant): Declare.
	* config/nds32/nds32.c (nds32_print_operand): Deal with more cases.
	* config/nds32/nds32.md (addsi3, *add_srli): Refine implementation for
	bit-wise operations.
	(andsi3, *andsi3): Ditto.
	(iorsi3, *iorsi3, *or_slli, *or_srli): Ditto.
	(xorsi3, *xorsi3, *xor_slli, *xor_srli): Ditto.
	(<shift>si3, *ashlsi3, *ashrsi3, *lshrsi3, *rotrsi3): Ditto.
	* config/nds32/predicates.md (nds32_rimm5u_operand, nds32_and_operand,
	nds32_ior_operand, nds32_xor_operand): New predicates.

Co-Authored-By: Chung-Ju Wu <jasonwucj@gmail.com>

From-SVN: r259117
2018-04-05 02:51:45 +00:00
Chung-Ju Wu
5c36be5733 [NDS32] The add and sub pattens should only accept si mode.
gcc/
	* config/nds32/nds32.md (add<mode>3, sub<mode>3): Rename to ...
	(addsi3, subsi3): ... this.

From-SVN: r259116
2018-04-05 02:23:19 +00:00
Chung-Ju Wu
77827557f6 [NDS32] Fine-tune predicator for alu-shift patterns.
gcc/
	* config/nds32/nds32.md (*sub_srli, *and_slli): Fine-tune predicator.

From-SVN: r259115
2018-04-05 02:05:06 +00:00
Chung-Ju Wu
9c1a4c0fa1 [NDS32] Adjust asm patterns indention.
gcc/
	* config/nds32/nds32.md: Adjust indention.

From-SVN: r259114
2018-04-05 01:49:13 +00:00
Kito Cheng
9be6885bac [NDS32] Add new instruction attribute: feature.
gcc/
	* config/nds32/nds32.md (feature): New attribute.

From-SVN: r259113
2018-04-05 01:43:05 +00:00
Chung-Ju Wu
0aa683b35e [NDS32] Add subtype attribute for instructions.
gcc/
	* config/nds32/nds32.md (subtype): New attribute.

From-SVN: r259112
2018-04-05 01:35:00 +00:00
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