Commit Graph

287 Commits

Author SHA1 Message Date
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
GCC Administrator 247bbed1b8 Daily bump. 2022-04-14 00:16:40 +00:00
Iain Buclaw 31350635bf d: Merge upstream dmd 4d1bfcf14, druntime 9ba9a6ae, phobos c0cc5e917.
D front-end changes:

    - Import dmd v2.099.1.
    - Added `@mustuse' attribute, implmenting DIP 1038.
    - Added `.tupleof` property for static arrays

D runtime changes:

    - Import druntime v2.099.1.

Phobos changes:

    - Import phobos v2.099.1.
    - Zlib bindings have been updated to 1.2.12.

gcc/d/ChangeLog:

	* Make-lang.in (D_FRONTEND_OBJS): Add d/common-bitfields.o,
	d/mustuse.o.
	* d-ctfloat.cc (CTFloat::isIdentical): Don't treat NaN values as
	identical.
	* dmd/MERGE: Merge upstream dmd 4d1bfcf14.
	* expr.cc (ExprVisitor::visit (VoidInitExp *)): New.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 9ba9a6ae.
	* src/MERGE: Merge upstream phobos c0cc5e917.
2022-04-13 15:02:57 +01:00
GCC Administrator 8af4270d3f Daily bump. 2022-04-04 08:00:40 +00:00
Iain Buclaw 235d5a96cb d: Merge upstream dmd 47871363d, druntime, c52e28b7, phobos 99e9c1b77.
D front-end changes:

    - Import dmd v2.099.1-beta.1.
    - The address of NRVO variables is now stored in scoped closures
      when they have nested references.
    - Using `__traits(parameters)' in foreach loops now always returns
      the parameters to the function the foreach appears within.
      Previously, when used inside a `foreach' using an overloaded
      `opApply', the trait would yield the parameters to the delegate.
    - The deprecation period of unannotated `asm' blocks has been ended.
    - The `inout' attribute no longer implies the `return' attribute.
    - Added new `D_PreConditions', `D_PostConditions', and
      `D_Invariants' version identifiers.

D runtime changes:

    - Import druntime v2.099.1-beta.1.

Phobos changes:

    - Import phobos v2.099.1-beta.1.
    - `Nullable' in `std.typecons' can now act as a range.
    - std.experimental.logger default level changed to `info' instead of
      `warning'.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 47871363d.
	* d-builtins.cc (d_init_versions): Add predefined version identifiers
	D_PreConditions, D_PostConditions, and D_Invariants.
	* d-codegen.cc (d_build_call): Update for new front-end interface.
	(build_frame_type): Generate reference field for NRVO variables with
	nested references.
	(build_closure): Generate assignment of return address to closure.
	* d-tree.h (DECL_INSTANTIATED): Use DECL_LANG_FLAG_2.
	(bind_expr): Remove.
	* decl.cc (DeclVisitor::visit (FuncDeclaration *)): Update for new
	front-end interface.
	(get_symbol_decl): Likewise.
	(get_decl_tree): Check DECL_LANG_FRAME_FIELD before DECL_LANG_NRVO.
	Dereference the field when both are set.
	* expr.cc (ExprVisitor::visit (DeleteExp *)): Update for new front-end
	interface.
	* modules.cc (get_internal_fn): Likewise.
	* toir.cc (IRVisitor::visit (ReturnStatement *)): Likewise.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime c52e28b7.
	* libdruntime/Makefile.am (DRUNTIME_DSOURCES_OPENBSD): Add
	core/sys/openbsd/pwd.d.
	* libdruntime/Makefile.in: Regenerate.
	* src/MERGE: Merge upstream phobos 99e9c1b77.
	* testsuite/libphobos.exceptions/message_with_null.d: New test.

gcc/testsuite/ChangeLog:

	* gdc.dg/nrvo1.d: New test.
2022-04-02 23:56:52 +02:00
GCC Administrator d156bb8702 Daily bump. 2022-03-22 00:16:44 +00:00
Iain Buclaw fbdaa58162 d: Merge upstream dmd 2503f17e5, phobos a74fa63e6.
D front-end changes:

    - Import dmd mainline development.
    - Removed internal d_intN and d_unsN aliases to stdint types, which
      caused a regression on Solaris where int8_t is a char (PR104911).

Phobos changes:

    - Import phobos mainline development.

	PR d/104911

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 2503f17e5.
	* d-convert.cc (convert_expr): Replace d_uns64 with dinteger_t.
	* d-lang.cc: Remove dmd/root/file.h include.
	(d_handle_option): Update for new front-end interface.
	(d_parse_file): Likewise.

libphobos/ChangeLog:

	* src/MERGE: Merge upstream phobos a74fa63e6.
2022-03-21 19:51:50 +01:00
GCC Administrator b9756c0858 Daily bump. 2022-03-14 00:16:20 +00:00
Iain Buclaw 7e28750395 d: Merge upstream dmd 02a3fafc6, druntime 26b58167, phobos 16cb085b5.
D front-end changes:

    - Import dmd v2.099.0.
    - The deprecation period for D1-style operators has ended, any use
      of the D1 overload operators will now result in a compiler error.
    - `scope' as a type constraint on class, struct, union, and enum
      declarations has been deprecated.
    - Fix segmentation fault when emplacing a new front-end Expression
      node during CTFE (PR104835).

D runtime changes:

    - Import druntime v2.099.0.
    - Fix C bindings for stdint types (PR104738).
    - Fix bus error when allocating new array on the GC (PR104742).
    - Fix bus error when allocating new pointer on the GC (PR104745).

Phobos changes:

    - Import phobos v2.099.0.
    - New function `bind' in `std.functional'.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 02a3fafc6.
	* dmd/VERSION: Update version to v2.099.0.
	* imports.cc (ImportVisitor::visit (EnumDeclaration *)): Don't cache
	decl in front-end AST node.
	(ImportVisitor::visit (AggregateDeclaration *)): Likewise.
	(ImportVisitor::visit (ClassDeclaration *)): Likewise.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 26b58167.
	* src/MERGE: Merge upstream phobos 16cb085b5.
