Commit Graph

177716 Commits

Author SHA1 Message Date
GCC Administrator
e37658dffd Daily bump. 2020-06-20 00:16:27 +00:00
David Edelsohn
70c25e5be2 testsuite: popcount[45]ll require lp64
popcount[45]ll require __builtin_popcountll, but the test can succeed
without libcall through expand_doubleword_popcount.  However the Tree-SSA
optiization requires recognition of POPCOUNT.  This patch limits the test
to lp64 for the targets that fall through the cracks and were not
caught by the dg-require-effective-target popcountll.

gcc/testsuite/ChangeLog

2020-06-19  David Edelsohn  <dje.gcc@gmail.com>

	* gcc.dg/tree-ssa/popcount4ll.c: Add target lp64.
	* gcc.dg/tree-ssa/popcount5ll.c: Same.
2020-06-19 16:17:11 -04:00
Jonathan Wakely
5b6215083b libstdc++: Fix some -Wsystem-headers warnings (PR 95765)
PR libstdc++/95765
	* include/bits/stl_algobase.h (__size_to_integer(float))
	(__size_to_integer(double), __size_to_integer(long double))
	(__size_to_integer(__float128)): Cast return type explicitly.
	* include/bits/stl_uninitialized.h (__uninitialized_default_1<true>):
	Remove unused typedef.
2020-06-19 18:20:05 +01:00
Jason Merrill
4058454c9e c++: Allow defaulted comparison outside class.
Implementing P2085, another refinement to the operator<=> specification from
the Prague meeting.  It was deemed desirable to be able to have a non-inline
defaulted definition of a comparison operator just like you can with other
defaulted functions.

gcc/cp/ChangeLog:

	* method.c (early_check_defaulted_comparison): Allow defaulting
	comparison outside class.  Complain if non-member operator isn't a
	friend.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/spaceship-friend1.C: New test.
	* g++.dg/cpp2a/spaceship-err4.C: Adjust diagnostic.
2020-06-19 12:25:37 -04:00
David Edelsohn
4cea81adab rs6000: apply -mbig option to vec-extract[hl] testcases conditionally.
gcc/testsuite/ChangeLog

2020-06-19  David Edelsohn  <dje.gcc@gmail.com>

	* gcc.target/powerpc/vec-extracth-be-0.c: Apply -mbig
	conditionally for powerpc64le*-*-*.
	* gcc.target/powerpc/vec-extracth-be-1.c: Same.
	* gcc.target/powerpc/vec-extracth-be-2.c: Same.
	* gcc.target/powerpc/vec-extracth-be-3.c: Same.
	* gcc.target/powerpc/vec-extractl-be-0.c: Same.
	* gcc.target/powerpc/vec-extractl-be-1.c: Same.
	* gcc.target/powerpc/vec-extractl-be-2.c: Same.
	* gcc.target/powerpc/vec-extractl-be-3.c: Same.
2020-06-19 12:21:44 -04:00
Tobias Burnus
dd455df70c amdgcn: Silence compile warnings
gcc/ChangeLog:

	* config/gcn/gcn.c (gcn_related_vector_mode): Add ARG_UNUSED.
	(output_file_start): Use const 'char *'.
2020-06-19 18:12:11 +02:00
Przemyslaw Wirkus
e0bfe01671 Fix PR94880: Failure to recognize andn pattern
Pattern "(x | y) - y" can be optimized to simple "(x & ~y)" andn
pattern.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/ChangeLog:

	PR tree-optimization/94880
	* match.pd (A | B) - B -> (A & ~B): New simplification.

gcc/testsuite/ChangeLog:

	PR tree-optimization/94880
	* gcc.dg/tree-ssa/pr94880.c: New Test.
2020-06-19 16:48:55 +01:00
Richard Biener
6d8b2ee568 Handle SLP_TREE_LANE_PERMUTATION in scalar costing
This properly handles a lane permutation in scalar costing.
For the current only use this doesn't matter much but with
permutes that change the number of lanes it will eventually
ICE.

2020-06-19  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_bb_slp_scalar_cost): Adjust
	for lane permutations.
