Commit Graph

197 Commits

Author SHA1 Message Date
GCC Administrator 13e4ba28f3 Daily bump. 2020-09-01 00:16:25 +00:00
GCC Administrator 57ea089421 Daily bump. 2020-08-27 00:16:27 +00:00
GCC Administrator 5b9a3d2a05 Daily bump. 2020-08-21 00:16:23 +00:00
GCC Administrator 5c265693bf Daily bump. 2020-08-19 00:16:23 +00:00
GCC Administrator abba25914e Daily bump. 2020-08-05 00:16:39 +00:00
GCC Administrator 6a1ad710ad Daily bump. 2020-08-04 00:16:24 +00:00
GCC Administrator 48cc2e468c Daily bump. 2020-08-01 00:16:25 +00:00
GCC Administrator d48cca8f21 Daily bump. 2020-07-31 00:16:26 +00:00
GCC Administrator 69273534c6 Daily bump. 2020-06-29 00:16:29 +00:00
GCC Administrator d61ffe1244 Daily bump. 2020-06-26 00:16:23 +00:00
GCC Administrator 56638b9b18 Daily bump. 2020-06-17 00:16:36 +00:00
GCC Administrator 0dcb572c08 Daily bump. 2020-06-15 00:16:21 +00:00
GCC Administrator b952c2cfcd Daily bump. 2020-06-10 00:16:47 +00:00
GCC Administrator 2c455ae06c Daily bump. 2020-06-09 00:16:47 +00:00
GCC Administrator 53d461e4e0 Daily bump. 2020-06-08 00:16:23 +00:00
GCC Administrator 1a59f3db4a Daily bump. 2020-06-06 00:16:29 +00:00
GCC Administrator 3add342502 Daily bump. 2020-06-05 00:16:30 +00:00
GCC Administrator a9312a7926 Daily bump. 2020-06-03 00:16:34 +00:00
Iain Buclaw 0af711e191 d: Fix ICE in verify_gimple_stmt, at tree-cfg.c:4959
Both array concat and array new expressions wrapped any temporaries
created into a BIND_EXPR.  This does not work if an expression used to
construct the result requires scope destruction, which is represented by
a TARGET_EXPR with a clean-up, and a CLEANUP_POINT_EXPR at the
location where the temporaries logically go out of scope.  The reason
for this not working is because the lowering of cleanup point
expressions does not traverse inside BIND_EXPRs to expand any gimple
cleanup expressions within.

The use of creating BIND_EXPR has been removed at both locations, and
replaced with a normal temporary variable that has initialization
delayed until its address is taken.

gcc/d/ChangeLog:

	PR d/94970
	* d-codegen.cc (force_target_expr): Move create_temporary_var
	implementation inline here.
	(create_temporary_var): Remove.
	(maybe_temporary_var): Remove.
	(bind_expr): Remove.
	* d-convert.cc (d_array_convert): Use build_local_temp to generate
	temporaries, and generate its assignment.
	* d-tree.h (create_temporary_var): Remove.
	(maybe_temporary_var): Remove.
	(d_array_convert): Remove vars argument.
	* expr.cc (ExprVisitor::visit (CatExp *)): Use build_local_temp to
	generate temporaries, don't wrap them in a BIND_EXPR.
	(ExprVisitor::visit (NewExp *)): Likewise.

gcc/testsuite/ChangeLog:

	PR d/94970
	* gdc.dg/pr94970.d: New test.
2020-05-06 23:56:24 +02:00
Iain Buclaw 852c4b0452 d: Fix documentation of -defaultlib= and -debuglib=
From the generated manpages, it was not clear that its usage is
'-debuglib=<libname>'.

gcc/d/ChangeLog:

	* gdc.texi (Options for Linking): Clarify usage of -defaultlib= and
	-debuglib= options.
2020-04-30 12:27:05 +02:00
Iain Buclaw 75f758a703 d: Merge bug fix from upstream dmd 06160ccae
Adds classKind information to the front-end AST, which in turn allows us
to fix code generation of type names for extern(C) and extern(C++)
structs and classes.  Inspecting such types inside a debugger now just
works without the need to 'cast(module_name.cxx_type)'.

gcc/d/ChangeLog:

	* d-codegen.cc (d_decl_context): Don't include module in the name of
	class and struct types that aren't extern(D).
2020-04-29 10:36:00 +02:00
Iain Buclaw 2370bdbb0b d: Fix ICE in assign_temp, at function.c:984 (PR94777)
Named arguments were being passed around by invisible reference, just
not variadic arguments.  There is a need to de-duplicate the routines
that handle declaration/parameter promotion and reference checking.
However for now, the parameter helper functions have just been renamed
to parameter_reference_p and parameter_type, to make it more clear that
it is the Parameter equivalent to declaration_reference_p and
declaration_type.

On writing the tests, a forward-reference bug was discovered on x86_64
during va_list type semantic.  This was due to fields not having their
parent set-up correctly.

gcc/d/ChangeLog:

	PR d/94777
	* d-builtins.cc (build_frontend_type): Set parent for generated
	fields of built-in types.
	* d-codegen.cc (argument_reference_p): Rename to ...
	(parameter_reference_p): ... this.
	(type_passed_as): Rename to ...
	(parameter_type): ... this.  Make TREE_ADDRESSABLE types restrict.
	(d_build_call): Move handling of non-POD types here from ...
	* d-convert.cc (convert_for_argument): ... here.
	* d-tree.h (argument_reference_p): Rename declaration to ...
	(parameter_reference_p): ... this.
	(type_passed_as): Rename declaration to ...
	(parameter_type): ... this.
	* types.cc (TypeVisitor::visit (TypeFunction *)): Update caller.

gcc/testsuite/ChangeLog:

	PR d/94777
	* gdc.dg/pr94777a.d: New test.
	* gdc.dg/pr94777b.d: New test.
2020-04-27 02:47:26 +02:00
Iain Buclaw 9887f9d815 Add changelog entry for previous commit 2020-04-26 11:33:41 +02:00
Iain Buclaw 018730326d d: Merge upstream dmd 09db0c41e, druntime e68a5ae3.
* New core.math.toPrec templates have been added as an intrinsic.

  Some floating point algorithms, such as Kahan-Babuska-Neumaier
  Summation, require rounding to specific precisions. Rounding to
  precision after every operation, however, loses overall precision in
  the general case and is a runtime performance problem.

  Adding these functions guarantee the rounding at required points in
  the code, and document where in the algorithm the requirement exists.

* Support IBM long double types in core.internal.convert.

* Add missing aliases for 64-bit vectors in core.simd.

* RUNNABLE_PHOBOS_TEST directive has been properly integrated into the
  D2 language testsuite.

Reviewed-on: https://github.com/dlang/druntime/pull/3063
	     https://github.com/dlang/dmd/pull/11054

gcc/d/ChangeLog:

	* intrinsics.cc (expand_intrinsic_toprec): New function.
	(maybe_expand_intrinsic): Handle toPrec intrinsics.
	* intrinsics.def (TOPRECF, TOPREC, TOPRECL): Add toPrec intrinsics.
2020-04-25 02:19:04 +02:00
Iain Buclaw 0b4718956d d: Fix order of precedence for -defaultlib and -debuglib
The order of precedence used by the upstream reference compiler for
determining what library to link against is:
- No library if -nophoboslib or -fno-druntime was seen.
- The library passed to -debuglib if -g was also seen.
- The library passed to -defaultlib
- The in-tree libgphobos library.

This aligns the D language driver to follow the same rules.

gcc/d/ChangeLog:

	* d-spec.cc (need_phobos): Remove.
	(lang_specific_driver): Replace need_phobos with phobos_library.
	Reorder -debuglib and -defaultlib to have precedence over libphobos.
	(lang_specific_pre_link): Remove test for need_phobos.
2020-04-24 23:39:32 +02:00
Iain Buclaw 8a9ce39f8b d: Fix FAIL in gdc.dg/runnable.d on X32 targets (PR94609)
Patch fixes test failure seen on X32 where a nested struct was passed in
registers, rather than via invisible reference.  Now, all non-POD
structs are passed by invisible reference, not just those with a
user-defined copy constructor/destructor.

gcc/d/ChangeLog:

	PR d/94609
	* d-codegen.cc (argument_reference_p): Don't check TREE_ADDRESSABLE.
	(type_passed_as): Build reference type if TREE_ADDRESSABLE.
	* d-convert.cc (convert_for_argument): Build explicit TARGET_EXPR if
	needed for arguments passed by invisible reference.
	* types.cc (TypeVisitor::visit (TypeStruct *)): Mark all structs that
	are not POD as TREE_ADDRESSABLE.
2020-04-19 09:54:25 +02:00
Iain Buclaw a1ccbae63c d: Merge update dmd 799066f49
Removes the implementation of __traits(argTypes), which only supported
x86_64 targets.  The only use of this trait is an unused va_arg()
function, this has been removed as well.

Reviewed-on: https://github.com/dlang/dmd/pull/11022

gcc/d/ChangeLog:

2020-04-13  Iain Buclaw  <ibuclaw@gdcproject.org>

	* Make-lang.in (D_FRONTEND_OBJS): Remove d/argtypes.o.
	* d-target.cc (Target::toArgTypes): New function.

libphobos/ChangeLog:

2020-04-13  Iain Buclaw  <ibuclaw@gdcproject.org>

	* libdruntime/core/stdc/stdarg.d: Remove run-time va_list template.
2020-04-13 11:35:28 +02:00
Iain Buclaw 7478addd84 libphobos: Use libdruntime as a convenience library for libphobos.
As a prerequesite for PR94304, it becomes easier to manage selectively
compiling sublibraries when there's only one library to link to.

So a druntime convenience library is built to be part of phobos, however
separate druntime library is still built and installed, to allow linking
only to the core runtime explicitly, rather than pulling in the entire
standard library with it.

The gdc driver no longer generates an '-lgdruntime' option, and the
inclusion of the libdruntime library path has been removed from the
testsuite.

gcc/d/ChangeLog:

	* d-spec.cc (LIBDRUNTIME): Remove.
	(LIBDRUNTIME_PROFILE): Remove.
	(lang_specific_driver): Don't link in libgdruntime.

gcc/testsuite/ChangeLog:

	* lib/gdc.exp (gdc_link_flags): Remove libdruntime library path.

libphobos/ChangeLog:

	* d_rules.am (libdgruntime_la_LINK): Move to libdruntime/Makefile.am.
	(libgphobos_la_LINK): Move to src/Makefile.am
	* libdruntime/Makefile.am: Add libgdruntime_convenience library.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am (libgphobos_la_LIBADD): Add libgdruntime_convenience
	library.
	(libgphobos_la_DEPENDENCIES): Likewise.
	* src/Makefile.in: Regenerate.
	* testsuite/lib/libphobos.exp: Remove libdruntime library paths.
	* testsuite/testsuite_flags.in: Likewise.
2020-04-10 12:46:12 +02:00
Iain Buclaw 30d26118f9 d: Always set ASM_VOLATILE_P on asm statements (PR94425)
gcc/d/ChangeLog:

	PR d/94425
	* toir.cc (IRVisitor::visit (GccAsmStatement *)): Set ASM_VOLATILE_P
	on all asm statements.
2020-04-07 09:44:02 +02:00
Iain Buclaw 013fca64fc d: Merge UDAs between function prototype and definitions (PR90136)
This change fixes the symbol merging in get_symbol_decl to also consider
prototypes.  This allows the ability to set user defined attributes on
the prototype of a function, which then get applied to the definition,
if found later in the compilation.

The lowering of UDAs to GCC attributes has been commonized into a single
function called apply_user_attributes.

gcc/d/ChangeLog:

	PR d/90136
	* d-attribs.cc: Include dmd/attrib.h.
	(build_attributes): Redeclare as static.
	(apply_user_attributes): New function.
	* d-tree.h (class UserAttributeDeclaration): Remove.
	(build_attributes): Remove.
	(apply_user_attributes): Declare.
	(finish_aggregate_type): Remove attrs argument.
	* decl.cc (get_symbol_decl): Merge declaration prototypes with
	definitions.  Use apply_user_attributes.
	* modules.cc (layout_moduleinfo_fields): Remove last argument to
	finish_aggregate_type.
	* typeinfo.cc (layout_classinfo_interfaces): Likewise.
	* types.cc (layout_aggregate_members): Likewise.
	(finish_aggregate_type): Remove attrs argument.
	(TypeVisitor::visit (TypeEnum *)): Use apply_user_attributes.
	(TypeVisitor::visit (TypeStruct *)): Remove last argument to
	finish_aggregate_type.  Use apply_user_attributes.
	(TypeVisitor::visit (TypeClass *)): Likewise.

gcc/testsuite/ChangeLog:

	PR d/90136
	* gdc.dg/pr90136a.d: New test.
	* gdc.dg/pr90136b.d: New test.
	* gdc.dg/pr90136c.d: New test.
