Commit graph

306 commits

Author SHA1 Message Date
GCC Administrator
8d07b193d7 Daily bump. 2023-01-18 00:17:21 +00:00
Martin Liska
42bf66e4a7 Regenerate Makefile.in files.
libbacktrace/ChangeLog:

	* Makefile.in: Regenerate.

libgomp/ChangeLog:

	* Makefile.in: Regenerate.
	* configure: Regenerate.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* libdruntime/Makefile.in: Regenerate.

libstdc++-v3/ChangeLog:

	* src/libbacktrace/Makefile.in: Regenerate.
2023-01-17 12:20:05 +01:00
Jakub Jelinek
83ffe9cde7 Update copyright years. 2023-01-16 11:52:17 +01:00
Jakub Jelinek
68127a8e87 Update Copyright year in ChangeLog files
2022 -> 2023
2023-01-02 09:23:36 +01:00
GCC Administrator
324e995340 Daily bump. 2022-12-12 00:22:21 +00:00
Iain Buclaw
6d799f0aed d: Merge upstream dmd, druntime c8ae4adb2e, phobos 792c8b7c1.
D front-end changes:

	- Import dmd v2.101.0.
	- Deprecate the ability to call `__traits(getAttributes)' on
	  overload sets.
	- Deprecate non-empty `for' statement increment clause with no
	  effect.
	- Array literals assigned to `scope' array variables can now be
	  allocated on the stack.

D runtime changes:

	- Import druntime v2.101.0.

Phobos changes:

	- Import phobos v2.101.0.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd c8ae4adb2e.
	* typeinfo.cc (check_typeinfo_type): Update for new front-end
	interface.
	(TypeInfoVisitor::visit (TypeInfoStructDeclaration *)): Remove warning
	that toHash() must be declared 'nothrow @safe`.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime c8ae4adb2e.
	* src/MERGE: Merge upstream phobos 792c8b7c1.
2022-12-11 17:17:58 +01:00
Martin Liska
3d3b561fc3 changelog: Fix extra space after tab. 2022-11-21 10:13:44 +01:00
GCC Administrator
05788e9b95 Daily bump. 2022-11-06 11:05:22 +00:00
Iain Buclaw
3c28d6a3a0 d: Add support for vector comparison operators
The front-end added semantic support to permit comparing two vector
expressions.  This removes the restriction in the code generator, as
well as the intrisics that previously exposed the same operation.

gcc/d/ChangeLog:

	* d-target.cc (Target::isVectorOpSupported): Remove cases for
	comparison operators.
	* intrinsics.cc (maybe_set_intrinsic): Remove cases for vector
	comparison intrinsics.
	(maybe_warn_intrinsic_mismatch): Likewise.
	(expand_intrinsic_vec_cond): Remove.
	(maybe_expand_intrinsic): Remove cases for vector comparison
	intrinsics.
	* intrinsics.def (INTRINSIC_EQUALMASK): Remove.
	(INTRINSIC_NOTEQUALMASK): Remove.
	(INTRINSIC_GREATERMASK): Remove.
	(INTRINSIC_GREATEREQUALMASK): Remove.

libphobos/ChangeLog:

	* libdruntime/gcc/simd.d (equalMask): Implement using generics.
	(notEqualMask): Likewise.
	(greaterMask): Likewise.
	(greaterOrEqualMask): Likewise.
	(notMask): Likewise.
	(andAndMask): Likewise.
	(orOrMask): Likewise.

gcc/testsuite/ChangeLog:

	* gdc.dg/Wbuiltin_declaration_mismatch2.d: Remove comparision tests.
	* gdc.dg/simd2a.d: Update comparison tests.
	* gdc.dg/simd2b.d: Likewise.
	* gdc.dg/simd2c.d: Likewise.
	* gdc.dg/simd2d.d: Likewise.
	* gdc.dg/simd2e.d: Likewise.
	* gdc.dg/simd2f.d: Likewise.
	* gdc.dg/simd2g.d: Likewise.
	* gdc.dg/simd2h.d: Likewise.
	* gdc.dg/simd2i.d: Likewise.
	* gdc.dg/simd2j.d: Likewise.