2020-06-19 16:43:36 +02:00
Jonathan Wakely
a7a3932e4b libstdc++: Remove redundant std:: qualification
* include/bits/stl_pair.h (_Index_tuple): Remove redundant
	namespace qualification.
	(pair::pair(tuple<>&, tuple<>&, _Index_tuple, _Index_tuple)):
	Likewise.
	* include/std/tuple (_Head_base, _Tuple_impl, tuple_size)
	(tuple_element, __get_helper, get, __make_tuple_impl)
	(__make_1st_indices, __tuple_concater)
	(pair::pair(tuple<>&, tuple<>&, _Index_tuple, _Index_tuple)):
	Likewise.
	* include/std/utility (tuple_element, __is_tuple_like_impl)
	(tuple_size, __pair_get, get): Likewise.
2020-06-19 15:02:54 +01:00
Jonathan Wakely
abed8b56b9 libstdc++: Define all std::function members inline
* include/bits/std_function.h (function): Define all member
	functions inline.
2020-06-19 14:37:52 +01:00
Marc Glisse
465520e3eb libstdc++: std::includes performance tweak
A small tweak to the implementation of __includes, which in my
application saves 20% of the running time. I noticed it because using
range-v3 was giving unexpected performance gains.

Some of the gain comes from pulling the 2 calls ++__first1 out of the
condition so there is just one call. And most of the gain comes from
replacing the resulting

if (__comp(__first1, __first2))
  ;
else
  ++__first2;

with

if (!__comp(__first1, __first2))
  ++__first2;

I was very surprised that the code ended up being so different for such
a change, and I still don't really understand where the extra time is
going...

Anyway, while I blame the compiler for not generating very good code
with the current implementation, I believe the change can be seen as a
simplification.

libstdc++-v3/ChangeLog:

	* include/bits/stl_algo.h (__includes): Simplify the code.
2020-06-19 13:03:45 +01:00
Richard Biener
f8f5715606 tree-optimization/95761 - fix vector insertion place compute
I missed that indeed SLP permutation code generation can end up
refering to a non-last vectorized stmt in the last SLP_TREE_VEC_STMTS
element as optimization.  So walk them all.

2020-06-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95761
	* tree-vect-slp.c (vect_schedule_slp_instance): Walk all
	vectorized stmts for finding the last one.

	* gcc.dg/torture/pr95761.c: New testcase.
2020-06-19 13:36:46 +02:00
Marc Glisse
bafd12cb22 libstdc++: Optimize std::optional default constructor
The attached patch changes the code generated for

std::optional<std::array<int,1024>>f(){return{};}

from

        movq    $0, (%rdi)
        movq    %rdi, %r8
        leaq    8(%rdi), %rdi
        xorl    %eax, %eax
        movq    $0, 4084(%rdi)
        movq    %r8, %rcx
        andq    $-8, %rdi
        subq    %rdi, %rcx
        addl    $4100, %ecx
        shrl    $3, %ecx
        rep stosq
        movq    %r8, %rax

or with different tuning

        subq    $8, %rsp
        movl    $4100, %edx
        xorl    %esi, %esi
        call    memset
        addq    $8, %rsp

to the much shorter

        movb    $0, 4096(%rdi)
        movq    %rdi, %rax

i.e. the same as the nullopt constructor.

The constructor was already non-trivial, so we don't lose that. It passes the
testsuite without regression, but there is no new testcase to verify the
better codegen.

libstdc++-v3/ChangeLog:

	* include/std/optional (optional()): Explicitly define it.
2020-06-19 12:15:43 +01:00
Eric Botcazou
6894d9101e [Ada] Remove handling of 'Pos and 'Val attributes from gigi
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* gcc-interface/trans.c (lvalue_required_for_attribute_p): Do not deal
	with 'Pos or 'Val.
	(Attribute_to_gnu): Likewise.
	* gcc-interface/utils.c (create_field_decl): Small formatting fix.