2020-04-01 00:12:47 +02:00
Iain Buclaw 1c16f7fc90 d: Add always_inline to the internal attribute table.
This attribute is not directly accessible from user code, rather it is
indirectly added from the @forceinline attribute.  Even so, a handler
should be present for it to prevent false positive warnings.

Said warnings are not something that could happen currently, but will
become a problem from fixing PR90136 later.

gcc/d/ChangeLog:

	* d-attribs.cc (d_langhook_common_attribute_table): Add always_inline.
	(handle_always_inline_attribute): New function.
2020-03-31 23:08:23 +02:00
Iain Buclaw e8e0acbaa3 d: Use memset to fill alignment holes with zeroes.
This patch removes the manual insertion of padding for fields in
constructed struct literals, and instead uses memset() on the
declaration being initialized.

When compiling optimized builds, the intent is usually missed, and
alignment holes end up with non-zero values in them anyway.

gcc/d/ChangeLog:

	PR d/94424
	* d-codegen.cc (build_alignment_field): Remove.
	(build_struct_literal): Don't insert alignment padding.
	* expr.cc (ExprVisitor::visit (AssignExp *)): Call memset before
	assigning struct literals.

gcc/testsuite/ChangeLog:

	PR d/94424
	* gdc.dg/pr94424.d: New test.
2020-03-31 19:03:04 +02:00
Iain Buclaw 48742e02d7 d: Use d_comdat_linkage on generated internal decl.
This adds weak linkage to internal TypeInfo data on top of the existing
DECL_COMDAT, which helps in the unlikely event that two of the same
TypeInfo data ends up in multiple places.

gcc/d/ChangeLog:

	* typeinfo.cc (TypeInfoVisitor::internal_reference): Call
	d_comdat_linkage on generated decl.
2020-03-31 15:54:45 +02:00
Iain Buclaw fbe60463bb d: Generate phony targets for content imported files (PR93038)
This is in addition to the last change which started including them in
the make dependency list.

gcc/d/ChangeLog:

2020-03-22  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/93038
	* d-lang.cc (deps_write): Generate phony targets for content imported
	files.

gcc/testsuite/ChangeLog:

2020-03-22  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/93038
	* gdc.dg/pr93038b.d: New test.
2020-03-22 13:18:39 +01:00
Iain Buclaw 4a01f7b1e7 d: Fix missing dependencies in depfile for imported files (PR93038)
A new field for tracking imported files was added to the front-end, this
makes use of it by writing all such files in the make dependency list.

gcc/d/ChangeLog:

2020-03-22  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/93038
	* d-lang.cc (deps_write): Add content imported files to the make
	dependency list.

gcc/testsuite/ChangeLog:

2020-03-22  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/93038
	* gdc.dg/fileimports/pr93038.txt: New test.
	* gdc.dg/pr93038.d: New test.
2020-03-22 00:10:37 +01:00
Iain Buclaw 424e39081f d: Fix typo in ChangeLog for last change 2020-03-22 00:10:36 +01:00
Iain Buclaw 98eb7b2ed2 d: Fix ICE in add_symbol_to_partition_1, at lto/lto-partition.c:215
This patch addresses two problems with TypeInfo initializer generation.

1. D array fields pointing to compiler generated data are referencing
public symbols with no unique prefix, which can lead to duplicate
definition errors in some hard to reduce cases.  To avoid name clashes,
all symbols that are generated for TypeInfo initializers now use the
assembler name of the TypeInfo decl as a prefix.

2. An ICE would occur during LTO pass because these same decls are
considered to be part of the same comdat group as the TypeInfo decl that
it's referred by, despite itself being neither marked public nor comdat.
This resulted in decls being added to the LTRANS partition out of order,
triggering an assert when add_symbol_to_partition_1 attempted to add
them again.  To remedy, TREE_PUBLIC and DECL_COMDAT are now set on all
generated symbols.

gcc/d/ChangeLog:

2020-03-21  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/94290
	* typeinfo.cc (class TypeInfoVisitor): Replace type_ field with decl_.
	(TypeInfoVisitor::TypeInfoVisitor): Set decl_.
	(TypeInfoVisitor::result): Update.
	(TypeInfoVisitor::internal_reference): New function.
	(TypeInfoVisitor::layout_string): Use internal_reference.
	(TypeInfoVisitor::visit (TypeInfoTupleDeclaration *)): Likewise.
	(layout_typeinfo): Construct TypeInfoVisitor with typeinfo decl.
	(layout_classinfo): Likewise.
2020-03-21 16:52:21 +01:00
Iain Buclaw b5446d0cc0 d: Fix SEGV in hash_table<odr_name_hasher, false, xcallocator>::find_slot_with_hash
This patch fixes LTO bug with the D front-end.  As DECL_ASSEMBLER_NAME
is set on the TYPE_DECL, so TYPE_CXX_ODR_P must also be set on the type.

The addition of merge_aggregate_types is not strictly needed now, but it
fixes a problem introduced in newer versions of the dmd front-end where
templated types could be sent more than once to the D code generator.

gcc/d/ChangeLog:

2020-03-20  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR lto/91027
	* d-tree.h (struct GTY): Add daggregate field.
	(IDENTIFIER_DAGGREGATE): Define.
	(d_mangle_decl): Add declaration.
	* decl.cc (mangle_decl): Remove static linkage, rename to...
	(d_mangle_decl): ...this, update all callers.
	* types.cc (merge_aggregate_types): New function.
	(TypeVisitor::visit (TypeStruct *)): Call merge_aggregate_types, set
	IDENTIFIER_DAGGREGATE and TYPE_CXX_ODR_P.
	(TypeVisitor::visit (TypeClass *)): Likewise.
2020-03-20 17:26:29 +01:00
Jakub Jelinek d5029d4594 Fix up duplicated duplicated words in comments
Another set of duplicated word fixes for things I've missed last time.
These include e.g. *.cc files I forgot about, or duplicated words at the start
or end of line.

2020-03-18  Jakub Jelinek  <jakub@redhat.com>

	* asan.c (get_mem_refs_of_builtin_call): Fix up duplicated word issue
	in a comment.
	* config/arc/arc.c (frame_stack_add): Likewise.
	* gimple-loop-versioning.cc (loop_versioning::analyze_arbitrary_term):
	Likewise.
	* ipa-predicate.c (predicate::remap_after_inlining): Likewise.
	* tree-ssa-strlen.h (handle_printf_call): Likewise.
	* tree-ssa-strlen.c (is_strlen_related_p): Likewise.
	* optinfo-emit-json.cc (optrecord_json_writer::add_record): Likewise.
analyzer/
	* sm-malloc.cc (malloc_state_machine::on_stmt): Fix up duplicated word
	issue in a comment.
	* region-model.cc (region_model::make_region_for_unexpected_tree_code,
	region_model::delete_region_and_descendents): Likewise.
	* engine.cc (class exploded_cluster): Likewise.
	* diagnostic-manager.cc (class path_builder): Likewise.
cp/
	* constraint.cc (resolve_function_concept_check, subsumes_constraints,
	strictly_subsumes): Fix up duplicated word issue in a comment.
	* coroutines.cc (build_init_or_final_await, captures_temporary):
	Likewise.
	* logic.cc (dnf_size_r, cnf_size_r): Likewise.
	* pt.c (append_type_to_template_for_access_check): Likewise.
d/
	* expr.cc (ExprVisitor::visit (CatAssignExp *)): Fix up duplicated
	word issue in a comment.
	* d-target.cc (Target::FPTypeProperties<T>::max): Likewise.
fortran/
	* class.c (generate_finalization_wrapper): Fix up duplicated word
	issue in a comment.
	* trans-types.c (gfc_get_nodesc_array_type): Likewise.
2020-03-18 12:56:26 +01:00
Iain Buclaw 2691ffe6db d: Fix assignment to anonymous union member corrupts sibling members in struct
gcc/d/ChangeLog:

	PR d/92309
	* types.cc (fixup_anonymous_offset): Don't set DECL_FIELD_OFFSET on
	anonymous fields.

gcc/testsuite/ChangeLog:

	PR d/92309
	* gdc.dg/pr92309.d: New test.
2020-03-16 23:56:38 +01:00
Iain Buclaw 447d196e75 d: Fix multiple definition error when using mixins and interfaces.
gcc/d/ChangeLog:

	PR d/92216
	* decl.cc (make_thunk): Don't set TREE_PUBLIC on thunks if the target
	function is external to the current compilation.

gcc/testsuite/ChangeLog:

	PR d/92216
	* gdc.dg/imports/pr92216.d: New.
	* gdc.dg/pr92216.d: New test.
2020-03-16 23:04:49 +01:00
Jakub Jelinek 8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +01:00
Jakub Jelinek 7e7065b976 gcc.c (process_command): Update copyright notice dates.
* gcc.c (process_command): Update copyright notice dates.
	* gcov-dump.c (print_version): Ditto.
	* gcov.c (print_version): Ditto.
	* gcov-tool.c (print_version): Ditto.
	* gengtype.c (create_file): Ditto.
	* doc/cpp.texi: Bump @copying's copyright year.
	* doc/cppinternals.texi: Ditto.
	* doc/gcc.texi: Ditto.
	* doc/gccint.texi: Ditto.
	* doc/gcov.texi: Ditto.
	* doc/install.texi: Ditto.
	* doc/invoke.texi: Ditto.
gcc/fortran/ 
	* gfortranspec.c (lang_specific_driver): Update copyright notice
	dates.
	* gfc-internals.texi: Bump @copying's copyright year.
	* gfortran.texi: Ditto.
	* intrinsic.texi: Ditto.
	* invoke.texi: Ditto.
gcc/d/
	* gdc.texi: Bump @copyrights-d year.
gcc/go/
	* gccgo.texi: Bump @copyrights-go year.
gcc/ada/
  	* gnat_ugn.texi: Bump @copying's copyright year.
  	* gnat_rm.texi: Likewise.
libitm/
	* libitm.texi: Bump @copying's copyright year.
libgomp/
	* libgomp.texi: Bump @copying's copyright year.
libquadmath/
	* libquadmath.texi: Bump @copying's copyright year.

From-SVN: r279811
2020-01-01 12:14:37 +01:00
Richard Sandiford e8738f4e96 Remove build_{same_sized_,}truth_vector_type
build_same_sized_truth_vector_type was confusingly named, since for
SVE and AVX512 the returned vector isn't the same byte size (although
it does have the same number of elements).  What it really returns
is the "truth" vector type for a given data vector type.

The more general truth_type_for provides the same thing when passed
a vector and IMO has a more descriptive name, so this patch replaces
all uses of build_same_sized_truth_vector_type with that.  It does
the same for a call to build_truth_vector_type, leaving truth_type_for
itself as the only remaining caller.

It's then more natural to pass build_truth_vector_type the original
vector type rather than its size and nunits, especially since the
given size isn't the size of the returned vector.  This in turn allows
a future patch to simplify the interface of get_mask_mode.  Doing this
also fixes a bug in which truth_type_for would pass a size of zero for
BLKmode vector types.

2019-11-14  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree.h (build_truth_vector_type): Delete.
	(build_same_sized_truth_vector_type): Likewise.
	* tree.c (build_truth_vector_type): Rename to...
	(build_truth_vector_type_for): ...this.  Make static and take
	a vector type as argument.
	(truth_type_for): Update accordingly.
	(build_same_sized_truth_vector_type): Delete.
	* tree-vect-generic.c (expand_vector_divmod): Use truth_type_for
	instead of build_same_sized_truth_vector_type.
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Likewise.
	(vect_record_loop_mask, vect_get_loop_mask): Likewise.
	* tree-vect-patterns.c (build_mask_conversion): Likeise.
	* tree-vect-slp.c (vect_get_constant_vectors): Likewise.
	* tree-vect-stmts.c (vect_get_vec_def_for_operand): Likewise.
	(vect_build_gather_load_calls, vectorizable_call): Likewise.
	(scan_store_can_perm_p, vectorizable_scan_store): Likewise.
	(vectorizable_store, vectorizable_condition): Likewise.
	(get_mask_type_for_scalar_type, get_same_sized_vectype): Likewise.
	(vect_get_mask_type_for_stmt): Use truth_type_for instead of
	build_truth_vector_type.
	* config/aarch64/aarch64-sve-builtins.cc (gimple_folder::convert_pred):
	Use truth_type_for instead of build_same_sized_truth_vector_type.
	* config/rs6000/rs6000-call.c (fold_build_vec_cmp): Likewise.

gcc/c/
	* c-typeck.c (build_conditional_expr): Use truth_type_for instead
	of build_same_sized_truth_vector_type.
	(build_vec_cmp): Likewise.

gcc/cp/
	* call.c (build_conditional_expr_1): Use truth_type_for instead
	of build_same_sized_truth_vector_type.
	* typeck.c (build_vec_cmp): Likewise.

gcc/d/
	* d-codegen.cc (build_boolop): Use truth_type_for instead of
	build_same_sized_truth_vector_type.