2022-11-05 19:47:16 +01:00
GCC Administrator
f36bba0133 Daily bump. 2022-10-30 00:16:29 +00:00
Iain Buclaw
7e7ebe3e35 d: Merge upstream dmd, druntime e4f8919591, phobos 3ad507b51.
D front-end changes:

    - Import dmd v2.101.0-beta.1.
    - Add predefined version `D_Optimized' when compiling with `-O'.
    - Shortened method syntax (DIP1043) is now enabled by default.
    - Array literals assigned to `scope' array variables are now
      allocated on the stack.
    - Implement `@system' variables (DIP1035), available behind the
      preview feature flag `-fpreview=systemvariables'.

D runtime changes:

    - Import druntime v2.101.0-beta.1.

Phobos changes:

    - Import phobos v2.101.0-beta.1.
    - Added `std.typecons.SafeRefCounted', that can be used in `@safe'
      code with `-fpreview=dip1000'.

gcc/d/ChangeLog:

	* d-attribs.cc (apply_user_attributes): Update for new front-end
	interface.
	* d-builtins.cc (d_init_versions): Predefine `D_Optimized' with
	compiling with optimizations enabled.
	* d-lang.cc (d_handle_option): Update for new front-end interface.
	Handle new option `-fpreview=systemvariables'.
	* dmd/MERGE: Merge upstream dmd e4f8919591.
	* dmd/VERSION: Bump version to v2.101.0-beta.1.
	* expr.cc (ExprVisitor::visit (AssignExp *)): Treat construction of
	static arrays from a call expression as a simple assignment.
	(ExprVisitor::visit (ArrayLiteralExp *)): Handle array literals with
	`scope' storage.
	* gdc.texi: Update documentation of `-fpreview=' options.
	* lang.opt (fpreview=shortenedmethods): Remove.
	(fpreview=systemvariables):  New option.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime e4f8919591.
	* src/MERGE: Merge upstream phobos 3ad507b51.

gcc/testsuite/ChangeLog:

	* gdc.dg/simd19630.d: Move tests with errors to ...
	* gdc.dg/simd19630b.d: ... here.  New test.
	* gdc.dg/simd19630c.d: New test.
	* gdc.dg/simd_ctfe.d: Removed.
	* gdc.dg/simd18867.d: New test.
	* gdc.dg/simd19788.d: New test.
	* gdc.dg/simd21469.d: New test.
	* gdc.dg/simd21672.d: New test.
	* gdc.dg/simd23077.d: New test.
	* gdc.dg/simd23084.d: New test.
	* gdc.dg/simd23085.d: New test.
	* gdc.dg/torture/simd19632.d: New test.
	* gdc.dg/torture/simd20041.d: New test.
	* gdc.dg/torture/simd21673.d: New test.
	* gdc.dg/torture/simd21676.d: New test.
	* gdc.dg/torture/simd22438.d: New test.
	* gdc.dg/torture/simd23009.d: New test.
	* gdc.dg/torture/simd23077.d: New test.
	* gdc.dg/torture/simd8.d: New test.
	* gdc.dg/torture/simd9.d: New test.
	* gdc.dg/torture/simd_prefetch.d: New test.
2022-10-29 13:02:26 +02:00
GCC Administrator
781f477a13 Daily bump. 2022-10-13 00:17:37 +00:00
Martin Liska
6d2294a83e regenerate configure files
Needed after a recent change.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

liboffloadmic/ChangeLog:

	* configure: Regenerate.
	* plugin/configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2022-10-12 09:31:32 +02:00
GCC Administrator
ab332cd78d Daily bump. 2022-10-12 00:17:24 +00:00
Olivier Hainque
0ecd0f1cc6 Generic configury support for shared libs on VxWorks
This change adds the configury bits to activate the build of
shared libs on VxWorks ports configured with --enable-shared,
for libraries variants where this is generally supported (rtp,
code model !large - currently not compatible with -fPIC).

Set lt_cv_deplibs_check_method in libtool.m4, so the build of
libraries know how to establish dependencies.  This is useful in
configurations such as aarch64 where proper support of LSE relies
on accurate dependency information between libstdc++ and libgcc_s
to begin with.

Regenerate configure scripts to reflect libtool.m4 change.

2022-10-09  Olivier Hainque  <hainque@adacore.com>

	* libtool.m4 (*vxworks*): When enable_shared, set dynamic_linker
	and friends for rtp !large. Assume the linker has the required
	abilities and set lt_cv_deplibs_check_method.

gcc/
	* config.gcc (*vxworks*): Add t-slibgcc fragment
	if enable_shared.

libgcc/
	* config.host (*vxworks*): When enable_shared, add
	libgcc and crtstuff "shared" fragments for rtp except
	large code model.
	(aarch64*-wrs-vxworks7*): Remove t-slibgcc-libgcc from
	the list of fragments.

2022-10-09  Olivier Hainque  <hainque@adacore.com>

gcc/
	* configure: Regenerate.

libatomic/
	* configure: Regenerate.

libbacktrace/
	* configure: Regenerate.

libcc1/
	* configure: Regenerate.

libffi/
	* configure: Regenerate.

libgfortran/
	* configure: Regenerate.

libgomp/
	* configure: Regenerate.

libitm/
	* configure: Regenerate.

libobjc/
	* configure: Regenerate.

liboffloadmic/
	* configure: Regenerate.

liboffloadmic/
	* plugin/configure: Regenerate.

libphobos/
	* configure: Regenerate.

libquadmath/
	* configure: Regenerate.

libsanitizer/
	* configure: Regenerate.

libssp/
	* configure: Regenerate.

libstdc++-v3/
	* configure: Regenerate.

libvtv/
	* configure: Regenerate.

lto-plugin/
	* configure: Regenerate.

zlib/
	* configure: Regenerate.
2022-10-11 07:31:07 +00:00
GCC Administrator
1f16a020ac Daily bump. 2022-09-28 00:17:27 +00:00
Iain Buclaw
c8dfa79c99 d: Merge upstream dmd d579c467c1, phobos 88aa69b14.
D front-end changes:

    - Throwing from contracts of `nothrow' functions has been
      deprecated, as this breaks the guarantees of `nothrow'.
    - Added language support for initializing the interior pointer of
      associative arrays using `new' keyword.

Phobos changes:

    - The std.digest.digest module has been removed.
    - The std.xml module has been removed.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd d579c467c1.
	* decl.cc (layout_struct_initializer): Update for new front-end
	interface.
	* expr.cc (ExprVisitor::visit (AssignExp *)): Remove lowering of array
	assignments.
	(ExprVisitor::visit (NewExp *)): Add new lowering of new'ing
	associative arrays to an _aaNew() library call.
	* runtime.def (ARRAYSETASSIGN): Remove.
	(AANEW): Define.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime d579c467c1.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Remove
	rt/arrayassign.d.
	* libdruntime/Makefile.in: Regenerate.
	* src/MERGE: Merge upstream phobos 88aa69b14.
	* src/Makefile.am (PHOBOS_DSOURCES): Remove std/digest/digest.d,
	std/xml.d.
	* src/Makefile.in: Regenerate.