2020-06-19 04:17:31 -04:00
Eric Botcazou
bb24f34350 [Ada] Consolidate handling of implicit dereferences
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* gcc-interface/trans.c (adjust_for_implicit_deref): Delete.
	(maybe_implicit_deref): Likewise.
	(Attribute_to_gnu): Replace calls to maybe_implicit_deref by calls
	to maybe_padded_object.
	(Call_to_gnu): Likewise.
	(gnat_to_gnu) <N_Indexed_Component>: Likewise.
	<N_Slice>: Likewise.
	<N_Selected_Component>: Likewise.
	<N_Free_Statement>: Remove call to adjust_for_implicit_deref and
	manually make sure that the designated type is complete.
	* gcc-interface/utils2.c (build_simple_component_ref): Add comment.
2020-06-19 04:17:30 -04:00
Eric Botcazou
c95f808ddd [Ada] AI12-0028-1 Import of variadic C functions
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* gcc-interface/decl.c (gnat_to_gnu_param): Tidy up.
	(gnat_to_gnu_subprog_type): For a variadic C function, do not
	build unnamed parameters and do not add final void node.
	* gcc-interface/misc.c: Include snames.h.
	* gcc-interface/trans.c (Attribute_to_gnu): Tidy up.
	(Call_to_gnu): Implement support for unnamed parameters in a
	variadic C function.
	* gcc-interface/utils.c: Include snames.h.
	(copy_type): Tidy up.
2020-06-19 04:17:29 -04:00
Eric Botcazou
906a759dcb [Ada] Further cleanup in constraint checking code for allocators
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_ch5.adb (Expand_N_Assignment_Statement): Do not apply
	range checks to allocators here.
2020-06-19 04:17:28 -04:00
Justin Squirek
82bcb33bcf [Ada] Crash on compiling project with multiple subunits per file
2020-06-19  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* lib.adb (Check_Same_Extended_Unit): Add check to determine if
	the body for the subunits exist in the same file as their
	specifications.
2020-06-19 04:17:27 -04:00
Eric Botcazou
d0e9248d9b [Ada] Fix check for bounds in aggregate expansion of allocator
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_aggr.adb (In_Place_Assign_OK): In an allocator context,
	check the bounds of an array aggregate against those of the
	designated type, except if the latter is unconstrained.
2020-06-19 04:17:26 -04:00
Eric Botcazou
ce716aaaa3 [Ada] Fix small fallout of previous change for Analyze_Selected_Component
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch3.adb (Is_Visible_Component): Reason only on the private
	status of the original type in an instance body.
2020-06-19 04:17:26 -04:00
Eric Botcazou
1e400f33e1 [Ada] Fix small fallout of previous change for allocator
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Qualified_Expression): Do not override the
	type of the node when it is unconstrained if it is for an allocator.
2020-06-19 04:17:25 -04:00
Eric Botcazou
e3c1f8dd05 [Ada] Plug small loophole in implementation of AI12-0100
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Allocator): Call Resolve_Qualified_Expression
	on the qualified expression, if any, instead of doing an incomplete
	type resolution manually.
	(Resolve_Qualified_Expression): Apply predicate check to operand.
2020-06-19 04:17:24 -04:00
Eric Botcazou
92392296c1 [Ada] Fix internal error on component of class-wide parameter in instance body
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch4.adb (Analyze_Selected_Component): In an instance body,
	also invoke Find_Component_In_Instance on the parent subtype of
	a derived tagged type immediately visible.  Remove obsolete case.
2020-06-19 04:17:23 -04:00
Eric Botcazou
c5c69d05a9 [Ada] Deal with enumeration types with very large size
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_attr.adb (Get_Integer_Type): Return the largest supported
	unsigned integer type if need be.
2020-06-19 04:17:22 -04:00
Justin Squirek
650abc2c93 [Ada] Spurious condition warning on type conversion in return
2020-06-19  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Known_Condition): Add general sanity
	check that asserts the original source node being checked
	contains an entity. If not, it could be the result of special
	case expansion for type conversions.
2020-06-19 04:17:22 -04:00
Ed Schonberg
a6d7dfbbb2 [Ada] Spurious error on private type in ghost expression function
2020-06-19  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch6.adb (Analyze_Expression_Function): Do not indicate
	that the function has a completion if it appears within a Ghost
	generic package.