From-SVN: r278232
2019-11-14 14:49:36 +00:00
Joseph Myers 00be2a5f39 Add C2x *_NORM_MAX constants to <float.h>.
C2x adds <float.h> constants FLT_NORM_MAX, DBL_NORM_MAX and
LDBL_NORM_MAX.  These are for the maximum "normalized" finite
floating-point number, where the given definition of normalized is
that all possible values with MANT_DIG significand digits (leading one
not zero) can be represented with that exponent.  The effect of that
definition is that these macros are the same as the corresponding MAX
macros for all formats except IBM long double, where the NORM_MAX
value has exponent 1 smaller than the MAX one so that all 106 digits
can be 1.

This patch adds those macros to GCC.  They are only defined for float,
double and long double; C2x does not include such macros for DFP
types, and while the integration of TS 18661-3 into C2x has not yet
occurred, the draft proposed text does not add them for the _FloatN /
_FloatNx types (where they would always be the same as the MAX
macros).

Bootstrapped with no regressions on x86_64-pc-linux-gnu.  Also tested
compilation of the new test for powerpc-linux-gnu to confirm the check
of LDBL_NORM_MAX in the IBM long double case does get properly
optimized out.

gcc:
	* ginclude/float.c [__STDC_VERSION__ > 201710L] (FLT_NORM_MAX,
	DBL_NORM_MAX, LDBL_NORM_MAX): Define.
	* real.c (get_max_float): Add norm_max argument.
	* real.h (get_max_float): Update prototype.
	* builtins.c (fold_builtin_interclass_mathfn): Update calls to
	get_max_float.

gcc/c-family:
	* c-cppbuiltin.c (builtin_define_float_constants): Also define
	NORM_MAX constants.  Update call to get_max_float.
	(LAZY_HEX_FP_VALUES_CNT): Update value to include NORM_MAX
	constants.

gcc/d:
	* d-target.cc (define_float_constants): Update call to
	get_max_float.

gcc/testsuite:
	* gcc.dg/c11-float-3.c, gcc.dg/c2x-float-1.c: New tests.

From-SVN: r278145
2019-11-13 15:25:15 +00:00
Richard Sandiford a1b6805971 [D] Remove unchecked to_constant in VECTOR_TYPE handling
The SVE port now tries to register variable-length VECTOR_TYPEs
at start-up, so it's no longer possible to use the asserting
to_constant on the number of vector elements.  This patch punts
on variable element counts instead, just like we do for other
things that the frontend doesn't recognise.

The brace indentation matches the surrounding style.

2019-11-04  Richard Sandiford  <richard.sandiford@arm.com>

gcc/d/
	* d-builtins.cc (build_frontend_type): Cope with variable
	TYPE_VECTOR_SUBPARTS.

From-SVN: r277793
2019-11-04 21:14:22 +00:00
Jakub Jelinek df375b0321 re PR middle-end/91283 (gcc.dg/torture/c99-contract-1.c FAILs)
PR middle-end/91283
	* common.opt (fexcess-precision=): Add Optimization flag.  Use
	flag_excess_precision variable instead of
	flag_excess_precision_cmdline.
	* flags.h (class target_flag_state): Remove x_flag_excess_precision
	member.
	(flag_excess_precision): Don't define.
	* langhooks.c (lhd_post_options): Set flag_excess_precision instead of
	flag_excess_precision_cmdline.  Remove comment.
	* opts.c (set_fast_math_flags): Use frontend_set_flag_excess_precision
	and x_flag_excess_precision instead of
	frontend_set_flag_excess_precision_cmdline and
	x_flag_excess_precision_cmdline.
	(fast_math_flags_set_p): Use x_flag_excess_precision instead of
	x_flag_excess_precision_cmdline.
	* toplev.c (init_excess_precision): Remove.
	(lang_dependent_init_target): Don't call it.
ada/
	* gcc-interface/misc.c (gnat_post_options): Set flag_excess_precision
	instead of flag_excess_precision_cmdline.
brig/
	* brig-lang.c (brig_langhook_post_options): Set flag_excess_precision
	instead of flag_excess_precision_cmdline.
c-family/
	* c-common.c (c_ts18661_flt_eval_method): Use flag_excess_precision
	instead of flag_excess_precision_cmdline.
	* c-cppbuiltin.c (c_cpp_flt_eval_method_iec_559): Likewise.
	* c-opts.c (c_common_post_options): Likewise.
d/
	* d-lang.cc (d_post_options): Set flag_excess_precision instead of
	flag_excess_precision_cmdline.
fortran/
	* options.c (gfc_post_options): Set flag_excess_precision instead of
	flag_excess_precision_cmdline.  Remove comment.
go/
	* go-lang.c (go_langhook_post_options): Set flag_excess_precision
	instead of flag_excess_precision_cmdline.
lto/
	* lto-lang.c (lto_post_options): Set flag_excess_precision instead of
	flag_excess_precision_cmdline.  Remove comment.

From-SVN: r274850
2019-08-23 13:37:29 +02:00
Iain Buclaw 7cc9cfd2ca d: Partially fix ICE: in register_moduleinfo, at d/modules.cc:40
gcc/d/ChangeLog:

	PR d/88722
	* modules.cc: Include diagnostic.h.
	(register_moduleinfo): Use sorry instead of gcc_assert for targets
	without named sections.

From-SVN: r274769
2019-08-21 07:53:44 +00:00
Iain Buclaw de83a4c14b d/dmd: Merge upstream dmd 375ed10aa
Don't crash when compiling for 16-bit platforms.

Reviewed-on: https://github.com/dlang/dmd/pull/10306

gcc/d/ChangeLog:

	* d-target.cc: Include diagnostic.h.
	(Target::_init): Set Tsize_t and Tptrdiff_t as D ushort and short if
	the target pointer size is 2.  Add sorry if the pointer size is not
	either 2, 4, or 8.

From-SVN: r274768
2019-08-21 07:53:35 +00:00
Iain Buclaw edf095929f d: Fix ICE: Segmentation fault in build_function_type at gcc/tree.c:8539
gcc/d/ChangeLog:

	PR d/90446
	* d-lang.cc (d_type_for_mode): Check for all internal __intN types.
	(d_type_for_size): Likewise.

From-SVN: r274767
2019-08-21 07:53:25 +00:00
Iain Buclaw 7610ae806e d: Fix internal compiler error: in d_build_c_type_nodes, at d/d-builtins.cc:783
gcc/d/ChangeLog:

	PR d/90445
	* d-builtins.cc (d_build_c_type_nodes): Test UINTMAX_TYPE for setting
	uintmax_type_node.  Set signed_size_type_node as the signed_type_for
	size_type_node.

From-SVN: r274766
2019-08-21 07:53:15 +00:00
Iain Buclaw 2ee3ea4b90 d: Fix internal compiler error: in d_init_builtins, at d/d-builtins.cc:1121
gcc/d/ChangeLog:

	PR d/90444
	* d-builtins.cc (build_frontend_type): Build anonymous RECORD_TYPE
	nodes as well, push all fields to the struct members.
	(d_build_builtins_module): Push anonymous va_list structs to the
	builtins module, naming them __builtin_va_list.
	(d_init_builtins): Use sorry instead of gcc_unreachable if va_list did
	not succeed in being represented as a D type.

From-SVN: r274765
2019-08-21 07:53:05 +00:00
Richard Sandiford 4d732405bd Use checking forms of DECL_FUNCTION_CODE (PR 91421)
We were shoe-horning all built-in enumerations (including frontend
and target-specific ones) into a field of type built_in_function.  This
was accessed as either an lvalue or an rvalue using DECL_FUNCTION_CODE.

The obvious danger with this (as was noted by several ??? comments)
is that the ranges have nothing to do with each other, and targets can
easily have more built-in functions than generic code.  But my patch to
make the field bigger was the straw that finally made the problem visible.

This patch therefore:

- replaces the field with a plain unsigned int

- turns DECL_FUNCTION_CODE into an rvalue-only accessor that checks
  that the function really is BUILT_IN_NORMAL

- adds corresponding DECL_MD_FUNCTION_CODE and DECL_FE_FUNCTION_CODE
  accessors for BUILT_IN_MD and BUILT_IN_FRONTEND respectively

- adds DECL_UNCHECKED_FUNCTION_CODE for places that need to access the
  underlying field (should be low-level code only)

- adds new helpers for setting the built-in class and function code

- makes DECL_BUILT_IN_CLASS an rvalue-only accessor too, since all
  assignments should go through the new helpers

2019-08-13  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR middle-end/91421
	* tree-core.h (function_decl::function_code): Change type to
	unsigned int.
	* tree.h (DECL_FUNCTION_CODE): Rename old definition to...
	(DECL_UNCHECKED_FUNCTION_CODE): ...this.
	(DECL_BUILT_IN_CLASS): Make an rvalue macro only.
	(DECL_FUNCTION_CODE): New function.  Assert that the built-in class
	is BUILT_IN_NORMAL.
	(DECL_MD_FUNCTION_CODE, DECL_FE_FUNCTION_CODE): New functions.
	(set_decl_built_in_function, copy_decl_built_in_function): Likewise.
	(fndecl_built_in_p): Change the type of the "name" argument to
	unsigned int.
	* builtins.c (expand_builtin): Move DECL_FUNCTION_CODE use
	after check for DECL_BUILT_IN_CLASS.
	* cgraphclones.c (build_function_decl_skip_args): Use
	set_decl_built_in_function.
	* ipa-param-manipulation.c (ipa_modify_formal_parameters): Likewise.
	* ipa-split.c (split_function): Likewise.
	* langhooks.c (add_builtin_function_common): Likewise.
	* omp-simd-clone.c (simd_clone_create): Likewise.
	* tree-streamer-in.c (unpack_ts_function_decl_value_fields): Likewise.
	* config/darwin.c (darwin_init_cfstring_builtins): Likewise.
	(darwin_fold_builtin): Use DECL_MD_FUNCTION_CODE instead of
	DECL_FUNCTION_CODE.
	* fold-const.c (operand_equal_p): Compare DECL_UNCHECKED_FUNCTION_CODE
	instead of DECL_FUNCTION_CODE.
	* lto-streamer-out.c (hash_tree): Use DECL_UNCHECKED_FUNCTION_CODE
	instead of DECL_FUNCTION_CODE.
	* tree-streamer-out.c (pack_ts_function_decl_value_fields): Likewise.
	* print-tree.c (print_node): Use DECL_MD_FUNCTION_CODE when
	printing DECL_BUILT_IN_MD.  Handle DECL_BUILT_IN_FRONTEND.
	* config/aarch64/aarch64-builtins.c (aarch64_expand_builtin)
	(aarch64_fold_builtin, aarch64_gimple_fold_builtin): Use
	DECL_MD_FUNCTION_CODE instead of DECL_FUNCTION_CODE.
	* config/aarch64/aarch64.c (aarch64_builtin_reciprocal): Likewise.
	* config/alpha/alpha.c (alpha_expand_builtin, alpha_fold_builtin):
	(alpha_gimple_fold_builtin): Likewise.
	* config/arc/arc.c (arc_expand_builtin): Likewise.
	* config/arm/arm-builtins.c (arm_expand_builtin): Likewise.
	* config/avr/avr-c.c (avr_resolve_overloaded_builtin): Likewise.
	* config/avr/avr.c (avr_expand_builtin, avr_fold_builtin): Likewise.
	* config/bfin/bfin.c (bfin_expand_builtin): Likewise.
	* config/c6x/c6x.c (c6x_expand_builtin): Likewise.
	* config/frv/frv.c (frv_expand_builtin): Likewise.
	* config/gcn/gcn.c (gcn_expand_builtin_1): Likewise.
	(gcn_expand_builtin): Likewise.
	* config/i386/i386-builtins.c (ix86_builtin_reciprocal): Likewise.
	(fold_builtin_cpu): Likewise.
	* config/i386/i386-expand.c (ix86_expand_builtin): Likewise.
	* config/i386/i386.c (ix86_fold_builtin): Likewise.
	(ix86_gimple_fold_builtin): Likewise.
	* config/ia64/ia64.c (ia64_fold_builtin): Likewise.
	(ia64_expand_builtin): Likewise.
	* config/iq2000/iq2000.c (iq2000_expand_builtin): Likewise.
	* config/mips/mips.c (mips_expand_builtin): Likewise.
	* config/msp430/msp430.c (msp430_expand_builtin): Likewise.
	* config/nds32/nds32-intrinsic.c (nds32_expand_builtin_impl): Likewise.
	* config/nios2/nios2.c (nios2_expand_builtin): Likewise.
	* config/nvptx/nvptx.c (nvptx_expand_builtin): Likewise.
	* config/pa/pa.c (pa_expand_builtin): Likewise.
	* config/pru/pru.c (pru_expand_builtin): Likewise.
	* config/riscv/riscv-builtins.c (riscv_expand_builtin): Likewise.
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	Likewise.
	* config/rs6000/rs6000-call.c (htm_expand_builtin): Likewise.
	(altivec_expand_dst_builtin, altivec_expand_builtin): Likewise.
	(rs6000_gimple_fold_builtin, rs6000_expand_builtin): Likewise.
	* config/rs6000/rs6000.c (rs6000_builtin_md_vectorized_function)
	(rs6000_builtin_reciprocal): Likewise.
	* config/rx/rx.c (rx_expand_builtin): Likewise.
	* config/s390/s390-c.c (s390_resolve_overloaded_builtin): Likewise.
	* config/s390/s390.c (s390_expand_builtin): Likewise.
	* config/sh/sh.c (sh_expand_builtin): Likewise.
	* config/sparc/sparc.c (sparc_expand_builtin): Likewise.
	(sparc_fold_builtin): Likewise.
	* config/spu/spu-c.c (spu_resolve_overloaded_builtin): Likewise.
	* config/spu/spu.c (spu_expand_builtin): Likewise.
	* config/stormy16/stormy16.c (xstormy16_expand_builtin): Likewise.
	* config/tilegx/tilegx.c (tilegx_expand_builtin): Likewise.
	* config/tilepro/tilepro.c (tilepro_expand_builtin): Likewise.
	* config/xtensa/xtensa.c (xtensa_fold_builtin): Likewise.
	(xtensa_expand_builtin): Likewise.

