153016 Commits

Author SHA1 Message Date
Arnaud Charlet
b619c88eba [multiple changes]
2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>

	* elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
	* exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
	the purposes of freezing.
	* exp_util.adb Update the documentation and structure of the
	type map used in class-wide semantics of assertion expressions.
	(Add_Inherited_Tagged_DIC): There is really no need to preanalyze
	and resolve the triaged expression because all substitutions
	refer to the proper entities.  Update the replacement of
	references.
	(Build_DIC_Procedure_Body): Add formal parameter
	For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
	are now only processed when freezing occurs.  Build a body only
	when one is needed.
	(Entity_Hash): Removed.
	(Map_Types): New routine.
	(Replace_Object_And_Primitive_References): Removed.
	(Replace_References): New routine.
	(Replace_Type_References): Moved to the library level of Exp_Util.
	(Type_Map_Hash): New routine.
	(Update_Primitives_Mapping): Update the mapping call.
	(Update_Primitives_Mapping_Of_Types): Removed.
	* exp_util.ads (Build_DIC_Procedure_Body): Add formal
	parameter For_Freeze and update the comment on usage.
	(Map_Types): New routine.
	(Replace_References): New routine.
	(Replace_Type_References): Moved to the library level of Exp_Util.
	(Update_Primitives_Mapping_Of_Types): Removed.
	* sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
	properties of the private type to the full view in case the full
	view derives from a parent type and inherits a DIC pragma.
	* sem_prag.adb (Analyze_Pragma): Guard against a case where a
	DIC pragma is placed at the top of a declarative region.

2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>

	* a-tasatt.adb: Complete previous change and use an unsigned
	int to avoid overflow checks.

2017-04-25  Ed Schonberg  <schonberg@adacore.com>

	* sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
	the error message when the attribute reference is an actual in
	a call to a subprogram inherited from a generic formal type with
	unknown discriminants, which makes the subprogram and its formal
	parameters intrinsic (see RM 6.3.1 (8) and (13)).

From-SVN: r247148
2017-04-25 10:37:09 +02:00
Arnaud Charlet
2bb988bb1c [multiple changes]
2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
	sem_prag.adb: Minor reformatting.

2017-04-25  Bob Duff  <duff@adacore.com>

	* sem_attr.adb (Type_Key): Add code in the
	recursive Compute_Type_Key to protect against fetching the source
	code for Standard, in case a component of the type is declared
	in Standard. There was already code to do this for the original
	type, but not for its components.

From-SVN: r247147
2017-04-25 10:33:18 +02:00
Arnaud Charlet
b03d3f7390 [multiple changes]
2017-04-25  Javier Miranda  <miranda@adacore.com>

	* exp_ch3.adb (Build_Initialization_Call): Handle
	subtypes of private types when searching for the underlying full
	view of a private type.

2017-04-25  Javier Miranda  <miranda@adacore.com>

	* sem_res.adb (Set_Mixed_Mode_Operand): A universal
	real conditional expression can appear in a fixed-type context
	and must be resolved with that context to facilitate the code
	generation to the backend.

2017-04-25  Ed Schonberg  <schonberg@adacore.com>

	* einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
	to indicate whether during inline processing, when some unit U1
	appears in the context of a unit U2 compiled for instantiation
	or inlining purposes, the body of U1 needs to be compiled as well.
	* sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
	context is a package declaration.
	* sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
	Analyze_Generic_Package_Declaration): ditto.
	* inline.adb (Analyze_Inlined_Bodies): Check
	Body_Needed_For_Inlining.

2017-04-25  Ed Schonberg  <schonberg@adacore.com>

	* par.adb (Current_Assign_Node): Global variable use to record
	the presence of a target_name in the right hand side of the
	assignment being parsed.
	* par-ch4.adb (P_Name): If the name is a target_name, mark the
	enclosing assignment node accordingly.
	* par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
	appropriately.
	* sem_ch5.adb (Analyze_Assignment): Disable expansion before
	analyzing RHS if the statement has target_names.
	* sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
	properly choices that are subtype marks.
	* exp_ch5.adb: Code cleanup.