2022-09-27 10:50:18 +02:00
GCC Administrator
6b226ef735 Daily bump. 2022-08-28 00:16:28 +00:00
Iain Buclaw
b7a586beae d: Merge upstream dmd 817610b16d, phobos b578dfad9
D front-end changes:

    - Import latest bug fixes to mainline.

Phobos changes:

    - Import latest bug fixes to mainline.
    - std.logger module has been moved out of experimental.
    - Removed std.experimental.typecons module.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 817610b16d.
	* d-ctfloat.cc (CTFloat::parse): Update for new front-end interface.
	* d-lang.cc (d_parse_file): Likewise.
	* expr.cc (ExprVisitor::visit (AssignExp *)): Remove handling of array
	assignments to non-trivial static and dynamic arrays.
	* runtime.def (ARRAYASSIGN): Remove.
	(ARRAYASSIGN_L): Remove.
	(ARRAYASSIGN_R): Remove.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 817610b16d.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add
	core/internal/array/arrayassign.d.
	* libdruntime/Makefile.in: Regenerate.
	* src/MERGE: Merge upstream phobos b578dfad9.
	* src/Makefile.am (PHOBOS_DSOURCES): Remove
	std/experimental/typecons.d. Add std/logger package.
	* src/Makefile.in: Regenerate.
2022-08-28 00:16:34 +02:00
GCC Administrator
4c23b534d4 Daily bump. 2022-08-04 00:16:49 +00:00
Iain Buclaw
b6df113247 d: Merge upstream dmd d7772a2369, phobos 5748ca43f.
In upstream dmd, the compiler front-end and run-time have been merged
together into one repository.  Both dmd and libdruntime now track that.

D front-end changes:

    - Deprecated `scope(failure)' blocks that contain `return' statements.
    - Deprecated using integers for `version' or `debug' conditions.
    - Deprecated returning a discarded void value from a function.
    - `new' can now allocate an associative array.

D runtime changes:

    - Added avx512f detection to core.cpuid module.

Phobos changes:

    - Changed std.experimental.logger.core.sharedLog to return
      shared(Logger).

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd d7772a2369.
	* dmd/VERSION: Bump version to v2.100.1.
	* d-codegen.cc (get_frameinfo): Check whether decision to generate
	closure changed since semantic finished.
	* d-lang.cc (d_handle_option): Remove handling of -fdebug=level and
	-fversion=level.
	* decl.cc (DeclVisitor::visit (VarDeclaration *)): Generate evaluation
	of noreturn variable initializers before throw.
	* expr.cc (ExprVisitor::visit (AssignExp *)): Don't generate
	assignment for noreturn types, only evaluate for side effects.
	* lang.opt (fdebug=): Undocument -fdebug=level.
	(fversion=): Undocument -fversion=level.

libphobos/ChangeLog:

	* configure: Regenerate.
	* configure.ac (libtool_VERSION): Update to 4:0:0.
	* libdruntime/MERGE: Merge upstream druntime d7772a2369.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add
	core/internal/array/duplication.d.
	* libdruntime/Makefile.in: Regenerate.
	* src/MERGE: Merge upstream phobos 5748ca43f.
	* testsuite/libphobos.gc/nocollect.d:
2022-08-03 13:01:53 +02:00
GCC Administrator
4bc92c3bfa Daily bump. 2022-07-07 00:16:46 +00:00
Iain Buclaw
208fbc779c d: Merge upstream dmd 56589f0f4, druntime 651389b5, phobos 1516ecad9.
D front-end changes:

    - Import latest bug fixes to mainline.

D runtime changes:

    - Import latest bug fixes to mainline.

Phobos changes:

    - Import latest bug fixes to mainline.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 56589f0f4.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 651389b5.
	* src/MERGE: Merge upstream phobos 1516ecad9.
2022-07-06 19:51:38 +02:00
GCC Administrator
ce600bc464 Daily bump. 2022-06-30 00:16:46 +00:00
Iain Buclaw
b93ae1a01b d: Add SIMD intrinsics module and compiler built-ins.
Vectors in D are exposed by the use of the `__vector(T[N])' type, and
whilst most unary and binary operations work as you'd expect, there are
some operations that are not possible without doing the operation
unrolled, or calling some target-specific built-in, or with inline asm.

This introduces a new `gcc.simd' module that introduces the following.

 - Prefetching has been exposed by a convenient `prefetch' function in
   the library.

 - Loading and storing from an unaligned address have been exposed by
   `loadUnaligned' and `storeUnaligned' intrinsics.

 - Vector permutations have been exposed by `shuffle`, and
   `shufflevector' intrinsics.

 - Converting between two vectors with a different element type has been
   exposed by a `convertvector' intrinsic.

 - The ternary operator has been exposed with a `blendvector' intrinsic.

 - Comparison operators have been exposed by `equalMask',
   `notEqualMask', `greaterMask', and `greaterEqualMask' intrinsics.

 - Logic operators have been exposed by convenient `notMask',
   `andAndMask', and `orOrMask' functions in the library.