2020-06-19 04:17:21 -04:00
Bob Duff
74d09f3ee9 [Ada] AI12-0293-1 Remove pragma Assert
2020-06-19  Bob Duff  <duff@adacore.com>

gcc/ada/

	* libgnat/a-ststbo.adb (Write): Replace pragma Assert with "if
	... raise Constraint_Error".
2020-06-19 04:17:20 -04:00
Justin Squirek
b64bea1830 [Ada] Style checks on invalid UTF character cause crash
2020-06-19  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* widechar.adb, widechar.ads (Skip_Wide): Catch validity check
	failure when skipping over characters, and update comment to
	reflect Skip_Wide's usage in error printing.
2020-06-19 04:17:19 -04:00
Javier Miranda
7841c99268 [Ada] ACATS 4.1G - C760A02 - Near infinite finalization
2020-06-19  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* exp_ch3.ads (Ensure_Activation_Chain_And_Master): New
	subprogram.
	* exp_ch3.adb (Ensure_Activation_Chain_And_Master): New
	subprogram that factorizes code.
	(Expand_N_Object_Declaration): Call new subprogram.
	* sem_ch6.adb (Analyze_Function_Return): Returning a
	build-in-place unconstrained array type defer the full analysis
	of the returned object to avoid generating the corresponding
	constrained subtype; otherwise the bounds would be created in
	the stack and a dangling reference would be returned pointing to
	the bounds.
2020-06-19 04:17:18 -04:00
Arnaud Charlet
b6c2ec4997 [Ada] AI12-0366 Changes to Big_Integer and Big_Real
2020-06-19  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnat/a-nbnbin.adb, libgnat/a-nbnbin.ads,
	libgnat/a-nbnbin__gmp.adb, libgnat/a-nbnbre.adb,
	libgnat/a-nbnbre.ads: Update spec according to AI12-0366.
2020-06-19 04:17:18 -04:00
Piotr Trojanek
545ba471c1 [Ada] Minor remove extra whitespace in check suppression functions
2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* checks.ads: Remove excessive whitespace in declarations of
	functions for check suppression.
2020-06-19 04:17:17 -04:00
Eric Botcazou
6c89a5815a [Ada] Attempt to hide public entities in nested instance bodies
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch7.adb (Hide_Public_Entities): Split handling of objects
	and subprograms, and do not reject the latter upfront in nested
	instance specs if there are no referencer subprograms at all.
	(Analyze_Package_Body_Helper): Also call Hide_Public_Entities on
	nested generic instances.
2020-06-19 04:17:16 -04:00
Piotr Trojanek
4b58985f6c [Ada] Reject junk expressions in attribute Update
2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_attr.adb (Analyze_Attribute): Reject illegal positional
	component associations; fix syntax in comment about named
	component associations.
2020-06-19 04:17:15 -04:00
Piotr Trojanek
484d58c5ba [Ada] Decorate record delta aggregate for GNATprove
2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_aggr.adb (Resolve_Delta_Record_Aggregate): Modify a nested
	Get_Component_Type routine to return a component and not just
	its type; use this routine to decorate the identifier within the
	delta aggregate.
2020-06-19 04:17:14 -04:00
Arnaud Charlet
7a022cc933 [Ada] universal_access equality and 'Access attributes
2020-06-19  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_ch4.adb (Find_Equality_Types.Check_Access_Attribute): New.
	(Find_Equality_Types): Move universal_access related checks at
	the end of the processing and add call to
	Check_Access_Attribute.
2020-06-19 04:17:14 -04:00
Eric Botcazou
a5835f3044 [Ada] Remove second warning for convention C_Variadic_n
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_prag.adb (Process_Convention): Revert previous change.
2020-06-19 04:17:13 -04:00
Eric Botcazou
ec170be1d0 [Ada] Small cleanup in Apply_Range_Check implementation
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* checks.ads (Apply_Static_Length_Check): Move up.
	(Apply_Range_Check): Add parameter Insert_Node.
	* checks.adb (Apply_Selected_Range_Checks): Merge into...
	(Apply_Range_Check): ...this.  Add parameter Insert_Node,
	pass it as Warn_Node to Selected_Range_Checks and use it
	as insertion point for the checks.
	* sem_ch3.adb (Analyze_Subtype_Declaration): Rewrite block
	dealing with the range checks for the subtype indication.
	Use local variable and call Apply_Range_Check in both cases.