gcc/ada/
	PR middle-end/91421
	* gcc-interface/trans.c (gigi): Call set_decl_buillt_in_function.
	(Call_to_gnu): Use DECL_FE_FUNCTION_CODE instead of DECL_FUNCTION_CODE.

gcc/c/
	PR middle-end/91421
	* c-decl.c (merge_decls): Use copy_decl_built_in_function.

gcc/c-family/
	PR middle-end/91421
	* c-common.c (resolve_overloaded_builtin): Use
	copy_decl_built_in_function.

gcc/cp/
	PR middle-end/91421
	* decl.c (duplicate_decls):  Use copy_decl_built_in_function.
	* pt.c (declare_integer_pack): Use set_decl_built_in_function.

gcc/d/
	PR middle-end/91421
	* intrinsics.cc (maybe_set_intrinsic): Use set_decl_built_in_function.

gcc/jit/
	PR middle-end/91421
	* jit-playback.c (new_function): Use set_decl_built_in_function.

gcc/lto/
	PR middle-end/91421
	* lto-common.c (compare_tree_sccs_1): Use DECL_UNCHECKED_FUNCTION_CODE
	instead of DECL_FUNCTION_CODE.
	* lto-symtab.c (lto_symtab_merge_p): Likewise.

From-SVN: r274404
2019-08-13 21:35:20 +00:00
Iain Buclaw 4c9dbb967f d: Fix ICE: gimplification failed (gimplify.c at 13436)
The expression that caused the ICE

	++(a += 1.0);

The D front-end rewrites and applies implicit type conversions so the
expression gets simplified as

	(int)((double) a += 1.0) += 1

The codegen pass would subsequently generate the following invalid code

	(int)(double) a = (int)((double) a + 1.0) + 1