To be compatible with the LLVM D compiler's own SIMD intrinsic module,
there is also the addition of an `extractelement' and `insertelement'
convenience functions, and an alternative interface for calling the
`shufflevector' function.

The addition of these intrinsics lowers the boundary for users working
in SIMD to get the desired codegen they want out of the compiler.

Most of what is present here - apart from tests - is the adding of
machinery in the intrinsics suite of functions to do validation on
templated intrinsics.  Whilst these are still matched from the library
by their generic (untyped) signature, there is a still an assumption
that what has been instantiated and handed down to the code generator is
valid, because why would these definitions be found outside of the
in-tree D runtime library?  The majority of intrinsics are not
templates, so the test on the mangled signature string still guarantees
all types are as we expect them to be.  However there are still a small
handful of other templated intrinsics (core.bitop.{rol,ror},
core.math.toPrec, std.math.traits.isNaN, ...) that are currently
unchecked, so would benefit from being included into this built-in
checking function at some point in the future.

gcc/d/ChangeLog:

	* intrinsics.cc: Include diagnostic.h, langhooks.h,
	vec-perm-indices.h.
	(maybe_set_intrinsic): Add cases for new simd intrinsics.
	(warn_mismatched_return_type): New function.
	(warn_mismatched_argument): New function.
	(build_shuffle_mask_type): New function.
	(maybe_warn_intrinsic_mismatch): New function.
	(expand_intrinsic_vec_cond): New function.
	(expand_intrinsic_vec_convert): New function.
	(expand_intrinsic_vec_blend): New function.
	(expand_intrinsic_vec_shuffle): New function.
	(expand_intrinsic_vec_shufflevector): New function.
	(expand_intrinsic_vec_load_unaligned): New function.
	(expand_intrinsic_vec_store_unaligned): New function.
	(maybe_expand_intrinsic): Check signature of intrinsic before handing
	off to front-end lowering.  Add cases for new simd intrinsics.
	* intrinsics.def (INTRINSIC_LOADUNALIGNED): Define intrinsic.
	(INTRINSIC_STOREUNALIGNED): Define intrinsic.
	(INTRINSIC_SHUFFLE): Define intrinsic.
	(INTRINSIC_SHUFFLEVECTOR): Define intrinsic.
	(INTRINSIC_CONVERTVECTOR): Define intrinsic.
	(INTRINSIC_BLENDVECTOR): Define intrinsic.
	(INTRINSIC_EQUALMASK): Define intrinsic.
	(INTRINSIC_NOTEQUALMASK): Define intrinsic.
	(INTRINSIC_GREATERMASK): Define intrinsic.
	(INTRINSIC_GREATEREQUALMASK): Define intrinsic.

libphobos/ChangeLog:

	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add gcc/simd.d.
	* libdruntime/Makefile.in: Regenerate.
	* libdruntime/gcc/simd.d: New file.

gcc/testsuite/ChangeLog:

	* gdc.dg/Wbuiltin_declaration_mismatch.d: Rename to...
	* gdc.dg/Wbuiltin_declaration_mismatch1.d: ...this.
	* gdc.dg/Wbuiltin_declaration_mismatch2.d: New test.
	* gdc.dg/torture/simd_blendvector.d: New test.
	* gdc.dg/torture/simd_cond.d: New test.
	* gdc.dg/torture/simd_convertvector.d: New test.
	* gdc.dg/torture/simd_load.d: New test.
	* gdc.dg/torture/simd_logical.d: New test.
	* gdc.dg/torture/simd_shuffle.d: New test.
	* gdc.dg/torture/simd_shufflevector.d: New test.
	* gdc.dg/torture/simd_store.d: New test.
2022-06-29 02:28:20 +02:00
GCC Administrator
fb29fdea9c Daily bump. 2022-06-29 00:17:00 +00:00
Iain Buclaw
6201277441 d: Add @simd and @simd_clones attributes to compiler and library
The `@simd` attribute is equivalent to `__attribute__((simd))`, and
`@simd_clones` is a convenience alias to allow specifying whether the
compiler should generated masked or non-masked simd clones.

gcc/d/ChangeLog:

	* d-attribs.cc (handle_omp_declare_simd_attribute): New function.
	(d_handle_simd_attribute): New function.
	(d_langhook_common_attribute_table): Add 'omp declare simd' attribute.
	(d_langhook_attribute_table): Add simd attribute.

libphobos/ChangeLog:

	* libdruntime/gcc/attributes.d (simd): Define.

gcc/testsuite/ChangeLog:

	* gdc.dg/attr_simd1.d: New test.
	* gdc.dg/attr_simd2.d: New test.
2022-06-28 19:05:42 +02:00
GCC Administrator
84c2131d2c Daily bump. 2022-06-25 00:16:23 +00:00
Iain Buclaw
91418c4208 d: Add `@register' attribute to compiler and library.
The `@register` attribute specifies that a local or `__gshared` variable
is to be given a register storage-class in the C sense of the term, and
will be placed into a register named `registerName`.

The variable needs to boiled down to a data type that fits the target
register.  It also cannot have either thread-local or `extern` storage.
It is an error to take the address of a register variable.

	PR d/105413

gcc/d/ChangeLog:

	* d-attribs.cc (d_handle_register_attribute): New function.
	(d_langhook_attribute_table): Add register attribute.
	* d-codegen.cc (d_mark_addressable): Error if taken address of
	register variable.
	(build_frame_type): Error if register variable has non-local
	references.
	* d-tree.h (d_mark_addressable): Add complain parameter.
	* decl.cc (get_symbol_decl): Mark register varibles DECL_REGISTER.
	Error when register variable declared thread-local or extern.
	* expr.cc (ExprVisitor::visit (IndexExp *)): Don't complain about
	marking register vectors as addressable in an ARRAY_REF.