2020-06-19 04:17:12 -04:00
Piotr Trojanek
d48bb126ea [Ada] Fix validity checks on attribute 'Old prefix
2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* exp_attr.adb (Expand_N_Attribute_Reference): Call Ensure_Valid
	on the expression of an object declaration that captures the
	value of 'Old prefix.
2020-06-19 04:17:11 -04:00
Piotr Trojanek
d57f8e4043 [Ada] Add comments about attribute 'Valid_Scalars on private tagged types
2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* exp_attr.adb (Expand_N_Attribute_Reference): Add comment.
	* sem_attr.adb (Analyze_Attribute): Add ??? comment.
	* sem_util.ads (Valid_Scalars): This routine is only used for
	'Valid_Scalars and not for 'Valid.
2020-06-19 04:17:10 -04:00
Piotr Trojanek
a4dafb8b92 [Ada] Simplify processing of 'Valid_Scalars on array types
2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* exp_attr.adb (Expand_N_Attribute_Reference): Do not call
	Scalar_Part_Present on the array component's type.
	(Build_Array_VS_Func): Remove Comp_Typ parameter, because it can
	be easily computed from the Array_Top parameter *and redundant
	parameters are confusing and error-prone).
2020-06-19 04:17:10 -04:00
Piotr Trojanek
66bd7af5cc [Ada] Fix validity checking for class-wide objects
2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* exp_attr.adb (Build_Record_VS_Func): Strip privacy and type
	derivation from the root type when 'Valid_Scalars is applied to
	a class-wide type.
2020-06-19 04:17:09 -04:00
Piotr Trojanek
5af0271f0e [Ada] Remove repeated testing of Check_Validity_Of_Parameters
2020-06-19  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* checks.adb (Apply_Parameter_Validity_Checks): Remove testing
	of Check_Validity_Of_Parameters for every formal parameter and
	function result.
2020-06-19 04:17:08 -04:00
Arnaud Charlet
75c44bc6a0 [Ada] Add missing warning tag for some overlapping actuals warnings
2020-06-19  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Overlapping_Actuals): Add missing
	warning tag.
2020-06-19 04:17:07 -04:00
GCC Administrator
aae80e833d Daily bump. 2020-06-19 00:16:32 +00:00
Jason Merrill
b56dc0fc6c c++: More P2002 operator<=> refinements.
* Disallow && references.
* Allow empty unions.
* Improve diagnostics for a subobject comparison with
  non-comparison-category type.

gcc/cp/ChangeLog:

	* method.c (early_check_defaulted_comparison): Check for &&.
	(build_comparison_op): Allow empty union.  Diagnose non-category
	type.
	(common_comparison_type): Remove handling for non-category type.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/spaceship-ref1.C: New test.
	* g++.dg/cpp2a/spaceship-synth-neg4.C: New test.
	* g++.dg/cpp2a/spaceship-union1.C: New test.
2020-06-18 16:00:30 -04:00
Fei Yang
e54353a72a vect: Use vect_relevant_for_alignment_p consistently
Minor code refactorings in tree-vect-data-refs.c.  When trying loop peeling
to force alignment, call vect_relevant_for_alignment_p to filter out data
references in the loop whose alignment is irrelevant.

2020-06-18  Felix Yang  <felix.yang@huawei.com>

gcc/
	* tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Call
	vect_relevant_for_alignment_p to filter out data references in
	the loop whose alignment is irrelevant when trying loop peeling
	to force alignment.
2020-06-18 20:11:09 +01:00
Uros Bizjak
e95395926a i386: Fix mode of ZERO_EXTRACT RTXes, remove ext_register_operand predicate.
The mode of ZERO_EXTRACT RTX should match the mode of its LOC register
operand.  The mode should be HI, SI or DImode to enable combine to synthesize
extractions from HImode and DImode operands, in addition to existing SImode.
Further, these changes tighten allowed modes for extv, extzv and insv
named patterns and finally enable removal of ext_register_operand
special predicate.