2022-03-13 13:20:02 +01:00
GCC Administrator b00f9761b9 Daily bump. 2022-03-12 00:16:27 +00:00
Rainer Orth 1375e2b623 libphobos: Enable on Solaris/SPARC or with /bin/as [PR 103528]
libphobos is currently only enabled on Solaris/x86 with gas.  As
discovered when gdc was switched to the dmd frontend, this initially
broke bootstrap for the other Solaris configurations.

However, it's now well possible to enable it both for Solaris/x86 with
as and Solaris/SPARC (both as and gas) since the original problems (x86
as linelength limit, among others) are long gone.

The following patch does just that.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (both as and
gas) with gdc 9.3.0 (x86) resp. 9.4.0 (sparc, configured with
--enable-libphobos) as bootstrap compilers.

2021-12-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libphobos:
	PR d/103528
	* configure.ac <x86_64-*-solaris2.* | i?86-*-solaris2.*>: Remove
	gas requirement.
	* configure: Regenerate.
	* configure.tgt (sparc*-*-solaris2.11*): Mark supported.
2022-03-11 09:37:44 +01:00
GCC Administrator ea4911c4fa Daily bump. 2022-03-03 00:16:24 +00:00
Iain Buclaw 8977f4bec6 d: Merge upstream dmd 423f19b41, druntime 100a608c, phobos a1f8c4c07.
D Runtime changes:

    - Fix stdc.stdio bindings to not depend on druntime (PR104729).
    - Implement stdc.math for Solaris (PR104735).

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 423f19b41.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 100a608c.
	* src/MERGE: Merge upstream phobos a1f8c4c07.
2022-03-02 18:21:38 +01:00
GCC Administrator 12d4552e5e Daily bump. 2022-03-02 00:16:32 +00:00
Iain Buclaw 16ced9c654 libphobos: Fix misspelling of msvcUsesUCRT (PR104659)
libphobos/ChangeLog:

	PR d/104659
	* libdruntime/config/mingw/msvc.c (init_msvc): Fix misspelling of
	msvcUsesUCRT.
2022-03-01 15:29:30 +01:00
GCC Administrator a35f16971b Daily bump. 2022-03-01 00:16:28 +00:00
Iain Buclaw 1027dc4592 d: Merge upstream dmd cf63dd8e5, druntime caf14b0f, phobos 41aaf8c26.
D front-end changes:

    - Import dmd v2.099.0-rc.1.
    - The `main' can now return type `noreturn' and supports return
      inference.

D Runtime changes:

    - Import druntime v2.099.0-rc.1.
    - C bindings for stat_t on powerpc-linux has been fixed.

Phobos changes:

    - Import phobos v2.099.0-rc.1.

gcc/d/ChangeLog:

	* d-target.cc (Target::_init): Initialize C type size fields.
	* dmd/MERGE: Merge upstream dmd cf63dd8e5.
	* dmd/VERSION: Update version to v2.099.0-rc.1.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime caf14b0f.
	* src/MERGE: Merge upstream phobos 41aaf8c26.

gcc/testsuite/ChangeLog:

	* gdc.dg/torture/simd7413a.d: Update.
	* gdc.dg/ubsan/pr88957.d: Update.
	* gdc.dg/simd18489.d: New test.
	* gdc.dg/torture/simd21727.d: New test.
2022-02-28 17:49:01 +01:00
GCC Administrator c42f1e7734 Daily bump. 2022-02-21 00:16:24 +00:00
Iain Buclaw 6384eff56d d: Merge upstream dmd cb49e99f8, druntime 55528bd1, phobos 1a3e80ec2.
D front-end changes:

    - Import dmd v2.099.0-beta.1.
    - It's now an error to use `alias this' for partial assignment.
    - The `delete' keyword has been removed from the language.
    - Using `this' and `super' as types has been removed from the
      language, the parser no longer specially handles this wrong code
      with an informative error.

D Runtime changes:

    - Import druntime v2.099.0-beta.1.

Phobos changes:

    - Import phobos v2.099.0-beta.1.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd cb49e99f8.
	* dmd/VERSION: Update version to v2.099.0-beta.1.
	* decl.cc (layout_class_initializer): Update call to NewExp::create.
	* expr.cc (ExprVisitor::visit (DeleteExp *)): Remove handling of
	deleting arrays and pointers.
	(ExprVisitor::visit (DotVarExp *)): Convert complex types to the
	front-end library type representing them.
	(ExprVisitor::visit (StringExp *)): Use getCodeUnit instead of charAt
	to get the value of each index in a string expression.
	* runtime.def (DELMEMORY): Remove.
	(DELARRAYT): Remove.
	* types.cc (TypeVisitor::visit (TypeEnum *)): Handle anonymous enums.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 55528bd1.
	* src/MERGE: Merge upstream phobos 1a3e80ec2.
	* testsuite/libphobos.hash/test_hash.d: Update.
	* testsuite/libphobos.betterc/test19933.d: New test.
2022-02-20 23:37:32 +01:00
GCC Administrator cb3afcd2a3 Daily bump. 2022-02-17 00:16:36 +00:00