libphobos/ChangeLog:

	* libdruntime/gcc/attributes.d (register): Define.

gcc/testsuite/ChangeLog:

	* gdc.dg/attr_register1.d: New test.
	* gdc.dg/attr_register2.d: New test.
	* gdc.dg/attr_register3.d: New test.
2022-06-24 20:49:58 +02:00
Iain Buclaw
d97f3bca6e d: Merge upstream dmd 529110f66, druntime 148608b7.
D front-end changes:

    - Import latest bug fixes to mainline.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 529110f66.
	* decl.cc (DeclVisitor::visit (TupleDeclaration *)): Update for new
	front-end interface.
	* types.cc (layout_aggregate_members): Likewise.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 148608b7.
2022-06-24 20:49:58 +02:00
GCC Administrator
5d0cf15822 Daily bump. 2022-06-23 00:16:40 +00:00
Iain Buclaw
445d8deffb d: Merge upstream dmd 6203135dc, druntime e150cca1, phobos a4a18d21c.
D front-end changes:

    - Input parameters can now be applied on extern(C++) functions to
      bind to `const &' when the `-fpreview=in' flag is in effect.

D runtime changes:

    - Run-time flag `--DRT-oncycle=deprecate' has been removed.

Phobos changes:

    - Removed std.experimental.logger's capability to set the minimal
      LogLevel at compile time.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 6203135dc.
	* typeinfo.cc (TypeInfoVisitor::visit (TypeInfoStructDeclaration *)):
	Update for new front-end interface.
	(SpeculativeTypeVisitor::visit (TypeStruct *)): Likewise.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime e150cca1.
	* src/MERGE: Merge upstream phobos a4a18d21c.
	* testsuite/libphobos.cycles/cycles.exp (cycle_test_list): Update
	expected result of deprecate test.
2022-06-22 17:57:56 +02:00
GCC Administrator
499b9c5f09 Daily bump. 2022-06-16 00:16:44 +00:00
Iain Buclaw
90f2a11141 d: Add `@no_sanitize' attribute to compiler and library.
The `@no_sanitize' attribute disables a particular sanitizer for this
function, analogous to `__attribute__((no_sanitize))'.  The library also
defines `@noSanitize' to be compatible with the LLVM D compiler's
`ldc.attributes'.

gcc/d/ChangeLog:

	* d-attribs.cc (d_langhook_attribute_table): Add no_sanitize.
	(d_handle_no_sanitize_attribute): New function.

libphobos/ChangeLog:

	* libdruntime/gcc/attributes.d (no_sanitize): Define.
	(noSanitize): Define.

gcc/testsuite/ChangeLog:

	* gdc.dg/asan/attr_no_sanitize1.d: New test.
	* gdc.dg/ubsan/attr_no_sanitize2.d: New test.
2022-06-15 23:16:21 +02:00
Iain Buclaw
636b01ab49 d: Add @visibility' and @hidden' attributes.
The `@visibility' attribute is functionality the same as
`__attribute__((visibility))', and `@hidden' is a convenience alias to
`@visibility("hidden")' defined in the `gcc.attributes' module.

As the visibility of a symbol is also indirectly controlled by the
`export' keyword, the handling of this in the code generation pass has
been improved so that conflicts will be appropriately diagnosed.

gcc/d/ChangeLog:

	* d-attribs.cc (d_langhook_attribute_table): Add visibility.
	(insert_type_attribute): Use decl_attributes instead of
	merge_attributes.
	(insert_decl_attribute): Likewise.
	(apply_user_attributes): Do nothing when no UDAs applied.
	(d_handle_visibility_attribute): New function.
	* d-gimplify.cc (d_gimplify_binary_expr): Adjust.
	* d-tree.h (set_visibility_for_decl): Declare.
	* decl.cc (get_symbol_decl): Move setting of visibility flags to...
	(set_visibility_for_decl): ... here.  New function.
	* types.cc (TypeVisitor::visit (TypeStruct *)): Call
	set_visibility_for_decl().
	(TypeVisitor::visit (TypeClass *)): Likewise.

gcc/testsuite/ChangeLog:

	* gdc.dg/attr_visibility1.d: New test.
	* gdc.dg/attr_visibility2.d: New test.
	* gdc.dg/attr_visibility3.d: New test.

libphobos/ChangeLog:

	* libdruntime/gcc/attributes.d (visibility): Define.
	(hidden): Define.
2022-06-15 20:11:04 +02:00
GCC Administrator
c3642271e8 Daily bump. 2022-06-14 00:16:39 +00:00
Iain Buclaw
4f19e078cc libphobos: Check in missing core.sync package module
This was meant to be part of r13-1062 in the merge with upstream
druntime 454471d8.
2022-06-14 00:07:13 +02:00
Iain Buclaw
ec486b739b d: Merge upstream dmd 821ed393d, druntime 454471d8, phobos 1206fc94f.
D front-end changes:

    - Import latest bug fixes to mainline.

D runtime changes:

    - Fix duplicate Elf64_Dyn definitions on Solaris.
    - _d_newThrowable has been converted to a template.

Phobos changes:

    - Import latest bug fixes to mainline.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 821ed393d.
	* expr.cc (ExprVisitor::visit (NewExp *)): Remove handled of
	allocating `@nogc' throwable object.
	* runtime.def (NEWTHROW): Remove.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 454471d8.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add
	core/sync/package.d.
	* libdruntime/Makefile.in: Regenerate.
	* src/MERGE: Merge upstream phobos 1206fc94f.