2020-18-06  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	* config/i386/i386.md (*cmpqi_ext<mode>_1): Use SWI248 mode
	iterator instead of SImode for ZERO_EXTRACT RTX.  Use SWI248
	mode iterator for the first operand of ZERO_EXTRACT RTX.
	Change ext_register_operand predicate to register_operand.
	Rename from *cmpqi_ext_1.
	(*cmpqi_ext<mode>_2): Ditto.  Rename from *cmpqi_ext_2.
	(*cmpqi_ext<mode>_3): Ditto.  Rename from *cmpqi_ext_3.
	(*cmpqi_ext<mode>_4): Ditto.  Rename from *cmpqi_ext_4.
	(cmpi_ext_3): Use HImode instead of SImode for ZERO_EXTRACT RTX.
	(*extv<mode>): Use SWI24 mode iterator for the first operand
	of ZERO_EXTRACT RTX.  Change ext_register_operand predicate
	to register_operand.
	(*extzv<mode>): Use SWI248 mode iterator for the first operand
	of ZERO_EXTRACT RTX.  Change ext_register_operand predicate
	to register_operand.
	(*extzvqi): Use SWI248 mode iterator instead of SImode for
	ZERO_EXTRACT RTX.  Use SWI248 mode iterator for the first operand
	of ZERO_EXTRACT RTX.  Change ext_register_operand predicate to
	register_operand.
	(*extzvqi_mem_rex64 and corresponding peephole2):  Use SWI248 mode
	iterator instead of SImode for ZERO_EXTRACT RTX.  Use SWI248
	mode iterator for the first operand of ZERO_EXTRACT RTX.
	Change ext_register_operand predicate to register_operand.
	(@insv<mode>_1): Use SWI248 mode iterator for the first operand
	of ZERO_EXTRACT RTX.  Change ext_register_operand predicate to
	register_operand.
	(*insvqi_1): Use SWI248 mode iterator instead of SImode
	for ZERO_EXTRACT RTX.  Use SWI248 mode iterator for the
	first operand of ZERO_EXTRACT RTX.  Change ext_register_operand
	predicate to register_operand.
	(*insvqi_2): Ditto.
	(*insvqi_3): Ditto.
	(*insvqi_1_mem_rex64 and corresponding peephole2):  Use SWI248 mode
	iterator instead of SImode for ZERO_EXTRACT RTX.  Use SWI248
	mode iterator for the first operand of ZERO_EXTRACT RTX.
	Change ext_register_operand predicate to register_operand.
	(addqi_ext_1): New expander.
	(*addqi_ext<mode>_1): Use SWI248 mode iterator instead of SImode
	for ZERO_EXTRACT RTX.  Use SWI248 mode iterator for the first
	operand of ZERO_EXTRACT RTX.  Change ext_register_operand predicate
	to register_operand.  Rename from *addqi_ext_1.
	(*addqi_ext<mode>_2): Ditto. Rename from *addqi_ext_2.
	(divmodqi4): Use HImode instead of SImode for ZERO_EXTRACT RTX.
	(udivmodqi4): Ditto.
	(testqi_ext_1): Use HImode instead of SImode for ZERO_EXTRACT RTX.
	(*testqi_ext<mode>_1): Use SWI248 mode iterator instead of SImode
	for ZERO_EXTRACT RTX.  Use SWI248 mode iterator for the first
	operand of ZERO_EXTRACT RTX.  Change ext_register_operand predicate
	to register_operand.  Rename from *testqi_ext_1.
	(*testqi_ext<mode>_2): Ditto.  Rename from *testqi_ext_2.
	(andqi_ext_1): New expander.
	(*andqi_ext<mode>_1): Use SWI248 mode iterator instead of SImode
	for ZERO_EXTRACT RTX.  Use SWI248 mode iterator for the first
	operand of ZERO_EXTRACT RTX.  Change ext_register_operand predicate
	to register_operand.  Rename from andqi_ext_1.
	(*andqi_ext<mode>_1_cc): Ditto.  Rename from *andqi_ext_1_cc.
	(*andqi_ext<mode>_2): Ditto.  Rename from *andqi_ext_2.
	(*<code>qi_ext<mode>_1): Ditto.  Rename from *<code>qi_ext_1.
	(*<code>qi_ext<mode>_2): Ditto.  Rename from *<code>qi_ext_2.
	(xorqi_ext_1_cc): Use HImode instead of SImode for ZERO_EXTRACT RTX.
	(*xorqi_ext<mode>_1_cc):  Use SWI248 mode iterator instead of SImode
	for ZERO_EXTRACT RTX.  Use SWI248 mode iterator for the first
	operand of ZERO_EXTRACT RTX.  Change ext_register_operand predicate
	to register_operand.  Rename from *xorqi_ext_1_cc.
	* config/i386/i386-expand.c (ix86_split_idivmod): Emit ZERO_EXTRACT
	in mode, matching its first operand.
	(promote_duplicated_reg): Update for renamed insv<mode>_1.
	* config/i386/predicates.md (ext_register_operand): Remove predicate.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr78904-1a.c: New test.
	* gcc.target/i386/pr78904-1b.c: Ditto.
	* gcc.target/i386/pr78904-2a.c: Ditto.
	* gcc.target/i386/pr78904-2b.c: Ditto.
	* gcc.target/i386/pr78904-3a.c: Ditto.
	* gcc.target/i386/pr78904-3b.c: Ditto.
	* gcc.target/i386/pr78904-4a.c: Ditto.
	* gcc.target/i386/pr78904-4b.c: Ditto.
	* gcc.target/i386/pr78904-5a.c: Ditto.
	* gcc.target/i386/pr78904-5b.c: Ditto.
	* gcc.target/i386/pr78904-6a.c: Ditto.
	* gcc.target/i386/pr78904-6b.c: Ditto.
	* gcc.target/i386/pr78967-1a.c: Ditto.
	* gcc.target/i386/pr78967-1b.c: Ditto.
	* gcc.target/i386/pr78967-2a.c: Ditto.
	* gcc.target/i386/pr78967-2b.c: Ditto.