2017-04-25  Bob Duff  <duff@adacore.com>

	* s-memory.adb: Add a comment regarding efficiency.
	* atree.adb: Fix the assertion, and combine 2 assertions into one,
	"the source has an extension if and only if the destination does."
	* sem_ch3.adb, sem_ch13.adb: Address ??? comments.

2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>

	* a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
	conversion.

2017-04-25  Doug Rupp  <rupp@adacore.com>

	* init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
	handling for ppc64-vx7.
	* sigtramp-vxworks-target.inc
	[SIGTRAMP_BODY]: Add section for ppc64-vx7.

From-SVN: r247146
2017-04-25 10:29:46 +02:00
Arnaud Charlet
18e829474c New file.
From-SVN: r247145
2017-04-25 10:25:29 +02:00
Bob Duff
f607cacf5d uintp.adb (Most_Sig_2_Digits): In case Direct (Right)...
2017-04-25  Bob Duff  <duff@adacore.com>

	* uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
	Direct_Val (Right), instead of the incorrect Direct_Val (Left).
	(UI_GCD): Remove ??? comment involving possible efficiency
	improvements. This just isn't important after all these years.
	Also minor cleanup.
	* uintp.ads: Minor cleanup.

From-SVN: r247144
2017-04-25 10:23:06 +02:00
Hristian Kirtchev
28ad2460d2 exp_util.adb, [...]: Revert previous changes.
2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
	Revert previous changes.
	* scng.adb: Minor reformatting.
	* s-stratt.ads: Fix unbalanced parens in comment.

From-SVN: r247143
2017-04-25 10:21:44 +02:00
Arnaud Charlet
b41c731f0a [multiple changes]
2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
	Minor reformatting.

2017-04-25  Ed Schonberg  <schonberg@adacore.com>

	* scng.adb (Scan): Handle '@' appropriately.
	* sem_ch5.adb: Code cleanup.

From-SVN: r247142
2017-04-25 10:19:33 +02:00
Arnaud Charlet
b536073728 [multiple changes]
2017-04-25  Ed Schonberg  <schonberg@adacore.com>

	* freeze.adb (Check_Expression_Function): Do not check for the
	use of deferred constants if the freezing of the expression
	function is triggered by its generated body, rather than a
	premature use.

2017-04-25  Javier Miranda  <miranda@adacore.com>

	* exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
	subtypes of private types when performing the view conversion.

2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
	the purposes of freezing.
	* exp_util.adb Update the documentation and structure of the
	type map used in class-wide semantics of assertion expressions.
	(Add_Inherited_Tagged_DIC): There is really no need to preanalyze
	and resolve the triaged expression because all substitutions
	refer to the proper entities.  Update the replacement of
	references.
	(Build_DIC_Procedure_Body): Add formal parameter
	For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
	are now only processed when freezing occurs.  Build a body only
	when one is needed.
	(Entity_Hash): Removed.
	(Map_Types): New routine.
	(Replace_Object_And_Primitive_References): Removed.
	(Replace_References): New routine.
	(Replace_Type_References): Moved to the library level of Exp_Util.
	(Type_Map_Hash): New routine.
	(Update_Primitives_Mapping): Update the mapping call.
	(Update_Primitives_Mapping_Of_Types): Removed.
	* exp_util.ads (Build_DIC_Procedure_Body): Add formal
	parameter For_Freeze and update the comment on usage.
	(Map_Types): New routine.
	(Replace_References): New routine.
	(Replace_Type_References): Moved to the library level of Exp_Util.
	(Update_Primitives_Mapping_Of_Types): Removed.
	* sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
	properties of the private type to the full view in case the full
	view derives from a parent type and inherits a DIC pragma.
	* sem_prag.adb (Analyze_Pragma): Guard against a case where a
	DIC pragma is placed at the top of a declarative region.