2022-06-13 11:38:10 +02:00
GCC Administrator
b168441c8a Daily bump. 2022-06-03 00:16:40 +00:00
David Malcolm
6cf276ddf2 diagnostics: add SARIF output format
This patch adds support to gcc's diagnostic subsystem for emitting
diagnostics in SARIF, aka the Static Analysis Results Interchange Format:
  https://sarifweb.azurewebsites.net/
by extending -fdiagnostics-format= to add two new options:
  -fdiagnostics-format=sarif-stderr
and:
  -fdiagnostics-format=sarif-file

The patch targets SARIF v2.1.0

This is a JSON-based format suited for capturing the results of static
analysis tools (like GCC's -fanalyzer), but it can also be used for plain
GCC warnings and errors.

SARIF supports per-event metadata in diagnostic paths such as
["acquire", "resource"] and ["release", "lock"] (specifically, the
threadFlowLocation "kinds" property: SARIF v2.1.0 section 3.38.8), so
the patch extends GCC"s diagnostic_event subclass with a "struct meaning"
with similar purpose.  The patch implements this for -fanalyzer so that
the various state-machine-based warnings set these in the SARIF output.

The heart of the implementation is in the new file
diagnostic-format-sarif.cc.  Much of the rest of the patch is interface
classes, isolating the diagnostic subsystem (which has no knowledge of
e.g. tree or langhook) from the "client" code in the compiler proper
cc1 etc).

The patch adds a langhook for specifying the SARIF v2.1.0
"artifact.sourceLanguage" property, based on the list in
SARIF v2.1.0 Appendix J.

The patch adds automated DejaGnu tests to our testsuite via new
scan-sarif-file and scan-sarif-file-not directives (although these
merely use regexps, rather than attempting to use a proper JSON parser).

I've tested the patch by hand using the validator at:
  https://sarifweb.azurewebsites.net/Validation
and the react-based viewer at:
  https://microsoft.github.io/sarif-web-component/
which successfully shows most of the information (although not paths,
and not CWE IDs), and I've fixed all validation errors I've seen (though
bugs no doubt remain).

I've also tested the generated SARIF using the VS Code extension linked
to from the SARIF website; I'm a novice with VS Code, but it seems to be
able to handle my generated SARIF files (e.g. showing the data in the
SARIF tab, and showing squiggly underlines under issues, and when I
click on them, it visualizes the events in the path inline within the
source window).

Has anyone written an Emacs mode for SARIF files? (pretty please)

gcc/ChangeLog:
	* Makefile.in (OBJS): Add tree-diagnostic-client-data-hooks.o and
	tree-logical-location.o.
	(OBJS-libcommon): Add diagnostic-format-sarif.o; reorder.
	(CFLAGS-tree-diagnostic-client-data-hooks.o): Add TARGET_NAME.
	* common.opt (fdiagnostics-format=): Add sarif-stderr and sarif-file.
	(sarif-stderr, sarif-file): New enum values.
	* diagnostic-client-data-hooks.h: New file.
	* diagnostic-format-sarif.cc: New file.
	* diagnostic-path.h (enum diagnostic_event::verb): New enum.
	(enum diagnostic_event::noun): New enum.
	(enum diagnostic_event::property): New enum.
	(struct diagnostic_event::meaning): New struct.
	(diagnostic_event::get_logical_location): New vfunc.
	(diagnostic_event::get_meaning): New vfunc.
	(simple_diagnostic_event::get_logical_location): New vfunc impl.
	(simple_diagnostic_event::get_meaning): New vfunc impl.
	* diagnostic.cc: Include "diagnostic-client-data-hooks.h".
	(diagnostic_initialize): Initialize m_client_data_hooks.
	(diagnostic_finish): Clean up m_client_data_hooks.
	(diagnostic_event::meaning::dump_to_pp): New.
	(diagnostic_event::meaning::maybe_get_verb_str): New.
	(diagnostic_event::meaning::maybe_get_noun_str): New.
	(diagnostic_event::meaning::maybe_get_property_str): New.
	(get_cwe_url): Make non-static.
	(diagnostic_output_format_init): Handle
	DIAGNOSTICS_OUTPUT_FORMAT_SARIF_STDERR and
	DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE.
	* diagnostic.h (enum diagnostics_output_format): Add
	DIAGNOSTICS_OUTPUT_FORMAT_SARIF_STDERR and
	DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE.
	(class diagnostic_client_data_hooks): New forward decl.
	(class logical_location): New forward decl.
	(diagnostic_context::m_client_data_hooks): New field.
	(diagnostic_output_format_init_sarif_stderr): New decl.
	(diagnostic_output_format_init_sarif_file): New decl.
	(get_cwe_url): New decl.
	* doc/invoke.texi (-fdiagnostics-format=): Add sarif-stderr and
	sarif-file.
	* doc/sourcebuild.texi (Scan a particular file): Add
	scan-sarif-file and scan-sarif-file-not.
	* langhooks-def.h (lhd_get_sarif_source_language): New decl.
	(LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): New macro.
	(LANG_HOOKS_INITIALIZER): Add
	LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE.
	* langhooks.cc (lhd_get_sarif_source_language): New.
	* langhooks.h (lang_hooks::get_sarif_source_language): New field.
	* logical-location.h: New file.
	* plugin.cc (struct for_each_plugin_closure): New.
	(for_each_plugin_cb): New.
	(for_each_plugin): New.
	* plugin.h (for_each_plugin): New decl.
	* tree-diagnostic-client-data-hooks.cc: New file.
	* tree-diagnostic.cc: Include "diagnostic-client-data-hooks.h".
	(tree_diagnostics_defaults): Populate m_client_data_hooks.
	* tree-logical-location.cc: New file.
	* tree-logical-location.h: New file.