2020-06-18 20:12:48 +02:00
Martin Sebor
5acc654e38 Avoid warning for memset writing over multiple members.
Resolves:
PR middle-end/95667 - unintended warning for memset writing across multiple members
PR middle-end/92814 - missing -Wstringop-overflow writing into a dynamically allocated flexible array member

gcc/ChangeLog:

	PR middle-end/95667
	PR middle-end/92814
	* builtins.c (compute_objsize): Remove call to
	compute_builtin_object_size and instead compute conservative sizes
	directly here.

gcc/testsuite/ChangeLog:

	PR middle-end/95667
	PR middle-end/92814
	* gcc.dg/Wstringop-overflow-25.c: Remove xfails.
	* gcc.dg/Wstringop-overflow-39.c: New test.
2020-06-18 12:00:36 -06:00
Marek Polacek
5421fae8b1 c++: ICE in requires-expressions with invalid args [PR95735]
This ICE-on-invalid goes back to GCC 6.  In finish_template_variable,
if coerce_innermost_template_parms returns error_mark_node, we pass
it down to constraints_satisfied_p and that error_mark_node flows
down to various satisfy_* functions and then to various tsubst_*
functions, where we crash.  diagnose_constraints also doesn't cope
with error arglist, so I think we should just return as in the
patch below.

gcc/cp/ChangeLog:

	PR c++/95735
	* pt.c (finish_template_variable): Return if
	coerce_innermost_template_parms return error_mark_node.

gcc/testsuite/ChangeLog:

	PR c++/95735
	* g++.dg/cpp2a/concepts-err2.C: New test.
2020-06-18 11:51:01 -04:00
Christophe Lyon
634e6f4910 Fix use of inaccessible member in pr94052.C
The recent PR41437 fix exposed a latent use of an inaccessible member in
the below testcase.

	gcc/testsuite/ChangeLog:

	* g++.target/aarch64/pr94052.C: Give z::ad public access.
2020-06-18 15:27:21 +00:00