From-SVN: r247141
2017-04-25 10:12:31 +02:00
Arnaud Charlet
a187206c14 [multiple changes]
2017-04-25  Tristan Gingold  <gingold@adacore.com>

	* s-mmap.ads (Data): Add pragma Inline.

2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>

	* checks.adb (Insert_Valid_Check): Do not use
	a renaming to alias a volatile name because this will lead to
	multiple evaluations of the volatile name. Use a constant to
	capture the value instead.

2017-04-25  Doug Rupp  <rupp@adacore.com>

	* init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.

2017-04-25  Ed Schonberg  <schonberg@adacore.com>

	* exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
	Add out parameter to indicate to caller that a wrapper must
	be constructed for an inherited primitive whose inherited
	pre/postcondition has called to overridden primitives.
	* freeze.adb (Check_Inherited_Conditions): Build wrapper body
	for inherited primitive that requires it.
	* sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
	legal primitive operations and belong to the list of bodies
	generated after the freeze point of a type.
	* sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
	of Build_Class_Wide_Expression.
	* sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
	to construct the specification of the wrapper subprogram created
	for an inherited operation.

From-SVN: r247140
2017-04-25 10:07:38 +02:00
Arnaud Charlet
15fc8cb7ee [multiple changes]
2017-04-25  Bob Duff  <duff@adacore.com>

	* s-osinte-linux.ads (pthread_mutexattr_setprotocol,
	pthread_mutexattr_setprioceiling): Add new interfaces for these
	pthread operations.
	* s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
	protocols as appropriate for Locking_Policy 'C' and 'I'.
	* s-taprop-posix.adb: Minor reformatting to make it more similar
	to s-taprop-linux.adb.

2017-04-25  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
	Handle properly a multi- level derivation involving both renamed
	and constrained parent discriminants, when the type to be
	constrained has fewer discriminants that the ultimate ancestor.

2017-04-25  Bob Duff  <duff@adacore.com>

	* sem_util.adb (Is_Object_Reference): In the
	case of N_Explicit_Dereference, return False if it came from a
	conditional expression.

2017-04-25  Bob Duff  <duff@adacore.com>

	* par-ch4.adb (P_Case_Expression): If a semicolon
	is followed by "when", assume that ";" was meant to be ",".

From-SVN: r247139
2017-04-25 10:04:26 +02:00
Arnaud Charlet
611d5e3c82 Minor reformatting.
From-SVN: r247138
2017-04-25 09:58:18 +02:00
Gary Dismukes
605afee8d5 sem_ch9.adb, [...]: Minor reformatting and typo fixes.
2017-04-25  Gary Dismukes  <dismukes@adacore.com>

	* sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
	fixes.

From-SVN: r247137
2017-04-25 09:58:01 +02:00
Arnaud Charlet
b912db1617 [multiple changes]
2017-04-25  Arnaud Charlet  <charlet@adacore.com>

	* rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
	loading of an entity.
	* rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
	previously repeated in the analysis.
	* sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
	procedure SPARK_Implicit_Load.	(Analyze_Task_Type_Declaration):
	use new procedure SPARK_Implicit_Load.
	* sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
	SPARK_Implicit_Load.