gcc/ada/ChangeLog:
	* gcc-interface/misc.cc (gnat_get_sarif_source_language): New.
	(LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.

gcc/analyzer/ChangeLog:
	* checker-path.cc (checker_event::get_meaning): New.
	(function_entry_event::get_meaning): New.
	(state_change_event::get_desc): Add dump of meaning of the event
	to the -fanalyzer-verbose-state-changes output.
	(state_change_event::get_meaning): New.
	(cfg_edge_event::get_meaning): New.
	(call_event::get_meaning): New.
	(return_event::get_meaning): New.
	(start_consolidated_cfg_edges_event::get_meaning): New.
	(warning_event::get_meaning): New.
	* checker-path.h: Include "tree-logical-location.h".
	(checker_event::checker_event): Construct m_logical_loc.
	(checker_event::get_logical_location): New.
	(checker_event::get_meaning): New decl.
	(checker_event::m_logical_loc): New.
	(function_entry_event::get_meaning): New decl.
	(state_change_event::get_meaning): New decl.
	(cfg_edge_event::get_meaning): New decl.
	(call_event::get_meaning): New decl.
	(return_event::get_meaning): New decl.
	(start_consolidated_cfg_edges_event::get_meaning): New.
	(warning_event::get_meaning): New decl.
	* pending-diagnostic.h: Include "diagnostic-path.h".
	(pending_diagnostic::get_meaning_for_state_change): New vfunc.
	* sm-file.cc (file_diagnostic::get_meaning_for_state_change): New
	vfunc impl.
	* sm-malloc.cc (malloc_diagnostic::get_meaning_for_state_change):
	Likewise.
	* sm-sensitive.cc
	(exposure_through_output_file::get_meaning_for_state_change):
	Likewise.
	* sm-taint.cc (taint_diagnostic::get_meaning_for_state_change):
	Likewise.
	* varargs.cc
	(va_list_sm_diagnostic::get_meaning_for_state_change): Likewise.

gcc/c/ChangeLog:
	* c-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
	(c_get_sarif_source_language): New.
	* c-tree.h (c_get_sarif_source_language): New decl.

gcc/cp/ChangeLog:
	* cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
	(cp_get_sarif_source_language): New.

gcc/d/ChangeLog:
	* d-lang.cc (d_get_sarif_source_language): New.
	(LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.

gcc/fortran/ChangeLog:
	* f95-lang.cc (gfc_get_sarif_source_language): New.
	(LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.

gcc/go/ChangeLog:
	* go-lang.cc (go_get_sarif_source_language): New.
	(LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.

gcc/objc/ChangeLog:
	* objc-act.h (objc_get_sarif_source_language): New decl.
	* objc-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
	(objc_get_sarif_source_language): New.

gcc/testsuite/ChangeLog:
	* c-c++-common/diagnostic-format-sarif-file-1.c: New test.
	* c-c++-common/diagnostic-format-sarif-file-2.c: New test.
	* c-c++-common/diagnostic-format-sarif-file-3.c: New test.
	* c-c++-common/diagnostic-format-sarif-file-4.c: New test.
	* gcc.dg/analyzer/file-meaning-1.c: New test.
	* gcc.dg/analyzer/malloc-meaning-1.c: New test.
	* gcc.dg/analyzer/malloc-sarif-1.c: New test.
	* gcc.dg/plugin/analyzer_gil_plugin.c
	(gil_diagnostic::get_meaning_for_state_change): New vfunc impl.
	* gcc.dg/plugin/diagnostic-test-paths-5.c: New test.
	* gcc.dg/plugin/plugin.exp (plugin_test_list): Add
	diagnostic-test-paths-5.c to tests for
	diagnostic_plugin_test_paths.c.
	* lib/gcc-dg.exp: Load scansarif.exp.
	* lib/scansarif.exp: New test.

libatomic/ChangeLog:
	* testsuite/lib/libatomic.exp: Add load_gcc_lib of scansarif.exp.

libgomp/ChangeLog:
	* testsuite/lib/libgomp.exp: Add load_gcc_lib of scansarif.exp.

libitm/ChangeLog:
	* testsuite/lib/libitm.exp: Add load_gcc_lib of scansarif.exp.

libphobos/ChangeLog:
	* testsuite/lib/libphobos-dg.exp: Add load_gcc_lib of scansarif.exp.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2022-06-02 15:40:22 -04:00
GCC Administrator
d9176e643f Daily bump. 2022-05-28 00:16:40 +00:00
Iain Buclaw
610d789832 d: Merge upstream dmd 4d07f22f2, druntime f89da313, phobos d46814c86.
D front-end changes:

    - `scope' semantics are now enforced in `@safe' code on pointers to
      stack memory, but only as deprecation warnings.
    - Overriding virtual functions are now marked with the `override'
      and `final' in the generated headers of `-fdump-c++-spec='.
    - `-fpreview=fiximmmutableconv` has been added that disallows
      implicitly converting a return value with indirections to
      immutable if it determines the result must be unique.

D runtime changes:

    - Posix (excluding Darwin): Switch default GC signals from SIGUSR1/2
      to SIGRTMIN/SIGRTMIN+1

Phobos changes:

    - Import latest bug fixes to mainline.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 4d07f22f2
	* d-lang.cc (d_handle_option): Handle OPT_fpreview_fiximmutableconv.
	* lang.opt (fpreview=fiximmutableconv): New option.
	* runtime.def (ARRAYAPPENDT): Remove.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime f89da313.
	* src/MERGE: Merge upstream phobos d46814c86.

Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>
2022-05-27 20:19:02 +02:00
GCC Administrator
702bd11fa7 Daily bump. 2022-05-17 00:16:28 +00:00
Iain Buclaw
5eb9927aae d: Merge upstream dmd 60bfa0ee7, druntime 94bd5bcb, phobos 3a1cd9a01.
D front-end changes:

    - Import dmd v2.100.0.
    - Add bit fields to D, enabled via the -fpreview=bitfields switch.
    - Removed the -ftransition=markdown and -frevert=markdown switches.
    - Added new trait `__traits(classInstanceAlignment)' to provide the
      required data alignment for classes.
    - The check for `pragma(crt_constructor)' and `pragma(crt_destructor)'
      linkage has been relaxed to allow all `void()' signatures.
    - ImportC parser now recognizes the `typeof(...)' operator.

D runtime changes:

    - Import druntime v2.100.0.

Phobos changes:

    - Import phobos v2.100.0.
    - To comply with dip1000, `std.socket.Socket` methods now accept only
      `scope' arrays.
    - The `fill', `alignSize', `align2', and `align4' methods of
      `std.outbuffer.OutBuffer' have been extended to allow specifying a custom
      value when pre-filling or padding the buffer.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 60bfa0ee7.
	* dmd/VERSION: Update version to v2.100.0.
	* d-builtins.cc (d_init_versions): Update for new front-end interface.
	* d-codegen.cc (d_decl_context): Use resolvedLinkage to get
	declaration linkage.
	(build_struct_literal): Track offset in bits.
	* d-gimplify.cc (d_gimplify_modify_expr): Check both operands for a
	bit-field reference.
	* d-lang.cc (d_handle_option): Handle -fpreview=bitfields, remove
	-frevert=markdown and -ftransition=vmarkdown.
	(d_post_options): Set flag_rtti and flag_exceptions if -fno-druntime
	was seen on command-line.
	(d_parse_file): Update for new front-end interface.
	(d_type_promotes_to): Use resolvedLinkage to get declaration linkage.
	* decl.cc (make_thunk): Likewise.
	* expr.cc (ExprVisitor::visit (CatAssignExp *)): Remove lowering for
	appending of an element or array to another array.
	* lang.opt (fpreview=bitfields): New option.
	(frevert=markdown): Remove.
	(ftransition=vmarkdown): Remove.
	* types.cc (layout_aggregate_members): Ignore anonymous fields in
	total count.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 94bd5bcb.
	* libdruntime/Makefile.am (ALL_DRUNTIME_INSTALL_DSOURCES): Add
	$(DRUNTIME_DSOURCES_ELF).
	(ALL_DRUNTIME_SOURCES): Likewise.
	(DRUNTIME_DSOURCES_ELF): New variable.
	* libdruntime/Makefile.in: Regenerate.
	* src/MERGE: Merge upstream phobos 3a1cd9a01.
	* testsuite/libphobos.init_fini/custom_gc.d: Update test.
2022-05-16 19:07:45 +02:00
GCC Administrator
6b6f53d8af Daily bump. 2022-04-29 00:16:26 +00:00
Iain Buclaw
d91cb2059f d: Merge upstream dmd 313d28b3d, druntime e361d200.
D front-end changes:

    - Import latest bug fixes from the 2.100 release branch.
    - Fix signatures of extern C++ functions that have size_t
      parameters.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 313d28b3d.
	* d-port.cc (Port::memicmp): Use d_size_t instead of size_t.
	(Port::valcpy): Likewise.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime e361d200.
2022-04-28 12:58:12 +02:00
GCC Administrator
01ad093b5f Daily bump. 2022-04-27 00:16:46 +00:00
Iain Buclaw
796b7cbac3 libphobos: Don't call free on the TLS array in the emutls destroy function.
Fixes a segfault seen on Darwin when a GC scan is ran after a thread has
been destroyed.  As the global emutlsArrays hash still has a reference
to the array itself, and tries to iterate all elements.

Setting the length to zero frees all allocated elements in the array,
and ensures that it is skipped when the _d_emutls_scan is called.

libphobos/ChangeLog:

	* libdruntime/gcc/emutls.d (emutlsDestroyThread): Clear the per-thread
	TLS array, don't call free().
2022-04-26 14:32:11 +01:00
GCC Administrator
c1a9cf6791 Daily bump. 2022-04-22 00:16:43 +00:00
Iain Buclaw
ae56e2da05 d: Merge upstream dmd eb7bee331, druntime 27834edb, phobos ac296f80c.
D front-end changes:

    - Import dmd v2.100.0-beta.1.
    - Print deprecation messages for scope violations unless
      `-frevert=dip1000' is used.
    - Fixed a missed case of switch case fallthrough not being caught by
      the compiler.

D runtime changes:

    - Import druntime v2.100.0-beta.1.

Phobos changes:

    - Import phobos v2.100.0-beta.1.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd eb7bee331.
	* dmd/VERSION: Update version to v2.100.0-beta.1.
	* d-lang.cc (d_handle_option): Handle OPT_frevert_dip1000.
	* lang.opt (frevert=dip1000): New option.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 27834edb.
	* src/MERGE: Merge upstream phobos ac296f80c.
	* src/Makefile.am (PHOBOS_DSOURCES): Add std/int128.d.
	* src/Makefile.in: Regenerate.
2022-04-21 20:03:08 +01:00