The LHS expression `(int)(double) a', represented as a FIX_TRUNC_EXPR
being what trips as it is not a valid lvalue for assignment.

While LHS casts are stripped away, convert_expr adds a double cast
because it converts the expression to its original type before
converting it to its target type.  There is no valid reason why this is
done, so it has been removed.

gcc/d/ChangeLog:

	PR d/90601
	* d-convert.cc (convert_expr): Don't convert an expression to its
	original front-end type before converting to its target type.

gcc/testsuite/ChangeLog:

	PR d/90601
	* gdc.dg/pr90601.d: New test.

From-SVN: r274263
2019-08-11 06:53:14 +00:00
Iain Buclaw 884efbd523 d: Fix internal compiler error: in add_expr, at tree.c:7794
gcc/d/ChangeLog:

	PR d/91238
	* d-codegen.cc (build_address): If taking the address of a CALL_EXPR,
	wrap it in a TARGET_EXPR.

gcc/testsuite/ChangeLog:

	PR d/91238
	* gdc.dg/pr91238.d: New test.

From-SVN: r274253
2019-08-10 14:11:49 +00:00
Jakub Jelinek ab20d992c8 Assorted ChangeLog cleanups.
From-SVN: r274250
2019-08-10 11:59:17 +02:00
Iain Buclaw 7403925388 Fix ODR violation in d/runtime.cc
gcc/d/ChangeLog:

	PR d/90893
	* runtime.cc (enum libcall_type): Rename to...
	(enum d_libcall_type): ...this.
	(get_libcall_type): Use d_libcall_type.
	(build_libcall_decl): Likewise.

From-SVN: r274249
2019-08-10 05:25:44 +00:00
Iain Buclaw b0a55e6657 re PR d/90559 (Out of memory because of negative length)
PR d/90559
d/dmd: Merge upstream dmd 7afcc60c3

Partially fixes out of memory because of negative length.

Reviewed-on: https://github.com/dlang/dmd/pull/10025

gcc/d/ChangeLog:

2019-06-16  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/90559
	* d-target.cc (Target::_init): Reduce max static data size to INT_MAX.

From-SVN: r272351
2019-06-16 07:50:20 +00:00
Iain Buclaw 88ad43b1f9 re PR d/90651 (ICE in FuncDeclaration::semantic3, at d/dmd/func.c:1524)
PR d/90651
d/dmd: Merge upstream dmd 0f6cbbcad

Fixes segmentation fault in FuncDeclaration::semantic3.

Reviewed-on: https://github.com/dlang/dmd/pull/10003

gcc/d/ChangeLog:

2019-06-16  Iain Buclaw  <ibuclaw@gdcproject.org>

	* typeinfo.cc (object_module): New variable.
	(make_frontend_typeinfo): Update signature.  Set temporary on
	generated TypeInfo classes.
	(create_tinfo_types): Set object_module.  Move generation of front-end
	typeinfo into ...
	(create_frontend_tinfo_types): ... New function.
	(layout_typeinfo): Call create_frontend_tinfo_types.
	(layout_classinfo): Likewise.
	(layout_cpp_typeinfo): Likewise.
	(create_typeinfo): Likewise.

From-SVN: r272345
2019-06-16 07:49:06 +00:00
Richard Biener f75d370110 toir.cc (pop_label): Only queue labels in a vector.
2019-06-11  Richard Biener  <rguenthe@suse.de>

	d/90778
	* toir.cc (pop_label): Only queue labels in a vector.
	(cmp_labels): Label decl comparator.
	(pop_binding_level): Pop labels in DECL_UID order to avoid
	debug info differences.

From-SVN: r272146
2019-06-11 08:30:47 +00:00
Nathan Sidwell 7daef9aceb [PATCH] Commonize anon-name generation
https://gcc.gnu.org/ml/gcc-patches/2019-05/msg01699.html
	* tree.h (IDENTIFIER_ANON_P): New.
	(anon_aggrname_format, anon_aggname_p): Don't declare.
	(make_anon_name): Declare.
	* lto-streamer-out.c (DFS::DFS_write_tree_body): Use IDENTIFIER_ANON_P.
	(hash_tree): Likewise.
	* tree-streamer-out.c (write_ts_decl_minimal_tree): Likewise.
	* tree.c (anon_aggrname_p, anon_aggrname_format): Delete.
	(anon_cnt, make_anon_name): New.

 	gcc/cp/
	* cp-tree.h (make_anon_name): Drop declaration.
	(TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
	* cp-lang.c (cxx_dwarf_name): Likewise.
	* class.c (find_flexarrays): Likewise.
	* decl.c (name_unnamed_type, xref_tag_1): Likewise.
	* error.c (dump_aggr_type): Likewise.
	* pt.c (push_template_decl_real): Likewise.
	* name-lookup.c (consider_binding_level): Likewise.
	(anon_cnt, make_anon_name): Delete.

	gcc/d/
	* types.cc (fixup_anonymous_offset): Use IDENTIFIER_ANON_P.
	(layout_aggregate_members): Use make_anon_name.

From-SVN: r271702
2019-05-28 13:31:16 +00:00
Martin Sebor a9c697b883 trans.c (check_inlining_for_nested_subprog): Quote reserved names.
gcc/ada/ChangeLog:

        * gcc-interface/trans.c (check_inlining_for_nested_subprog): Quote
        reserved names.

gcc/brig/ChangeLog:

        * brigfrontend/brig-control-handler.cc
        (brig_directive_control_handler::operator): Remove trailing newline
        from a diagnostic.
        * brigfrontend/brig-module-handler.cc
        (brig_directive_module_handler::operator): Remove a duplicated space
        from a diagnostic.

gcc/c/ChangeLog:

        * c-decl.c (start_decl): Quote keywords, operators, and
        types in diagnostics.
        (finish_decl): Same.
        * c-parser.c (c_parser_asm_statement): Same.
        (c_parser_conditional_expression): Same.
        (c_parser_transaction_cancel): Same.
        * c-typeck.c (c_common_type): Same.
        (build_conditional_expr): Same.
        (digest_init): Same.
        (process_init_element): Same.
        (build_binary_op): Same.

gcc/c-family/ChangeLog:

        * c-attribs.c (handle_no_sanitize_attribute): Quote identifiers,
        keywords, operators, and types in diagnostics.
        (handle_scalar_storage_order_attribute): Same.
        (handle_mode_attribute): Same.
        (handle_visibility_attribute): Same.
        (handle_assume_aligned_attribute): Same.
        (handle_no_split_stack_attribute): Same.
        * c-common.c (shorten_compare): Same.
        (c_common_truthvalue_conversion): Same.
        (cb_get_source_date_epoch): Same.
        * c-lex.c (cb_def_pragma): Quote keywords, operators, and types
        in diagnostics.
        (interpret_float): Same.
        * c-omp.c (c_finish_omp_for): Same.
        * c-opts.c (c_common_post_options): Same.
        * c-pch.c (c_common_pch_pragma): Same.
        * c-pragma.c (pop_alignment): Same.
        (handle_pragma_pack): Same.
        (apply_pragma_weak): Same.
        (handle_pragma_weak): Same.
        (handle_pragma_scalar_storage_order): Same.
        (handle_pragma_redefine_extname): Same.
        (add_to_renaming_pragma_list): Same.
        (maybe_apply_renaming_pragma): Same.
        (push_visibility): Same.
        (handle_pragma_visibility): Same.
        (handle_pragma_optimize): Same.
        (handle_pragma_message): Same.
        * c-warn.c (warn_for_omitted_condop): Same.
        (lvalue_error): Same.

gcc/cp/ChangeLog:

        * call.c (print_z_candidate): Wrap diagnostic text in a gettext
        macro.  Adjust.
        (print_z_candidates): Same.
        (build_conditional_expr_1): Quote keywords, operators, and types
        in diagnostics.
        (build_op_delete_call): Same.
        (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
        macro.
        (convert_like_real): Same.
        (convert_arg_to_ellipsis): Quote keywords, operators, and types
        in diagnostics.
        (build_over_call): Same.
        (joust): Break up an overlong line.  Wrap diagnostic text in a gettext
        macro.
        * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
        (cxx_eval_constant_expression): Quote keywords, operators, and types
        in diagnostics.
        (potential_constant_expression_1): Same.
        * cp-gimplify.c (cp_genericize_r): Same.
        * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
        in diagnostics.
        (type_promotes_to): Same.
        * decl.c (check_previous_goto_1): Same.
        (check_goto): Same.
        (start_decl): Same.
        (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
        (grok_op_properties): Quote keywords, operators, and types
        in diagnostics.
        * decl2.c (grokfield): Same.
        (coerce_delete_type): Same.
        * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
        * friend.c (do_friend): Quote C++ tokens.
        * init.c (build_new_1): Quote keywords, operators, and types
        in diagnostics.
        (build_vec_delete_1): Same.
        (build_delete): Same.
        * lex.c (parse_strconst_pragma): Same.
        (handle_pragma_implementation): Same.
        (unqualified_fn_lookup_error): Same.
        * mangle.c (write_type): Same.
        * method.c (defaulted_late_check): Avoid two consecutive punctuators.
        * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
        (pop_everything): Same.
        * parser.c (cp_lexer_start_debugging): Quote a macro name.
        in a diagnostic
        (cp_lexer_stop_debugging): Same.
        (cp_parser_userdef_numeric_literal): Quote a C++ header name
        in a diagnostic.
        (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
        and types in diagnostics.
        (cp_parser_question_colon_clause): Same.
        (cp_parser_asm_definition): Same.
        (cp_parser_init_declarator): Same.
        (cp_parser_template_declaration_after_parameters): Avoid capitalizing
        a sentence in a diagnostic.
        (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
        in diagnostics.
        (cp_parser_transaction): Same.
        * pt.c (maybe_process_partial_specialization): Replace second call
        to permerror with inform for consistency with other uses.
        (expand_integer_pack): Quote keywords, operators, and types
        in diagnostics.
        * rtti.c (get_typeid): Quote keywords, operators, and types
        in diagnostics.
        (build_dynamic_cast_1): Same.
        * semantics.c (finish_asm_stmt): Same.
        (finish_label_decl): Same.
        (finish_bases): Same.
        (finish_offsetof): Same.
        (cp_check_omp_declare_reduction): Same.
        (finish_decltype_type): Same.
        * tree.c (handle_init_priority_attribute): Same.  Add detail
        to diagnostics.
        (maybe_warn_zero_as_null_pointer_constant): Same.
        * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
        in diagnostics.
        (cp_build_unary_op): Same.
        (check_for_casting_away_constness): Same.
        (build_static_cast): Same.
        (build_const_cast_1): Same.
        (maybe_warn_about_returning_address_of_local): Same.
        (check_return_expr): Same.
        * typeck2.c (abstract_virtuals_error_sfinae): Same.
        (digest_init_r): Replace a tab with spaces in a diagnostic.
        (build_functional_cast): Quote keywords, operators, and types
        in diagnostics.

gcc/d/ChangeLog:

        * d-builtins.cc (d_init_builtins): Quote keywords, operators,
        and types in diagnostics.
        * d-codegen.cc (get_array_length): Same.  Replace can't with cannot.
        * d-convert.cc (convert_expr): Same.
        * d-frontend.cc (getTypeInfoType): Quote an option name in
        a diagnostic.
        * d-lang.cc (d_handle_option): Same.
        (d_parse_file): Same.
        * decl.cc: Remove a trailing period from a diagnostic.
        * expr.cc: Use a directive for an apostrophe.
        * toir.cc: Quote keywords, operators, and types in diagnostics.
        * typeinfo.cc (build_typeinfo): Quote an option name in a diagnostic.

gcc/fortran/ChangeLog:

	* gfortranspec.c (append_arg): Spell out the word "argument."

gcc/ChangeLog:

        * config/i386/i386-expand.c (get_element_number): Quote keywords
        and other internal names in diagnostics.  Adjust other diagnostic
        formatting issues noted by -Wformat-diag.
        * config/i386/i386-features.c
        (ix86_mangle_function_version_assembler_name): Same.
        * config/i386/i386-options.c (ix86_handle_abi_attribute): Same.
        * config/i386/i386.c (ix86_function_type_abi): Same.
        (ix86_function_ms_hook_prologue): Same.
        (classify_argument): Same.
        (ix86_expand_prologue): Same.
        (ix86_md_asm_adjust): Same.
        (ix86_memmodel_check): Same.

gcc/ChangeLog:

        * builtins.c (expand_builtin_atomic_always_lock_free): Quote
        identifiers, keywords, operators, and types in diagnostics.  Correct
        quoting, spelling, and sentence capitalization issues.
        (expand_builtin_atomic_is_lock_free): Same.
        (fold_builtin_next_arg): Same.
        * cfgexpand.c (expand_one_var): Same.
        (tree_conflicts_with_clobbers_p): Same.
        (expand_asm_stmt): Same.
        (verify_loop_structure): Same.
        * cgraphunit.c (process_function_and_variable_attributes): Same.
        * collect-utils.c (collect_execute): Same.
        * collect2.c (maybe_run_lto_and_relink): Same.
        (is_lto_object_file): Same.
        (scan_prog_file): Same.
        * convert.c (convert_to_real_1): Same.
        * dwarf2out.c (dwarf2out_begin_prologue): Same.
        * except.c (verify_eh_tree): Same.
        * gcc.c (execute): Same.
        (eval_spec_function): Same.
        (run_attempt): Same.
        (driver::set_up_specs): Same.
        (compare_debug_auxbase_opt_spec_function): Same.
        * gcov-tool.c (unlink_gcda_file): Same.
        (do_merge): Same.
        (do_rewrite): Same.
        * gcse.c (gcse_or_cprop_is_too_expensive): Same.
        * gimplify.c (gimplify_asm_expr): Same.
        (gimplify_adjust_omp_clauses): Same.
        * hsa-gen.c (gen_hsa_addr_insns): Same.
        (gen_hsa_insns_for_load): Same.
        (gen_hsa_cmp_insn_from_gimple): Same.
        (gen_hsa_insns_for_operation_assignment): Same.
        (gen_get_level): Same.
        (gen_hsa_alloca): Same.
        (omp_simple_builtin::generate): Same.
        (gen_hsa_atomic_for_builtin): Same.
        (gen_hsa_insns_for_call): Same.
        * input.c (dump_location_info): Same.
        * ipa-devirt.c (compare_virtual_tables): Same.
        * ira.c (ira_setup_eliminable_regset): Same.
        * lra-assigns.c (lra_assign): Same.
        * lra-constraints.c (lra_constraints): Same.
        * lto-streamer-in.c (lto_input_mode_table): Same.
        * lto-wrapper.c (get_options_from_collect_gcc_options): Same.
        (merge_and_complain): Same.
        (compile_offload_image): Same.
        (compile_images_for_offload_targets): Same.
        (debug_objcopy): Same.
        (run_gcc): Same.
        (main): Same.
        * opts.c (print_specific_help): Same.
        (parse_no_sanitize_attribute): Same.
        (print_help): Same.
        (handle_param): Same.
        * plugin.c (add_new_plugin): Same.
        (parse_plugin_arg_opt): Same.
        (try_init_one_plugin): Same.
        * print-rtl.c (debug_bb_n_slim): Quote identifiers, keywords,
        operators, and types in diagnostics.  Correct quoting and spelling
        issues.
        * read-rtl-function.c (parse_edge_flag_token): Same.
        (function_reader::parse_enum_value): Same.
        * reg-stack.c (check_asm_stack_operands): Same.
        * regcprop.c (validate_value_data): Same.
        * sched-rgn.c (make_pass_sched_fusion): Same.
        * stmt.c (check_unique_operand_names): Same.
        * targhooks.c (default_target_option_pragma_parse): Same.
        * tlink.c (recompile_files): Same.
        * toplev.c (process_options): Same.
        (do_compile): Same.
        * trans-mem.c (diagnose_tm_1): Same.
        (ipa_tm_scan_irr_block): Same.
        (ipa_tm_diagnose_transaction): Same.
        * tree-cfg.c (verify_address): Same.  Use get_tree_code_name to
        format a tree code name in a diagnostic.
        (verify_types_in_gimple_min_lval): Same.
        (verify_types_in_gimple_reference): Same.
        (verify_gimple_call): Same.
        (verify_gimple_assign_unary): Same.
        (verify_gimple_assign_binary): Same.
        (verify_gimple_assign_ternary): Same.
        (verify_gimple_assign_single): Same.
        (verify_gimple_switch): Same.
        (verify_gimple_label): Same.
        (verify_gimple_phi): Same.
        (verify_gimple_in_seq): Same.
        (verify_eh_throw_stmt_node): Same.
        (collect_subblocks): Same.
        (gimple_verify_flow_info): Same.
        (do_warn_unused_result): Same.
        * tree-inline.c (expand_call_inline): Same.
        * tree-into-ssa.c (update_ssa): Same.
        * tree.c (tree_int_cst_elt_check_failed): Same.
        (tree_vec_elt_check_failed): Same.
        (omp_clause_operand_check_failed): Same.
        (verify_type_variant): Same.
        (verify_type): Same.
        * value-prof.c (verify_histograms): Same.
        * varasm.c (assemble_start_function): Same.

gcc/lto/ChangeLog:

        * lto-dump.c (lto_main): Same.
        * lto.c (stream_out): Same.

gcc/objc/ChangeLog:

        * objc-act.c (objc_begin_catch_clause): Quote keywords and options
        in diagnostics.
        (objc_build_throw_stmt): Same.
        (objc_finish_message_expr): Same.
        (get_super_receiver): Same.
        * objc-next-runtime-abi-01.c (objc_next_runtime_abi_01_init): Spell
        out "less than" in English./
        * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Spell
        out "greater" in English.

gcc/testsuite/ChangeLog:

        * c-c++-common/Wbool-operation-1.c: Adjust text of expected diagnostics.
        * c-c++-common/Wvarargs-2.c: Same.
        * c-c++-common/Wvarargs.c: Same.
        * c-c++-common/pr51768.c: Same.
        * c-c++-common/tm/inline-asm.c: Same.
        * c-c++-common/tm/safe-1.c: Same.
        * g++.dg/asm-qual-1.C: Same.
        * g++.dg/asm-qual-3.C: Same.
        * g++.dg/conversion/dynamic1.C: Same.
        * g++.dg/cpp0x/constexpr-89599.C: Same.
        * g++.dg/cpp0x/constexpr-cast.C: Same.
        * g++.dg/cpp0x/constexpr-shift1.C: Same.
        * g++.dg/cpp0x/lambda/lambda-conv11.C: Same.
        * g++.dg/cpp0x/nullptr04.C: Same.
        * g++.dg/cpp0x/static_assert12.C: Same.
        * g++.dg/cpp0x/static_assert8.C: Same.
        * g++.dg/cpp1y/lambda-conv1.C: Same.
        * g++.dg/cpp1y/pr79393-3.C: Same.
        * g++.dg/cpp1y/static_assert1.C: Same.
        * g++.dg/cpp1z/constexpr-if4.C: Same.
        * g++.dg/cpp1z/constexpr-if5.C: Same.
        * g++.dg/cpp1z/constexpr-if9.C: Same.
        * g++.dg/eh/goto2.C: Same.
        * g++.dg/eh/goto3.C: Same.
        * g++.dg/expr/static_cast8.C: Same.
        * g++.dg/ext/flexary5.C: Same.
        * g++.dg/ext/utf-array-short-wchar.C: Same.
        * g++.dg/ext/utf-array.C: Same.
        * g++.dg/ext/utf8-2.C: Same.
        * g++.dg/gomp/loop-4.C: Same.
        * g++.dg/gomp/macro-4.C: Same.
        * g++.dg/gomp/udr-1.C: Same.
        * g++.dg/init/initializer-string-too-long.C: Same.
        * g++.dg/other/offsetof9.C: Same.
        * g++.dg/ubsan/pr63956.C: Same.
        * g++.dg/warn/Wbool-operation-1.C: Same.
        * g++.dg/warn/Wtype-limits-Wextra.C: Same.
        * g++.dg/warn/Wtype-limits.C: Same.
        * g++.dg/wrappers/pr88680.C: Same.
        * g++.old-deja/g++.mike/eh55.C: Same.
        * gcc.dg/Wsign-compare-1.c: Same.
        * gcc.dg/Wtype-limits-Wextra.c: Same.
        * gcc.dg/Wtype-limits.c: Same.
        * gcc.dg/Wunknownprag.c: Same.
        * gcc.dg/Wunsuffixed-float-constants-1.c: Same.
        * gcc.dg/asm-6.c: Same.
        * gcc.dg/asm-qual-1.c: Same.
        * gcc.dg/cast-1.c: Same.
        * gcc.dg/cast-2.c: Same.
        * gcc.dg/cast-3.c: Same.
        * gcc.dg/cpp/source_date_epoch-2.c: Same.
        * gcc.dg/debug/pr85252.c: Same.
        * gcc.dg/dfp/cast-bad.c: Same.
        * gcc.dg/format/gcc_diag-1.c: Same.
        * gcc.dg/format/gcc_diag-11.c: Same.New test.
        * gcc.dg/gcc_diag-11.c: Same.New test.
        * gcc.dg/gnu-cond-expr-2.c: Same.
        * gcc.dg/gnu-cond-expr-3.c: Same.
        * gcc.dg/gomp/macro-4.c: Same.
        * gcc.dg/init-bad-1.c: Same.
        * gcc.dg/init-bad-2.c: Same.
        * gcc.dg/init-bad-3.c: Same.
        * gcc.dg/pr27528.c: Same.
        * gcc.dg/pr48552-1.c: Same.
        * gcc.dg/pr48552-2.c: Same.
        * gcc.dg/pr59846.c: Same.
        * gcc.dg/pr61096-1.c: Same.
        * gcc.dg/pr8788-1.c: Same.
        * gcc.dg/pr90082.c: Same.
        * gcc.dg/simd-2.c: Same.
        * gcc.dg/spellcheck-params-2.c: Same.
        * gcc.dg/spellcheck-params.c: Same.
        * gcc.dg/strlenopt-49.c: Same.
        * gcc.dg/tm/pr52141.c: Same.
        * gcc.dg/torture/pr51106-1.c: Same.
        * gcc.dg/torture/pr51106-2.c: Same.
        * gcc.dg/utf-array-short-wchar.c: Same.
        * gcc.dg/utf-array.c: Same.
        * gcc.dg/utf8-2.c: Same.
        * gcc.dg/warn-sprintf-no-nul.c: Same.
        * gcc.target/i386/asm-flag-0.c: Same.
        * gcc.target/i386/inline_error.c: Same.
        * gcc.target/i386/pr30848.c: Same.
        * gcc.target/i386/pr39082-1.c: Same.
        * gcc.target/i386/pr39678.c: Same.
        * gcc.target/i386/pr57756.c: Same.
        * gcc.target/i386/pr68843-1.c: Same.
        * gcc.target/i386/pr79804.c: Same.
        * gcc.target/i386/pr82673.c: Same.
        * obj-c++.dg/class-protocol-1.mm: Same.
        * obj-c++.dg/exceptions-3.mm: Same.
        * obj-c++.dg/exceptions-4.mm: Same.
        * obj-c++.dg/exceptions-5.mm: Same.
        * obj-c++.dg/exceptions-6.mm: Same.
        * obj-c++.dg/method-12.mm: Same.
        * obj-c++.dg/method-13.mm: Same.
        * obj-c++.dg/method-6.mm: Same.
        * obj-c++.dg/method-7.mm: Same.
        * obj-c++.dg/method-9.mm: Same.
        * obj-c++.dg/method-lookup-1.mm: Same.
        * obj-c++.dg/proto-lossage-4.mm: Same.
        * obj-c++.dg/protocol-qualifier-2.mm: Same.
        * objc.dg/call-super-2.m: Same.
        * objc.dg/class-protocol-1.m: Same.
        * objc.dg/desig-init-1.m: Same.
        * objc.dg/exceptions-3.m: Same.
        * objc.dg/exceptions-4.m: Same.
        * objc.dg/exceptions-5.m: Same.
        * objc.dg/exceptions-6.m: Same.
        * objc.dg/method-19.m: Same.
        * objc.dg/method-2.m: Same.
        * objc.dg/method-5.m: Same.
        * objc.dg/method-6.m: Same.
        * objc.dg/method-7.m: Same.
        * objc.dg/method-lookup-1.m: Same.
        * objc.dg/proto-hier-1.m: Same.
        * objc.dg/proto-lossage-4.m: Same.

From-SVN: r271338
2019-05-17 11:55:43 -06:00
Johannes Pfau cecd06a9ea D: Do not add target_libs if phobos is disabled
From-SVN: r270571
2019-04-25 11:22:27 +00:00
Iain Buclaw 130cc10e21 libphobos: Add D support for S/390 Linux
gcc/d/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
	    Robin Dapp  <rdapp@linux.ibm.com>

	* typeinfo.cc (create_typeinfo): Write typeinfo flags as uint.

gcc/testsuite/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
	    Robin Dapp  <rdapp@linux.ibm.com>

	* gdc.dg/link.d: Test if target d_runtime.
	* gdc.dg/runnable.d: Fix tests to work on BigEndian.
	* gdc.dg/simd.d: Likewise.

libphobos/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
	    Robin Dapp  <rdapp@linux.ibm.com>

	* configure.tgt: Add s390*-linux* as a supported target.
	* libdruntime/gcc/sections/elf_shared.d: import gcc.builtins.
	(__tls_get_addr_internal): Declare.
	(TLS_DTV_OFFSET): Define as zero on SystemZ.
	(getTLSRange): Support getting TLS on SystemZ.
	* testsuite/libphobos.typeinfo/struct-align.d: New test.

Co-Authored-By: Robin Dapp <rdapp@linux.ibm.com>

From-SVN: r270523
2019-04-23 22:53:25 +00:00
Iain Buclaw c0aebc60b2 d: Add support for compiling without libphobos library.
Merges upstream dmd 3b3dca8be

Reviewed-on: https://github.com/dlang/dmd/pull/9678

gcc/d/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-builtins.cc (d_init_versions): Add D_BetterC, D_ModuleInfo,
	D_Exceptions, D_TypeInfo as predefined version conditions.
	* d-codegen.cc (build_bounds_condition): Generate trap if D asserts
	are turned off.
	* d-frontend.cc (getTypeInfoType): Add error when -fno-rtti is set.
	* d-lang.cc (d_init_options): Initialize new front-end options.
	(d_handle_option): Handle -fdruntime, -fexceptions, and -frtti.
	(d_post_options): Turn off D runtime features if -fno-druntime is set.
	* d-spec.cc (lang_specific_driver): Handle -fdruntime.
	* d-tree.h (have_typeinfo_p): Add prototype.
	(build_typeinfo): Update prototype.
	* decl.cc (DeclVisitor::visit(StructDeclaration)): Create typeinfo
	only if TypeInfo exists.
	(DeclVisitor::visit(ClassDeclaration)): Likewise.
	(DeclVisitor::visit(InterfaceDeclaration)): Likewise.
	(DeclVisitor::visit(EnumDeclaration)): Likewise.
	* expr.cc: Update all calls to build_typeinfo.
	* gdc.texi (Runtime Options): Document -fdruntime and -frtti.
	* lang.opt: Add -fdruntime and -frtti.
	* modules.cc (build_module_tree): Create module info only if
	ModuleInfo exists.
	* toir.cc (IRVisitor::visit(ThrowStatement)): Update test for
	-fno-exceptions.
	* typeinfo.cc (create_tinfo_types): Build internal typeinfo classes
	only if Object exists.
	(have_typeinfo_p): New function.
	(class TypeInfoVisitor): Update all calls to build_typeinfo.
	(build_typeinfo): Add error when -fno-rtti is set.

gcc/testsuite/ChangeLog:

2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>

	* gdc.test/fail_compilation/fail2456.d: New test.
	* gdc.test/fail_compilation/test18312.d: New test.
	* gdc.test/gdc-test.exp (gdc-convert-args): Handle -betterC.

From-SVN: r270518
2019-04-23 20:08:46 +00:00
Iain Buclaw e64deb7447 d: Use semanticRun to prevent declaration pass from running multiple times.
This shouldn't happen during normal traversal of the AST provided from
the front-end, however as there are some cases where declarations need
to be visited out of order, such as what is being done in PR d/89017, it
then becomes necessary to guard against this.

gcc/d/ChangeLog:

2019-04-21  Iain Buclaw  <ibuclaw@gdcproject.org>

	* decl.cc (DeclVisitor::visit(Import)): Set semanticRun after
	completion, guard against being called more than once.
	(DeclVisitor::visit(StructDeclaration)): Likewise.
	(DeclVisitor::visit(ClassDeclaration)): Likewise.
	(DeclVisitor::visit(InterfaceDeclaration)): Likewise.
	(DeclVisitor::visit(VarDeclaration)): Likewise.
	(DeclVisitor::visit(TypeInfoDeclaration)): Likewise.

From-SVN: r270478
2019-04-21 07:03:32 +00:00
Iain Buclaw f452f0d67f d: Ensure all unittests are registered against the original module.
As any unittest functions registered against the testing module when
compiling with -fbuilding-libphobos-tests are ignored during the
generation of the ModuleInfo data.

gcc/d/ChangeLog:

2019-04-21  Iain Buclaw  <ibuclaw@gdcproject.org>

	* modules.cc (register_module_decl): Don't register unittests against
	the ModuleInfo symbol for -fbuilding-libphobos-tests.

From-SVN: r270477
2019-04-21 07:03:22 +00:00
Iain Buclaw 347ef24548 d: Fix the build on hosts missing _MAX and _MAX macros.
gcc/d/ChangeLog:

2019-04-17  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-system.h (POSIX): Define unix as POSIX.
	(INT32_MAX, INT32_MIN, INT64_MIN, UINT32_MAX, UINT64_MAX): Provide
	fallback definitions.

From-SVN: r270403
2019-04-17 06:02:01 +00:00
Iain Buclaw 460ad044bc d: Use build_exeext suffix for D generator programs.
Updated build and invocation of idgen and impcnvgen, ensuring that they
are removed when cleaning the build directory.

Added BUILD_LIBDEPS on the link command for the generator programs as
well, which is necessary when the system installed compiler is not GCC.

gcc/d/ChangeLog:

2019-04-16  Iain Buclaw  <ibuclaw@gdcproject.org>

	* Make-lang.in (d.mostyclean): Clean idgen and impcnvgen.
	(d/idgen): Rename to d/idgen$(build_exeext), add BUILD_LIBDEPS.
	(d/impcnvgen): Rename to d/impcnvgen$(build_exeext), add
	BUILD_LIBDEPS.
	(d/id.c): Call idgen$(build_exeext).
	(d/impcnvtab.c): Call impcnvgen$(build_exeext).

From-SVN: r270397
2019-04-16 21:16:43 +00:00
Johannes Pfau 4d024c3269 PR d/87799 Fix D build on windows hosts
PR d/87799
* d-system.h (_mkdir): Forward _mkdir on MinGW to mkdir in system.h.
* configure.ac: Remove d from unsupported languages on mingw and cygwin.
* configure: Regenerate.

From-SVN: r270349
2019-04-14 09:52:22 +00:00
Iain Buclaw c50eadba26 d: Add -fbuilding-libphobos-tests option
Currently, the druntime and phobos unittests are compiled as a separate
check program, then ran by the libphobos.unittest/unittest.exp script.
As PR d/89255 notes, this process lacks proper multilib handling.

As a first step, a new internal option that instructs the compiler to
put the reference to all unittest functions in another symbol has been
added.  This will allow each module to be compiled separately as a
standalone program using dg-runtest without running into collisions in
the D runtime module registry.

gcc/d/ChangeLog:

2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-tree.h (DECL_IN_UNITTEST_CONDITION_P): Define.
	* decl.cc (DeclVisitor): Add in_version_unittest_ field.
	(DeclVisitor::visit(ConditionalDeclaration)): New override.
	(DeclVisitor::visit(FuncDeclaration)): Set
	DECL_IN_UNITTEST_CONDITION_P.
	* lang.opt (-fbuilding-libphobos-tests): Add option.
	* modules.cc (current_testing_module): New static variable.
	(build_module_tree): Generate second moduleinfo symbol to hold
	reference to unittests if flag_building_libphobos_tests.
	(register_module_decl): Check DECL_IN_UNITTEST_CONDITION_P to decide
	which moduleinfo the decl should be registered against.

From-SVN: r270301
2019-04-12 06:25:04 +00:00
Iain Buclaw 1605fb3ed0 d: Fix run-time SIGSEGV reading ModuleInfo.flags()
The current forced alignment is not necessary, and is problematic on
targets that have strict alignment rules.

gcc/d/ChangeLog:

2019-03-31  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/88462
	* modules.cc (layout_moduleinfo_fields): Properly align ModuleInfo,
	instead of forcing alignment to be 1.

From-SVN: r270043
2019-03-31 14:34:41 +00:00
Iain Buclaw 9dddefefdf d: Fix ICE force_type_die, at dwarf2out.c using nested types
In functions whose return type is instantiated from a nested template,
make sure that all members of the instance are emitted before finishing
the outer function, otherwise they will be removed during the
prune_unused_types pass.

gcc/d/ChangeLog:

2019-03-21  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/89017
	* d-codegen.cc (d_decl_context): Skip over template instances when
	finding the context.
	* decl.cc (DeclVisitor::visit(TemplateDeclaration)): New override.
	(build_type_decl): Include parameters in name of template types.

gcc/testsuite/ChangeLog:

2019-03-21  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/89017
	* gdc.dg/pr89017.d: New test.

From-SVN: r269828
2019-03-20 23:52:48 +00:00
Iain Buclaw b9da027866 d/dmd: Merge upstream dmd 19b1454b5
Backports fixes for many ICEs that occurred when using the vector .array
property in both CTFE and code generation passes.

Fixes https://gcc.gnu.org/PR88957

Reviewed-on: https://github.com/dlang/dmd/pull/9438

gcc/d/ChangeLog:

2019-03-13  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/88957
	* expr.cc (ExprVisitor::visit(VectorArrayExp)): New override.

gcc/testsuite/ChangeLog:

2019-03-13  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/88957
	* gdc.dg/pr88957.d: New test.
	* gdc.dg/simd.d: Add new vector tests.

From-SVN: r269627
2019-03-12 23:10:49 +00:00
Iain Buclaw 8451f4a52e Use libiberty's lrealpath to avoid portability problems.
The dmd front-end function FileName::canonicalName could be called
during the semantic pass of import("file") expressions, so still
requires that realpath() be redefined.

Initial patch by Rainer Orth.

gcc/d/ChangeLog:

2019-03-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/87866
	* d-system.h (realpath): Redefine as lrealpath.

From-SVN: r269619
2019-03-12 16:31:48 +00:00
Iain Buclaw c9634470ba d/dmd: Merge upstream dmd 7423993c9
Fixes C++ mangling for substituted basic types that are target-specific.
Introduces a new method that currently does nothing, but could in future
make use of flag_abi_version as extern(C++) integration improves in
latter versions of the D front-end.

Reviewed-on: https://github.com/dlang/dmd/pull/9439

gcc/d/ChangeLog:

2019-03-12  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-lang.cc (d_init_options): Set global.params.cplusplus to C++14.
	* d-target.cc (Target::cppFundamentalType): New method.

From-SVN: r269611
2019-03-12 13:29:16 +00:00
Iain Buclaw 9fa5d5de36 d: Fix ICE in get_frame_for_symbol
When generating code for a non-nested delegate literal, there is no
context pointer required to pass to the function.

2019-03-09  Iain Buclaw  <ibuclaw@gdcproject.org>

gcc/d/
	PR d/89041
	* d-codegen.cc (get_frame_for_symbol): Delegate literals defined in
	global scope don't have a frame pointer.

gcc/testsuite/
	PR d/89041
	* gdc.dg/pr89041.d: New test.

From-SVN: r269533
2019-03-09 19:29:29 +00:00
Iain Buclaw 9503d7b1ff d/dmd: Merge dmd upstream ed71446aa
Backports support for extern(C++, "namespace"), which makes the
core.stdcpp package compilable.

Added predefined condition for CppRuntime_Gcc unconditionally, as it is
unlikely that D code will be linking to anything other than libstdc++
when extern(C++) is used.

Reviewed-on: https://github.com/dlang/dmd/pull/9371

gcc/d/ChangeLog:

2019-03-01  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-builtins.cc (d_init_versions): Add CppRuntime_Gcc as predefined
	version condition.

From-SVN: r269304
2019-03-01 10:21:54 +00:00
Maya Rashish 2f2b8e4054 Add netbsd support for D compiler and runtime
Merges upstream druntime fb4bda91.

2019-02-14  Maya Rashish  <coypu@sdf.org>

gcc/ChangeLog:

	* config.gcc (*-*-netbsd*): Add netbsd-d.o
	* config/netbsd-d.c: New file.
	* config/t-netbsd: Add netbsd-d.o

gcc/d/ChangeLog:

	* d-system.h: NetBSD is POSIX.

libphobos/ChangeLog:

	* configure.tgt: Add netbsd/x86 as supported target.

From-SVN: r268905
2019-02-14 21:25:39 +00:00
Rainer Orth 0b6e3127e8 Provide __start_minfo/__stop_minfo for linkers that don't (PR d/87864)
libphobos:
	PR d/87864
	* configure.ac (DRTSTUFF_SPEC): New variable.
	Substitute it.
	* libdruntime/m4/druntime/os.m4 (DRUNTIME_OS_MINFO_BRACKETING):
	New automake conditional.
	* configure: Regenerate.
	* libdruntime/gcc/drtstuff.c: New file.
	* libdruntime/Makefile.am [!DRUNTIME_OS_MINFO_BRACKETING]
	(DRTSTUFF, toolexeclib_DATA): New variables.
	(gcc/drtbegin.lo, gcc/drtend.lo): New rules.
	(libgdruntime_la_LDFLAGS): Use -Wc instead of -Xcompiler.
	Add -dstartfiles -B../src -Bgcc.
	(libgdruntime_la_DEPENDENCIES): New variable.
	(unittest_static_LDFLAGS): Use -Wc instead of -Xcompiler.
	(libgdruntime_t_la_LDFLAGS): Likewise.
	(unittest_LDFLAGS): Likewise.
	* src/Makefile.am (libgphobos_la_LDFLAGS): Use -Wc instead of
	-Xcompiler.
	Add -dstartfiles -B../libdruntime/gcc.
	(unittest_static_LDFLAGS): Use -Wc instead of -Xcompiler.
	(libgphobos_t_la_LDFLAGS): Likewise.
	(unittest_LDFLAGS): Likewise.
	* libdruntime/Makefile.in, src/Makefile.in: Regenerate.
	* Makefile.in, testsuite/Makefile.in: Regenerate.
	* libdruntime/rt/sections_elf_shared.d (Minfo_Bracketing): Don't
	assert.
	* libdruntime/gcc/config.d.in (Minfo_Bracketing): Remove.
	* src/drtstuff.spec: New file.
	* src/libgphobos.spec.in (DRTSTUFF_SPEC): Substitute.
	(*lib): Only pass SPEC_PHOBOS_DEPS without -debuglib, -defaultlib,
	-nophoboslib.
	* testsuite/testsuite_flags.in <--gdcldflags> (GDCLDFLAGS): Add
	-B${BUILD_DIR}/libdruntime/gcc.

	gcc/d:
	PR d/87864
	* lang.opt (dstartfiles): New option.
	* d-spec.cc (need_spec): New variable.
	(lang_specific_driver) <OPT_dstartfiles>: Enable need_spec.
	(lang_specific_pre_link): Also load libgphobos.spec if need_spec.

	gcc/testsuite:
	PR d/87864
	* lib/gdc.exp (gdc_link_flags): Add path to drtbegin.o/drtend.o if
	present.

From-SVN: r268886
2019-02-14 17:47:49 +00:00
Iain Buclaw e4e13e2610 Fix ICE when handling void initialized manifest constants.
gcc/d/ChangeLog:

2019-01-26  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/89042
	* decl.cc (DeclVisitor::visit(VarDeclaration)): Don't assert if
	handling a void initialized manifest constant.

gcc/testsuite/ChangeLog:

2019-01-26  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/89042
	* gdc.dg/pr89042a.d: New test.
	* gdc.dg/pr89042b.d: New test.

From-SVN: r268304
2019-01-26 21:07:15 +00:00
Iain Buclaw 255b2d916e Merge dmd upstream 180465274
Reduces the memory footprint of the CTFE interpreter by replacing new
with emplacement new in many places.

gcc/d/ChangeLog:

2019-01-21  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-frontend.cc (Compiler::paintAsType): Update for new signature.

From-SVN: r268124
2019-01-21 21:16:06 +00:00
Iain Buclaw 49686677ed [D] Don't predefine GNU_StackGrowsDown on every target.
Every back-end defines STACK_GROWS_DOWNWARD, the condition should
instead be  checking whether it was defined as 1 or 0.

gcc/d/ChangeLog:

2019-01-20  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-builtins.cc (d_init_versions): Check value of
	STACK_GROWS_DOWNWARD.

From-SVN: r268106
2019-01-20 18:53:13 +00:00
Iain Buclaw 5bdebb51a6 [D] Fix identity comparison for structs with complex float fields.
gcc/d/ChangeLog:

2019-01-20  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-codegen.cc (identity_compare_p): Return false if seen built-in
	type with padding.
	(build_float_identity): Moved here from expr.cc.
	(lower_struct_comparison): Handle real and complex types.
	* d-tree.h (build_float_identity): New.
	* expr.cc (build_float_identity): Move to d-codegen.cc.

gcc/testsuite/ChangeLog:

2019-01-20  Iain Buclaw  <ibuclaw@gdcproject.org>

	* gdc.dg/runnable.d: Add more tests for comparing complex types.

From-SVN: r268104
2019-01-20 12:55:38 +00:00
Johannes Pfau 70d87497e7 [D] Fix IdentityExp comparison for complex floats.
gcc/d/ChangeLog:

2019-01-20  Johannes Pfau  <johannespfau@gmail.com>

	* expr.cc (build_float_identity): New function.
	(ExprVisitor::visit(IdentityExp)): Add support for complex types.

gcc/testsuite/ChangeLog:

2019-01-20  Johannes Pfau  <johannespfau@gmail.com>

	* gdc.dg/runnable.d: Add tests for comparing complex types.

From-SVN: r268103
2019-01-20 12:15:47 +00:00
Iain Buclaw e42589bd62 [D] Fix failing EH execution test on i386.
Turn off partitioning unless it was explicitly requested, as it doesn't
work with D exception chaining, where personality routines use LSDA to
determine whether two thrown exceptions are in the same context.

The following distills what was failing in the D testsuite.
```
try {
  try {
    fn();  // throws "1"
  }
  finally {
    throw new Exception("2");
  }
}
catch (Exception e) {
  assert(e.msg == "1");
  assert(e.next.msg == "2");
}
```

gcc/d/ChangeLog:

	PR d/87824
	* d-lang.cc (d_post_options): Disable implicit
	-forder-blocks-and-partition.

From-SVN: r267985
2019-01-16 20:40:21 +00:00
Iain Buclaw 5e95646e73 [D] Move building of typeof(null) values to a common function.
gcc/d/ChangeLog:

	* d-codegen.cc (build_typeof_null_value): New function.
	* d-tree.h (build_typeof_null_value): Declare.
	* d-convert.cc (convert_expr): Use build_typeof_null_value.
	* expr.cc (ExprVisitor::visit(NullExp)): Likewise.

From-SVN: r267955
2019-01-15 23:02:43 +00:00
Richard Sandiford 99063eeecb PR inline-asm/52813 revisited
The original patch for this PR made it an error to list the stack
pointer in the clobber list of an inline asm.  However, the general
feeling seemed to be that going straight to a hard error was too harsh,
since there's quite a bit of existing code that has the clobber.

This patch implements the compromise discussed on IRC of making it
a -Wdeprecated warning instead.

2019-01-15  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR inline-asm/52813
	* doc/extend.texi: Document that listing the stack pointer in the
	clobber list of an asm is a deprecated feature.
	* common.opt (Wdeprecated): Moved from c-family/c.opt.
	* cfgexpand.c (asm_clobber_reg_is_valid): Issue a -Wdeprecated
	warning instead of an error for clobbers of the stack pointer.
	Add a note explaining why.

gcc/c-family/
	PR inline-asm/52813
	* c.opt (Wdeprecated): Move documentation and variable to common.opt.

gcc/d/
	PR inline-asm/52813
	* lang.opt (Wdeprecated): Reference common.opt instead of c.opt.

gcc/testsuite/
	PR inline-asm/52813
	* gcc.target/i386/pr52813.c (test1): Turn the diagnostic into a
	-Wdeprecated warning and expect a following note:.

From-SVN: r267941
2019-01-15 16:46:54 +00:00
Iain Buclaw 865f11b619 Document merge process for dmd, druntime and phobos.
gcc/d/ChangeLog:

	* README.gcc: New file.

libphobos/ChangeLog:

	* README.gcc: New file.

From-SVN: r267885
2019-01-12 19:50:41 +00:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Jakub Jelinek 3f27508ce4 gcc.c (process_command): Update copyright notice dates.
* gcc.c (process_command): Update copyright notice dates.
	* gcov-dump.c (print_version): Ditto.
	* gcov.c (print_version): Ditto.
	* gcov-tool.c (print_version): Ditto.
	* gengtype.c (create_file): Ditto.
	* doc/cpp.texi: Bump @copying's copyright year.
	* doc/cppinternals.texi: Ditto.
	* doc/gcc.texi: Ditto.
	* doc/gccint.texi: Ditto.
	* doc/gcov.texi: Ditto.
	* doc/install.texi: Ditto.
	* doc/invoke.texi: Ditto.
gcc/fortran/
	* gfortranspec.c (lang_specific_driver): Update copyright notice
	dates.
	* gfc-internals.texi: Bump @copying's copyright year.
	* gfortran.texi: Ditto.
	* intrinsic.texi: Ditto.
	* invoke.texi: Ditto.
gcc/go/
	* gccgo.texi: Bump @copyrights-go year.
gcc/ada/
 	* gnat_ugn.texi: Bump @copying's copyright year.
 	* gnat_rm.texi: Likewise.
gcc/d/
	* gdc.texi: Bump @copyrights-d year.
libitm/
	* libitm.texi: Bump @copying's copyright year.
libgomp/
	* libgomp.texi: Bump @copying's copyright year.
libquadmath/
	* libquadmath.texi: Bump @copying's copyright year.

From-SVN: r267492
2019-01-01 12:34:49 +01:00
Iain Buclaw bed5ed7105 re PR d/87866 (gdc fails to compile minimal test)
gcc/d/ChangeLog:

2018-11-24  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/87866
	* d-incpath.cc (add_globalpaths): Use lrealpath to get canonical name.
	(add_filepaths): Likewise.

From-SVN: r266429
2018-11-24 09:51:03 +00:00
Iain Buclaw d7815fc450 Fix wrong alignment returned by .alignof property.
The D language expects the value to be the minimum alignment required
for the type, not the preferred alignment.

gcc/d/ChangeLog:

2018-11-17  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/87824
	* d-target.cc (Target::alignsize): Return min_align_of_type.

From-SVN: r266234
2018-11-17 11:01:00 +00:00
Iain Buclaw f9ab59ffe7 Merge dmd upstream 6243fa6d2
This introduces a new header that pulls in system includes for use only
in the DMD front-end part of the compiler, fixing up uses of problematic
functions that are prevalent throughout the code.

Commits merged from dmd.

    Fix build of the D frontend on the Hurd and KFreeBSD.
    Initial patch from Matthias Klose.
    https://github.com/dlang/dmd/pull/8893

    Don't care about D/C++ compatibility in C++ port.
    Fixes build error in https://gcc.gnu.org/PR87788
    https://github.com/dlang/dmd/pull/8895

    Allow compiling front-end headers with strict warnings.
    https://github.com/dlang/dmd/pull/8909

    Add root/system.h header for wrapping system includes.
    Fixes https://gcc.gnu.org/PR87865
    https://github.com/dlang/dmd/pull/8910

    Move checkedint to dmd/root.
    https://github.com/dlang/dmd/pull/8912

    Use rmem instead of libc for malloc() and strdup().
    https://github.com/dlang/dmd/pull/8913

    Use align(8) for alignment of UnionExp, fixing several BUS errors
    due to alignment issues on SPARC.
    https://github.com/dlang/dmd/pull/8914

    Don't pass NULL pointer as format parameter to errorSupplemental.
    https://github.com/dlang/dmd/pull/8916

gcc/d/ChangeLog:

2018-11-05  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/87865
	* d-system.h: New file.

From-SVN: r265780
2018-11-04 23:34:44 +00:00
Jakub Jelinek 5de9d93189 re PR d/87824 (x86_64-linux multilib issues)
PR d/87824
	* lang.opt (Wpsabi): New option.

	* gdc.dg/simd.d: Add -Wno-psabi.
	* gdc.dg/compilable.d: Likewise.

From-SVN: r265713
2018-11-01 12:14:08 +01:00
Iain Buclaw 4911c15c97 Fix profiledbootstrap when D is enabled
gcc/d/ChangeLog:

2018-10-31  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/87825
	* Make-lang.in (d/idgen) Link with BUILD_LINKERFLAGS.
	(d/impcvgen): Likewise.

From-SVN: r265702
2018-10-31 21:48:52 +00:00
Iain Buclaw b4c522fabd Add D front-end, libphobos library, and D2 testsuite.
ChangeLog:

	* Makefile.def (target_modules): Add libphobos.
	(flags_to_pass): Add GDC, GDCFLAGS, GDC_FOR_TARGET and
	GDCFLAGS_FOR_TARGET.
	(dependencies): Make libphobos depend on libatomic, libbacktrace
	configure, and zlib configure.
	(language): Add language d.
	* Makefile.in: Rebuild.
	* Makefile.tpl (BUILD_EXPORTS): Add GDC and GDCFLAGS.
	(HOST_EXPORTS): Add GDC.
	(POSTSTAGE1_HOST_EXPORTS): Add GDC and GDC_FOR_BUILD.
	(BASE_TARGET_EXPORTS): Add GDC.
	(GDC_FOR_BUILD, GDC, GDCFLAGS): New variables.
	(GDC_FOR_TARGET, GDC_FLAGS_FOR_TARGET): New variables.
	(EXTRA_HOST_FLAGS): Add GDC.
	(STAGE1_FLAGS_TO_PASS): Add GDC.
	(EXTRA_TARGET_FLAGS): Add GDC and GDCFLAGS.
	* config-ml.in: Treat GDC and GDCFLAGS like other compiler/flag
	environment variables.
	* configure: Rebuild.
	* configure.ac: Add target-libphobos to target_libraries.  Set and
	substitute GDC_FOR_BUILD and GDC_FOR_TARGET.

config/ChangeLog:

	* multi.m4: Set GDC.

gcc/ChangeLog:

	* Makefile.in (tm_d_file_list, tm_d_include_list): New variables.
	(TM_D_H, D_TARGET_DEF, D_TARGET_H, D_TARGET_OBJS): New variables.
	(tm_d.h, cs-tm_d.h, default-d.o): New rules.
	(d/d-target-hooks-def.h, s-d-target-hooks-def-h): New rules.
	(s-tm-texi): Also check timestamp on d-target.def.
	(generated_files): Add TM_D_H and d-target-hooks-def.h.
	(build/genhooks.o): Also depend on D_TARGET_DEF.
	* config.gcc (tm_d_file, d_target_objs, target_has_targetdm): New
	variables.
	* config/aarch64/aarch64-d.c: New file.
	* config/aarch64/aarch64-linux.h (GNU_USER_TARGET_D_CRITSEC_SIZE):
	Define.
	* config/aarch64/aarch64-protos.h (aarch64_d_target_versions): New
	prototype.
	* config/aarch64/aarch64.h (TARGET_D_CPU_VERSIONS): Define.
	* config/aarch64/t-aarch64 (aarch64-d.o): New rule.
	* config/arm/arm-d.c: New file.
	* config/arm/arm-protos.h (arm_d_target_versions): New prototype.
	* config/arm/arm.h (TARGET_D_CPU_VERSIONS): Define.
	* config/arm/linux-eabi.h (EXTRA_TARGET_D_OS_VERSIONS): Define.
	* config/arm/t-arm (arm-d.o): New rule.
	* config/default-d.c: New file.
	* config/glibc-d.c: New file.
	* config/gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
	* config/i386/i386-d.c: New file.
	* config/i386/i386-protos.h (ix86_d_target_versions): New prototype.
	* config/i386/i386.h (TARGET_D_CPU_VERSIONS): Define.
	* config/i386/linux-common.h (EXTRA_TARGET_D_OS_VERSIONS): Define.
	(GNU_USER_TARGET_D_CRITSEC_SIZE): Define.
	* config/i386/t-i386 (i386-d.o): New rule.
	* config/kfreebsd-gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
	* config/kopensolaris-gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
	* config/linux-android.h (ANDROID_TARGET_D_OS_VERSIONS): Define.
	* config/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
	* config/mips/linux-common.h (EXTRA_TARGET_D_OS_VERSIONS): Define.
	* config/mips/mips-d.c: New file.
	* config/mips/mips-protos.h (mips_d_target_versions): New prototype.
	* config/mips/mips.h (TARGET_D_CPU_VERSIONS): Define.
	* config/mips/t-mips (mips-d.o): New rule.
	* config/powerpcspe/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
	* config/powerpcspe/linux64.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
	* config/powerpcspe/powerpcspe-d.c: New file.
	* config/powerpcspe/powerpcspe-protos.h (rs6000_d_target_versions):
	New prototype.
	* config/powerpcspe/powerpcspe.c (rs6000_output_function_epilogue):
	Support GNU D by using 0 as the language type.
	* config/powerpcspe/powerpcspe.h (TARGET_D_CPU_VERSIONS): Define.
	* config/powerpcspe/t-powerpcspe (powerpcspe-d.o): New rule.
	* config/riscv/riscv-d.c: New file.
	* config/riscv/riscv-protos.h (riscv_d_target_versions): New
	prototype.
	* config/riscv/riscv.h (TARGET_D_CPU_VERSIONS): Define.
	* config/riscv/t-riscv (riscv-d.o): New rule.
	* config/rs6000/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
	* config/rs6000/linux64.h (GNU_USER_TARGET_D_OS_VERSIONS): Define.
	* config/rs6000/rs6000-d.c: New file.
	* config/rs6000/rs6000-protos.h (rs6000_d_target_versions): New
	prototype.
	* config/rs6000/rs6000.c (rs6000_output_function_epilogue):
	Support GNU D by using 0 as the language type.
	* config/rs6000/rs6000.h (TARGET_D_CPU_VERSIONS): Define.
	* config/rs6000/t-rs6000 (rs6000-d.o): New rule.
	* config/s390/s390-d.c: New file.
	* config/s390/s390-protos.h (s390_d_target_versions): New prototype.
	* config/s390/s390.h (TARGET_D_CPU_VERSIONS): Define.
	* config/s390/t-s390 (s390-d.o): New rule.
	* config/sparc/sparc-d.c: New file.
	* config/sparc/sparc-protos.h (sparc_d_target_versions): New
	prototype.
	* config/sparc/sparc.h (TARGET_D_CPU_VERSIONS): Define.
	* config/sparc/t-sparc (sparc-d.o): New rule.
	* config/t-glibc (glibc-d.o): New rule.
	* configure: Regenerated.
	* configure.ac (tm_d_file): New variable.
	(tm_d_file_list, tm_d_include_list, d_target_objs): Add substitutes.
	* doc/contrib.texi (Contributors): Add self for the D frontend.
	* doc/frontends.texi (G++ and GCC): Mention D as a supported language.
	* doc/install.texi (Configuration): Mention libphobos as an option for
	--enable-shared.  Mention d as an option for --enable-languages.
	(Testing): Mention check-d as a target.
	* doc/invoke.texi (Overall Options): Mention .d, .dd, and .di as file
	name suffixes.  Mention d as a -x option.
	* doc/sourcebuild.texi (Top Level): Mention libphobos.
	* doc/standards.texi (Standards): Add section on D language.
	* doc/tm.texi: Regenerated.
	* doc/tm.texi.in: Add @node for D language and ABI, and @hook for
	TARGET_CPU_VERSIONS, TARGET_D_OS_VERSIONS, and TARGET_D_CRITSEC_SIZE.
	* dwarf2out.c (is_dlang): New function.
	(gen_compile_unit_die): Use DW_LANG_D for D.
	(declare_in_namespace): Return module die for D, instead of adding
	extra declarations into the namespace.
	(gen_namespace_die): Generate DW_TAG_module for D.
	(gen_decl_die): Handle CONST_DECLSs for D.
	(dwarf2out_decl): Likewise.
	(prune_unused_types_walk_local_classes): Handle DW_tag_interface_type.
	(prune_unused_types_walk): Handle DW_tag_interface_type same as other
	kinds of aggregates.
	* gcc.c (default_compilers): Add entries for .d, .dd and .di.
	* genhooks.c: Include d/d-target.def.

gcc/po/ChangeLog:

	* EXCLUDES: Add sources from d/dmd.

gcc/testsuite/ChangeLog:

	* gcc.misc-tests/help.exp: Add D to option descriptions check.
	* gdc.dg/asan/asan.exp: New file.
	* gdc.dg/asan/gdc272.d: New test.
	* gdc.dg/compilable.d: New test.
	* gdc.dg/dg.exp: New file.
	* gdc.dg/gdc254.d: New test.
	* gdc.dg/gdc260.d: New test.
	* gdc.dg/gdc270a.d: New test.
	* gdc.dg/gdc270b.d: New test.
	* gdc.dg/gdc282.d: New test.
	* gdc.dg/gdc283.d: New test.
	* gdc.dg/imports/gdc170.d: New test.
	* gdc.dg/imports/gdc231.d: New test.
	* gdc.dg/imports/gdc239.d: New test.
	* gdc.dg/imports/gdc241a.d: New test.
	* gdc.dg/imports/gdc241b.d: New test.
	* gdc.dg/imports/gdc251a.d: New test.
	* gdc.dg/imports/gdc251b.d: New test.
	* gdc.dg/imports/gdc253.d: New test.
	* gdc.dg/imports/gdc254a.d: New test.
	* gdc.dg/imports/gdc256.d: New test.
	* gdc.dg/imports/gdc27.d: New test.
	* gdc.dg/imports/gdcpkg256/package.d: New test.
	* gdc.dg/imports/runnable.d: New test.
	* gdc.dg/link.d: New test.
	* gdc.dg/lto/lto.exp: New file.
	* gdc.dg/lto/ltotests_0.d: New test.
	* gdc.dg/lto/ltotests_1.d: New test.
	* gdc.dg/runnable.d: New test.
	* gdc.dg/simd.d: New test.
	* gdc.test/gdc-test.exp: New file.
	* lib/gdc-dg.exp: New file.
	* lib/gdc.exp: New file.

libphobos/ChangeLog:

	* Makefile.am: New file.
	* Makefile.in: New file.
	* acinclude.m4: New file.
	* aclocal.m4: New file.
	* config.h.in: New file.
	* configure: New file.
	* configure.ac: New file.
	* d_rules.am: New file.
	* libdruntime/Makefile.am: New file.
	* libdruntime/Makefile.in: New file.
	* libdruntime/__entrypoint.di: New file.
	* libdruntime/__main.di: New file.
	* libdruntime/gcc/attribute.d: New file.
	* libdruntime/gcc/backtrace.d: New file.
	* libdruntime/gcc/builtins.d: New file.
	* libdruntime/gcc/config.d.in: New file.
	* libdruntime/gcc/deh.d: New file.
	* libdruntime/gcc/libbacktrace.d.in: New file.
	* libdruntime/gcc/unwind/arm.d: New file.
	* libdruntime/gcc/unwind/arm_common.d: New file.
	* libdruntime/gcc/unwind/c6x.d: New file.
	* libdruntime/gcc/unwind/generic.d: New file.
	* libdruntime/gcc/unwind/package.d: New file.
	* libdruntime/gcc/unwind/pe.d: New file.
	* m4/autoconf.m4: New file.
	* m4/druntime.m4: New file.
	* m4/druntime/cpu.m4: New file.
	* m4/druntime/libraries.m4: New file.
	* m4/druntime/os.m4: New file.
	* m4/gcc_support.m4: New file.
	* m4/gdc.m4: New file.
	* m4/libtool.m4: New file.
	* src/Makefile.am: New file.
	* src/Makefile.in: New file.
	* src/libgphobos.spec.in: New file.
	* testsuite/Makefile.am: New file.
	* testsuite/Makefile.in: New file.
	* testsuite/config/default.exp: New file.
	* testsuite/lib/libphobos-dg.exp: New file.
	* testsuite/lib/libphobos.exp: New file.
	* testsuite/testsuite_flags.in: New file.

From-SVN: r265573
2018-10-28 19:51:47 +00:00