2017-04-25  Javier Miranda  <miranda@adacore.com>

	* sem_util.adb (New_Copy_Tree): By default
	copying of defining identifiers is prohibited because
	this would introduce an entirely new entity into the
	tree. This patch introduces an exception to this general
	rule: the declaration of constants and variables located in
	Expression_With_Action nodes.
	(Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
	(In_Map): New subprogram.
	(Visit_Entity): New subprogram.
	(Visit_Node): Handle EWA_Level,
	EWA_Inner_Scope_Level, and take care of defining entities defined
	in Expression_With_Action nodes.

2017-04-25  Thomas Quinot  <quinot@adacore.com>

	* exp_ch6.adb: minor comment edit.
	* sinfo.ads, sinfo.adb: New Null_Statement attribute for null
	procedure specifications that come from source.
	* par-ch6.adb (P_Subprogram, case of a null procedure): Set new
	Null_Statement attribute.
	* par_sco.adb (Traverse_Declarations_Or_Statements): For a null
	procedure, generate statement SCO for the generated NULL statement.
	* sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
	parser, if available.

From-SVN: r247136
2017-04-25 09:56:05 +02:00
Andreas Krebbel
e57136da2f Add missing changelog entries for last commit.
From-SVN: r247135
2017-04-25 07:45:41 +00:00
Andreas Krebbel
854dbb3cb1 S/390: PR80464: Split MEM->GPR vector moves
We do this already for TImode values but it was missing for vector
modes.

gcc/ChangeLog:

2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/80464
	* config/s390/vector.md: Split MEM->GPR vector moves for
	non-s_operand addresses.

gcc/testsuite/ChangeLog:

2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/80464
	* gfortran.fortran-torture/compile/pr80464.f90: New test.

From-SVN: r247134
2017-04-25 07:43:49 +00:00
Andreas Krebbel
3cb9ee2f9c S/390: PR79895: Fix TImode constant handling
The P constraint letter is supposed to match every constant which is
acceptable during reload.  However, constraints do not appear to be
able to handle const_wide_int yet.  It works with predicates so the
alternative is modelled with a new predicate now.

gcc/ChangeLog:

2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/79895
	* config/s390/predicates.md (reload_const_wide_int_operand): New
	predicate.
	* config/s390/s390.md ("movti"): Remove d/P alternative.
	("movti_bigconst"): New pattern definition.

gcc/testsuite/ChangeLog:

2017-04-25  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/79895
	* gcc.target/s390/pr79895.c: New test.

From-SVN: r247133
2017-04-25 07:41:41 +00:00
Dominik Vogt
03db9ab594 S/390: PR80080: Optimize atomic patterns.
The attached patch optimizes the atomic_exchange and atomic_compare
patterns on s390 and s390x (mostly limited to SImode and DImode).
Among general optimizaation, the changes fix most of the problems
reported in PR 80080:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80080

gcc/ChangeLog:

2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR target/80080
	* s390-protos.h (s390_expand_cs_hqi): Removed.
	(s390_expand_cs, s390_expand_atomic_exchange_tdsi): New prototypes.
	* config/s390/s390.c (s390_emit_compare_and_swap): Handle all integer
	modes as well as CCZ1mode and CCZmode.
	(s390_expand_atomic_exchange_tdsi, s390_expand_atomic): Adapt to new
	signature of s390_emit_compare_and_swap.
	(s390_expand_cs_hqi): Likewise, make static.
	(s390_expand_cs_tdsi): Generate an explicit compare before trying
	compare-and-swap, in some cases.
	(s390_expand_cs): Wrapper function.
	(s390_expand_atomic_exchange_tdsi): New backend specific expander for
	atomic_exchange.
	(s390_match_ccmode_set): Allow CCZmode <-> CCZ1 mode.
	* config/s390/s390.md ("atomic_compare_and_swap<mode>"): Merge the
	patterns for small and large integers.  Forbid symref memory operands.
	Move expander to s390.c.  Require cc register.
	("atomic_compare_and_swap<DGPR:mode><CCZZ1:mode>_internal")
	("*atomic_compare_and_swap<TDI:mode><CCZZ1:mode>_1")
	("*atomic_compare_and_swapdi<CCZZ1:mode>_2")
	("*atomic_compare_and_swapsi<CCZZ1:mode>_3"): Use s_operand to forbid
	symref memory operands.  Remove CC mode and call s390_match_ccmode
	instead.
	("atomic_exchange<mode>"): Allow and implement all integer modes.

gcc/testsuite/ChangeLog:

2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR target/80080
	* gcc.target/s390/md/atomic_compare_exchange-1.c: New test.
	* gcc.target/s390/md/atomic_compare_exchange-1.inc: New test.
	* gcc.target/s390/md/atomic_exchange-1.inc: New test.

From-SVN: r247132
2017-04-25 07:37:50 +00:00
Dominik Vogt
97160c9b3b S/390: Load and test peephole.
gcc/ChangeLog:

2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* config/s390/s390.md (define_peephole2): New peephole to help
	combining the load-and-test pattern with volatile memory.

From-SVN: r247131
2017-04-25 07:33:05 +00:00
Dominik Vogt
3ea685e75a S/390: Use load-on-condition in cstorecc4
gcc/ChangeLog:

2017-04-25  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* config/s390/s390.md ("cstorecc4"): Use load-on-condition and deal
	with CCZmode for TARGET_Z196.

From-SVN: r247130
2017-04-25 07:31:22 +00:00
Jakub Jelinek
ba5d69f3f2 re PR rtl-optimization/80501 (Wrong code w/ a signed char, a shift, and a conversion to int)
PR rtl-optimization/80501
	* combine.c (make_compound_operation_int): Set subreg_code to SET
	even for AND with mask of the sign bit of mode.

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

From-SVN: r247128
2017-04-25 09:28:43 +02:00
Jakub Jelinek
3925946213 re PR rtl-optimization/80500 (ICE: internal consistency failure (error: invalid rtl sharing found in the insn))
PR rtl-optimization/80500
	* loop-unroll.c (combine_var_copies_in_loop_exit): Call copy_rtx on
	sum's initial value.

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

From-SVN: r247126
2017-04-25 09:27:01 +02:00
Julian Brown
904588d854 thunderx2t99.md (thunderx2t99_crc): New Reservation.
* config/aarch64/thunderx2t99.md (thunderx2t99_crc): New Reservation.


Co-Authored-By: Naveen H.S <Naveen.Hurugalawadi@cavium.com>

From-SVN: r247125
2017-04-25 06:58:14 +00:00
Julian Brown
424d5df0bb thunderx2t99.md (thunderx2t99_aes): New Reservation.
* config/aarch64/thunderx2t99.md (thunderx2t99_aes): New Reservation.
	(thunderx2t99_sha): New Reservation.


Co-Authored-By: Naveen H.S <Naveen.Hurugalawadi@cavium.com>

From-SVN: r247124
2017-04-25 06:55:50 +00:00
Marc Glisse
bb0249cbb7 Let tree_single_nonzero_warnv_p use range information
2017-04-25  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* fold-const.c (tree_single_nonzero_warnv_p): Handle SSA_NAME.

gcc/testsuite/
	* gcc.dg/tree-ssa/cmpmul-1.c: New file.
	* gcc.dg/Wstrict-overflow-18.c: Xfail.

From-SVN: r247123
2017-04-25 06:51:44 +00:00
Julian Brown
452e929aae aarch64-simd.md (aarch64_simd_vec_set<mode>): Fix type for 1-element load.
* config/aarch64/aarch64-simd.md (aarch64_simd_vec_set<mode>): Fix
	type for 1-element load.


Co-Authored-By: Naveen H.S <Naveen.Hurugalawadi@cavium.com>

From-SVN: r247122
2017-04-25 06:45:49 +00:00
GCC Administrator
e1bd42b9a1 Daily bump.
From-SVN: r247121
2017-04-25 00:16:22 +00:00
Janus Weil
be420eb811 re PR fortran/80121 (Memory leak with derived-type intent(out) argument)
2017-04-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80121
	* gfortran.dg/intent_out_9.f90: Remove deprecated cleanup-tree-dump
	directive.

From-SVN: r247115
2017-04-24 22:44:14 +02:00
Joseph Myers
c1c1c8ea6f Regenerate .pot files.
gcc/po:
	* gcc.pot: Regenerate.

libcpp/po:
	* cpplib.pot: Regenerate.

From-SVN: r247113
2017-04-24 21:37:39 +01:00
David Malcolm
0ebd1f00b8 types.rst (gccjit::type::get_const): Remove comment.
gcc_jit_type_get_aligned

gcc/jit/ChangeLog:
	* docs/cp/topics/types.rst (gccjit::type::get_const): Remove
	comment.
	(gccjit::type::get_aligned): Add.
	* docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
	* docs/topics/types.rst: Add gcc_jit_type_get_aligned.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.
	* jit-playback.c (gcc::jit::playback::type::get_aligned): New
	method.
	* jit-playback.h (gcc::jit::playback::type::get_aligned): New
	method.
	* jit-recording.c: Within namespace gcc::jit::recording...
	(type::get_aligned): New method.
	(memento_of_get_aligned::replay_into): New method.
	(memento_of_get_aligned::make_debug_string): New method.
	(memento_of_get_aligned::write_reproducer): New method.
	* jit-recording.h: Within namespace gcc::jit::recording...
	(type::get_aligned): New method.
	(type::accepts_writes_from): Strip off qualifications from
	this when comparing pointer equality.
	(decorated_type): New subclass of type, subsuming the
	commonality between memento_of_get_const and
	memento_of_get_volatile.
	(memento_of_get_const): Make a subclass of decorated_type,
	rather than type.
	(memento_of_get_volatile): Likewise.
	(memento_of_get_aligned): Likewise.
	* libgccjit++.h: Within namespace gccjit...
	(type::get_const): New method.
	(type::get_aligned): New method.
	* libgccjit.c (gcc_jit_type_get_aligned): New function.
	* libgccjit.h (gcc_jit_type_get_aligned): New decl.
	* libgccjit.map (LIBGCCJIT_ABI_7): New
	(gcc_jit_type_get_aligned): Add.

gcc/testsuite/ChangeLog:
	* jit.dg/all-non-failing-tests.h: Add test-alignment.c.
	* jit.dg/test-alignment.c: New test case.
	* jit.dg/test-alignment.cc: New test case.
	* jit.dg/test-error-gcc_jit_type_get_aligned-non-power-of-two.c:
	New test case.

From-SVN: r247111
2017-04-24 20:33:04 +00:00
Volker Reichelt
761ad35c86 decl.c (grokdeclarator): Use %qT instead of %<%T%> in
* decl.c (grokdeclarator): Use %qT instead of %<%T%> in
        * diagnostics.
        (start_enum): Likewise.
        (build_enumerator): Likewise. Use %qE instead of plain %E.
        * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
        %<%D%> in diagnostics.
        (cp_parser_elaborated_type_specifier): Likewise.
        * pt.c (make_pack_expansion): Use %qT and %qE instead of
        %<%T%> and %<%E%> in diagnostics.
        (tsubst_pack_expansion): Likewise.

From-SVN: r247110
2017-04-24 20:30:29 +00:00
David Malcolm
412f61f0f6 Fix location of sizeof/alignof (PR c++/80016)
PR c++/80016 reports an issue with bizarre underlined range
for a complicated expression.

The root cause for the incorrect *starting* location of that range
is that alignof and sizeof expressions currently have
start == finish == caret at the opening parenthesis of the
expression.

This patch fixes this by generating appropriate start and finish
locations for alignof and sizeof expressions.

gcc/cp/ChangeLog:
	PR c++/80016
	* parser.c (cp_parser_unary_expression):  Generate a location
	range for alignof and sizeof expressions.

gcc/testsuite/ChangeLog:
	PR c++/80016
	* g++.dg/plugin/diagnostic-test-expressions-1.C (test_sizeof): New
	test function.
	(test_alignof): New test function.

From-SVN: r247108
2017-04-24 19:12:52 +00:00
Marc Glisse
a8492d5ec1 X /[ex] 4 < Y /[ex] 4
2017-04-24  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* match.pd (X/[ex]C CMP Y/[ex]C): New transformation.

gcc/testsuite/
	* gcc.dg/tree-ssa/cmpexactdiv-2.c: New file.

From-SVN: r247107
2017-04-24 19:04:25 +00:00
Volker Reichelt
ec856f5f8b parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to error message.
* parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
        error message.
        (cp_parser_virt_specifier_seq_opt): Likewise.
        (set_and_check_decl_spec_loc): Likewise twice.

        * g++.dg/diagnostic/duplicate1.C: New test.
        * g++.dg/cpp0x/duplicate1.C: New test.

From-SVN: r247105
2017-04-24 16:43:01 +00:00
Martin Jambor
a753df11b8 [PR 80293] Dont totally-scalarize char arrays
2017-04-24  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/80293
	* tree-sra.c (scalarizable_type_p): New parameter const_decl, make
	char arrays not totally scalarizable if it is false.
	(analyze_all_variable_accesses): Pass correct value in the new
	parameter.  Add a statistics counter.

testsuite/
	* g++.dg/tree-ssa/pr80293.C: New test.

From-SVN: r247104
2017-04-24 17:13:39 +02:00
Jonathan Wakely
957221f551 PR libstdc++/80506 fix constant used in condition
PR libstdc++/80506
	* include/bits/random.tcc (gamma_distribution::operator()): Fix magic
	number used in loop condition.

From-SVN: r247099
2017-04-24 14:43:19 +01:00
Martin Liska
3ebd8e620b Fix (PR middle-end/79931)
2017-04-24  Jan Hubicka  <hubicka@ucw.cz>

	PR middle-end/79931
	* ipa-devirt.c (dump_possible_polymorphic_call_targets): Fix ICE.
2017-04-24  Martin Liska  <mliska@suse.cz>

	PR middle-end/79931
	* g++.dg/ipa/pr79931.C: New test.

From-SVN: r247097
2017-04-24 13:16:34 +00:00
Richard Biener
f30a1190ff re PR fortran/80494 (ICE in wide_int_to_tree)
2017-04-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80494
	* tree-scalar-evolution.c (analyze_scalar_evolution_1): Bail
	out for complex types.

	* gfortran.dg/pr80494.f90: New testcase.

From-SVN: r247095
2017-04-24 11:57:53 +00:00
Jonathan Wakely
6e2e575a03 PR libstdc++/80504 qualify calls to avoid ADL
PR libstdc++/80504
	* include/bits/refwrap.h (ref, cref): Qualify calls.
	* testsuite/20_util/reference_wrapper/80504.cc: New test.

From-SVN: r247094
2017-04-24 12:40:07 +01:00
Jonathan Wakely
71f257f78e PR libstdc++/80493 fix invalid exception specification
PR libstdc++/80493
	* include/experimental/optional (optional::swap): Fix exception
	specification.

From-SVN: r247093
2017-04-24 12:40:02 +01:00
Richard Biener
24c40f9a2c tree-ssa-sccvn.h (run_scc_vn): Adjust prototype.
2017-04-24  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.h (run_scc_vn): Adjust prototype.
	* tree-ssa-sccvn.c (print_scc): Print SCC size.
	(extract_and_process_scc_for_name): Never fail but drop SCC to varying.
	(DFS): Adjust and never fail.
	(sccvn_dom_walker::fail): Remove.
	(sccvn_dom_walker::before_dom_children): Adjust.
	(run_scc_vn): Likewise and never fail.
	* tree-ssa-pre.c (pass_pre::execute): Adjust.
	(pass_fre::execute): Likewise.

From-SVN: r247092
2017-04-24 11:27:44 +00:00
Richard Biener
4c7c437cb1 re PR tree-optimization/79725 (Sinking opportunity missed if blocked by dead stmt)
2017-04-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79725
	* tree-ssa-sink.c (statement_sink_location): Return whether
	failure reason was zero uses.  Move that check later.
	(sink_code_in_bb): Deal with zero uses by removing the stmt
	if possible.

	* gcc.dg/tree-ssa/ssa-sink-15.c: New testcase.

From-SVN: r247091
2017-04-24 07:48:47 +00:00
Richard Biener
d21a8e3bc6 re PR c++/2972 (-Wuninitialized could warn about uninitialized member variable usage in constructors)
2017-04-24  Richard Biener  <rguenther@suse.de>

	PR c++/2972
	* tree-ssa-uninit.c (warn_uninitialized_vars): Handle some
	pointer-based references.

	* g++.dg/warn/Wuninitialized-10.C: New testcase.

From-SVN: r247090
2017-04-24 07:34:51 +00:00
Richard Biener
3c5b0ca4c5 re PR bootstrap/79814 (pass-instances.def:36:14: error: ‘*<unknown>.gcc::pass_manager::pass_warn_unused_result_1’ is used uninitialized in this function)
2017-04-24  Richard Biener  <rguenther@suse.de>

	PR bootstrap/79814
	* pass_manager.h (pass_manager::operator new): Remove.
	(pass_manager::operator delete): Likewise.
	* passes.c (pass_manager::operator new): Remove.
	(pass_manager::operator delete): Likewise.
	(pass_manager::pass_manager): Zero individual pass members.

From-SVN: r247089
2017-04-24 07:33:20 +00:00
GCC Administrator
6382992791 Daily bump.
From-SVN: r247088
2017-04-24 00:16:25 +00:00
Jerry DeLisle
c7eb642efa re PR fortran/80484 (Three syntax errors involving derived-type I/O)
2017-04-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/80484
	* io.c (format_lex): Check for '/' and set token to FMT_SLASH.
	(check_format): Move FMT_DT checking code to data_desc section.
	* module.c (gfc_match_use): Include the case of INTERFACE_DTIO.

	PR fortran/80484
	* gfortran.dg/dtio_29.f03: New test.

From-SVN: r247084
2017-04-23 15:49:16 +00:00
Janus Weil
60fc41bd41 re PR fortran/80121 (Memory leak with derived-type intent(out) argument)
2017-04-22  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80121
	* trans-types.c (gfc_conv_procedure_call): Deallocate the components
	of allocatable intent(out) arguments.

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

	PR fortran/80121
	* gfortran.dg/intent_out_9.f90: New test case.

From-SVN: r247083
2017-04-23 10:26:50 +02:00
Uros Bizjak
2eb8a34363 re PR target/70799 (STV pass does not convert DImode shifts)
PR target/70799
	* config/i386/i386.c (dimode_scalar_to_vector_candidate_p)
	<case ASHIFT, case LSHIFTRT>: Also consider variable shifts.
	Check "XEXP (src, 1)" operand here.
	<case PLUS, case MINUS, case IOR, case XOR, case AND>:
	Check "XEXP (src, 1)" operand here.
	(dimode_scalar_chain::make_vector_copies): Detect count register
	of a shift instruction.  Zero extend count register from QImode
	to DImode to satisfy vector shift pattern count operand predicate.
	Substitute vector shift count operand with a DImode copy.
	(dimode_scalar_chain::convert_reg): Ditto, zero-extend from
	vector register.

testsuite/ChangeLog:

	PR target/70799
	* gcc.target/i186/pr70799-4.c: New test.

From-SVN: r247082
2017-04-23 09:25:30 +02:00
GCC Administrator
a1687c59a1 Daily bump.
From-SVN: r247081
2017-04-23 00:16:28 +00:00
GCC Administrator
78e0561028 Daily bump.
From-SVN: r247075
2017-04-22 00:16:26 +00:00
Janus Weil
fc23d35a75 re PR fortran/80392 ([OOP] ICE with allocatable polymorphic function result in a procedure pointer component)
2017-04-21  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/80392
	* trans-types.c (gfc_get_derived_type): Prevent an infinite loop when
	building a derived type that includes a procedure pointer component
	with a polymorphic result.

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

	PR fortran/80392
	* gfortran.dg/proc_ptr_comp_49.f90: New test case.

From-SVN: r247069
2017-04-21 22:47:12 +02:00