Skip to content
Snippets Groups Projects
  1. Nov 22, 2024
    • Andrew Pinski's avatar
      build: Remove INCLUDE_MEMORY [PR117737] · b3f1b9e2
      Andrew Pinski authored
      
      Since diagnostic.h is included in over half of the sources, requiring to `#define INCLUDE_MEMORY`
      does not make sense. Instead lets unconditionally include memory in system.h.
      
      The majority of this patch is just removing `#define INCLUDE_MEMORY` from the sources which currently
      have it.
      
      This should also fix the mingw build issue but I have not tried it.
      
      Bootstrapped and tested on x86_64-linux-gnu.
      
      	PR bootstrap/117737
      gcc/ada/ChangeLog:
      
      	* gcc-interface/misc.cc (INCLUDE_MEMORY): Remove.
      	* gcc-interface/trans.cc (INCLUDE_MEMORY): Remove.
      	* gcc-interface/utils.cc (INCLUDE_MEMORY): Remove.
      
      gcc/analyzer/ChangeLog:
      
      	* access-diagram.cc (INCLUDE_MEMORY): Remove.
      	* analysis-plan.cc (INCLUDE_MEMORY): Remove.
      	* analyzer-language.cc (INCLUDE_MEMORY): Remove.
      	* analyzer-logging.cc (INCLUDE_MEMORY): Remove.
      	* analyzer-pass.cc (INCLUDE_MEMORY): Remove.
      	* analyzer-selftests.cc (INCLUDE_MEMORY): Remove.
      	* analyzer.cc (INCLUDE_MEMORY): Remove.
      	* bar-chart.cc (INCLUDE_MEMORY): Remove.
      	* bounds-checking.cc (INCLUDE_MEMORY): Remove.
      	* call-details.cc (INCLUDE_MEMORY): Remove.
      	* call-info.cc (INCLUDE_MEMORY): Remove.
      	* call-string.cc (INCLUDE_MEMORY): Remove.
      	* call-summary.cc (INCLUDE_MEMORY): Remove.
      	* checker-event.cc (INCLUDE_MEMORY): Remove.
      	* checker-path.cc (INCLUDE_MEMORY): Remove.
      	* complexity.cc (INCLUDE_MEMORY): Remove.
      	* constraint-manager.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic-manager.cc (INCLUDE_MEMORY): Remove.
      	* engine.cc (INCLUDE_MEMORY): Remove.
      	* feasible-graph.cc (INCLUDE_MEMORY): Remove.
      	* infinite-loop.cc (INCLUDE_MEMORY): Remove.
      	* infinite-recursion.cc (INCLUDE_MEMORY): Remove.
      	* kf-analyzer.cc (INCLUDE_MEMORY): Remove.
      	* kf-lang-cp.cc (INCLUDE_MEMORY): Remove.
      	* kf.cc (INCLUDE_MEMORY): Remove.
      	* known-function-manager.cc (INCLUDE_MEMORY): Remove.
      	* pending-diagnostic.cc (INCLUDE_MEMORY): Remove.
      	* program-point.cc (INCLUDE_MEMORY): Remove.
      	* program-state.cc (INCLUDE_MEMORY): Remove.
      	* ranges.cc (INCLUDE_MEMORY): Remove.
      	* record-layout.cc (INCLUDE_MEMORY): Remove.
      	* region-model-asm.cc (INCLUDE_MEMORY): Remove.
      	* region-model-manager.cc (INCLUDE_MEMORY): Remove.
      	* region-model-reachability.cc (INCLUDE_MEMORY): Remove.
      	* region-model.cc (INCLUDE_MEMORY): Remove.
      	* region.cc (INCLUDE_MEMORY): Remove.
      	* sm-fd.cc (INCLUDE_MEMORY): Remove.
      	* sm-file.cc (INCLUDE_MEMORY): Remove.
      	* sm-malloc.cc (INCLUDE_MEMORY): Remove.
      	* sm-pattern-test.cc (INCLUDE_MEMORY): Remove.
      	* sm-sensitive.cc (INCLUDE_MEMORY): Remove.
      	* sm-signal.cc (INCLUDE_MEMORY): Remove.
      	* sm-taint.cc (INCLUDE_MEMORY): Remove.
      	* sm.cc (INCLUDE_MEMORY): Remove.
      	* state-purge.cc (INCLUDE_MEMORY): Remove.
      	* store.cc (INCLUDE_MEMORY): Remove.
      	* supergraph.cc (INCLUDE_MEMORY): Remove.
      	* svalue.cc (INCLUDE_MEMORY): Remove.
      	* symbol.cc (INCLUDE_MEMORY): Remove.
      	* trimmed-graph.cc (INCLUDE_MEMORY): Remove.
      	* varargs.cc (INCLUDE_MEMORY): Remove.
      
      gcc/ChangeLog:
      
      	* asan.cc (INCLUDE_MEMORY): Remove.
      	* attribs.cc (INCLUDE_MEMORY): Remove.
      	* auto-profile.cc (INCLUDE_MEMORY): Remove.
      	* calls.cc (INCLUDE_MEMORY): Remove.
      	* cfganal.cc (INCLUDE_MEMORY): Remove.
      	* cfgexpand.cc (INCLUDE_MEMORY): Remove.
      	* cfghooks.cc (INCLUDE_MEMORY): Remove.
      	* cfgloop.cc (INCLUDE_MEMORY): Remove.
      	* cgraph.cc (INCLUDE_MEMORY): Remove.
      	* cgraphclones.cc (INCLUDE_MEMORY): Remove.
      	* cgraphunit.cc (INCLUDE_MEMORY): Remove.
      	* collect-utils.cc (INCLUDE_MEMORY): Remove.
      	* collect2.cc (INCLUDE_MEMORY): Remove.
      	* common/config/aarch64/aarch64-common.cc (INCLUDE_MEMORY): Remove.
      	* common/config/arm/arm-common.cc (INCLUDE_MEMORY): Remove.
      	* common/config/avr/avr-common.cc (INCLUDE_MEMORY): Remove.
      	* config/aarch64/aarch64-cc-fusion.cc (INCLUDE_MEMORY): Remove.
      	* config/aarch64/aarch64-early-ra.cc (INCLUDE_MEMORY): Remove.
      	* config/aarch64/aarch64-sve-builtins.cc (INCLUDE_MEMORY): Remove.
      	* config/aarch64/aarch64.cc (INCLUDE_MEMORY): Remove.
      	* config/arc/arc.cc (INCLUDE_MEMORY): Remove.
      	* config/arm/aarch-common.cc (INCLUDE_MEMORY) Remove.:
      	* config/arm/arm-mve-builtins.cc (INCLUDE_MEMORY): Remove.
      	* config/arm/arm.cc (INCLUDE_MEMORY): Remove.
      	* config/avr/avr-devices.cc (INCLUDE_MEMORY): Remove.
      	* config/avr/driver-avr.cc (INCLUDE_MEMORY): Remove.
      	* config/bpf/bpf.cc (INCLUDE_MEMORY): Remove.
      	* config/bpf/btfext-out.cc (INCLUDE_MEMORY): Remove.
      	* config/bpf/core-builtins.cc (INCLUDE_MEMORY): Remove.
      	* config/darwin.cc (INCLUDE_MEMORY): Remove.
      	* config/gcn/mkoffload.cc (INCLUDE_MEMORY): Remove.
      	* config/i386/driver-i386.cc (INCLUDE_MEMORY): Remove.
      	* config/i386/i386-builtins.cc (INCLUDE_MEMORY): Remove.
      	* config/i386/i386-expand.cc (INCLUDE_MEMORY): Remove.
      	* config/i386/i386-features.cc (INCLUDE_MEMORY): Remove.
      	* config/i386/i386-options.cc (INCLUDE_MEMORY): Remove.
      	* config/i386/i386.cc (INCLUDE_MEMORY): Remove.
      	* config/loongarch/loongarch-builtins.cc (INCLUDE_MEMORY): Remove.
      	* config/loongarch/loongarch.cc (INCLUDE_MEMORY): Remove.
      	* config/mingw/winnt-cxx.cc (INCLUDE_MEMORY): Remove.
      	* config/mingw/winnt.cc (INCLUDE_MEMORY): Remove.
      	* config/mips/mips.cc (INCLUDE_MEMORY): Remove.
      	* config/msp430/driver-msp430.cc (INCLUDE_MEMORY): Remove.
      	* config/nvptx/mkoffload.cc (INCLUDE_MEMORY): Remove.
      	* config/nvptx/nvptx.cc (INCLUDE_MEMORY): Remove.
      	* config/riscv/riscv-avlprop.cc (INCLUDE_MEMORY): Remove.
      	* config/riscv/riscv-target-attr.cc (INCLUDE_MEMORY): Remove.
      	* config/riscv/riscv-vector-builtins.cc (INCLUDE_MEMORY): Remove.
      	* config/riscv/riscv-vector-costs.cc (INCLUDE_MEMORY): Remove.
      	* config/riscv/riscv-vsetvl.cc (INCLUDE_MEMORY): Remove.
      	* config/riscv/riscv.cc (INCLUDE_MEMORY): Remove.
      	* config/rs6000/driver-rs6000.cc (INCLUDE_MEMORY): Remove.
      	* config/rs6000/host-darwin.cc (INCLUDE_MEMORY): Remove.
      	* config/rs6000/rs6000-c.cc (INCLUDE_MEMORY): Remove.
      	* config/rs6000/rs6000.cc (INCLUDE_MEMORY): Remove.
      	* config/s390/s390-c.cc (INCLUDE_MEMORY): Remove.
      	* config/s390/s390.cc (INCLUDE_MEMORY): Remove.
      	* config/sol2-cxx.cc (INCLUDE_MEMORY): Remove.
      	* config/vms/vms-c.cc (INCLUDE_MEMORY): Remove.
      	* config/xtensa/xtensa-dynconfig.cc (INCLUDE_MEMORY): Remove.
      	* coroutine-passes.cc (INCLUDE_MEMORY): Remove.
      	* coverage.cc (INCLUDE_MEMORY): Remove.
      	* data-streamer-in.cc (INCLUDE_MEMORY): Remove.
      	* data-streamer-out.cc (INCLUDE_MEMORY): Remove.
      	* data-streamer.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic-format-json.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic-format-sarif.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic-format-text.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic-global-context.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic-macro-unwinding.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic-path.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic-show-locus.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic-spec.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic.cc (INCLUDE_MEMORY): Remove.
      	* diagnostic.h: Remove check for INCLUDE_MEMORY.
      	* digraph.cc (INCLUDE_MEMORY): Remove.
      	* dumpfile.cc (INCLUDE_MEMORY): Remove.
      	* dwarf2out.cc (INCLUDE_MEMORY): Remove.
      	* edit-context.cc (INCLUDE_MEMORY): Remove.
      	* except.cc (INCLUDE_MEMORY): Remove.
      	* expr.cc (INCLUDE_MEMORY): Remove.
      	* file-prefix-map.cc (INCLUDE_MEMORY): Remove.
      	* final.cc (INCLUDE_MEMORY): Remove.
      	* fwprop.cc (INCLUDE_MEMORY): Remove.
      	* gcc-plugin.h (INCLUDE_MEMORY): Remove.
      	* gcc-rich-location.cc (INCLUDE_MEMORY): Remove.
      	* gcc-urlifier.cc (INCLUDE_MEMORY): Remove.
      	* gcc.cc (INCLUDE_MEMORY): Remove.
      	* gcov-dump.cc (INCLUDE_MEMORY): Remove.
      	* gcov-tool.cc (INCLUDE_MEMORY): Remove.
      	* gcov.cc (INCLUDE_MEMORY): Remove.
      	* gengtype.cc (open_base_files): Don't print `#define INCLUDE_MEMORY`.
      	* genmatch.cc (INCLUDE_MEMORY): Remove.
      	* gimple-fold.cc (INCLUDE_MEMORY): Remove.
      	* gimple-harden-conditionals.cc (INCLUDE_MEMORY): Remove.
      	* gimple-harden-control-flow.cc (INCLUDE_MEMORY): Remove.
      	* gimple-if-to-switch.cc (INCLUDE_MEMORY): Remove.
      	* gimple-loop-interchange.cc (INCLUDE_MEMORY): Remove.
      	* gimple-loop-jam.cc (INCLUDE_MEMORY): Remove.
      	* gimple-loop-versioning.cc (INCLUDE_MEMORY): Remove.
      	* gimple-lower-bitint.cc (INCLUDE_MEMORY): Remove.
      	* gimple-predicate-analysis.cc (INCLUDE_MEMORY): Remove.
      	* gimple-pretty-print.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range-cache.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range-edge.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range-fold.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range-gori.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range-infer.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range-op.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range-path.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range-phi.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range-trace.cc (INCLUDE_MEMORY): Remove.
      	* gimple-range.cc (INCLUDE_MEMORY): Remove.
      	* gimple-ssa-backprop.cc (INCLUDE_MEMORY): Remove.
      	* gimple-ssa-sprintf.cc (INCLUDE_MEMORY): Remove.
      	* gimple-ssa-store-merging.cc (INCLUDE_MEMORY): Remove.
      	* gimple-ssa-strength-reduction.cc (INCLUDE_MEMORY): Remove.
      	* gimple-ssa-warn-access.cc (INCLUDE_MEMORY): Remove.
      	* gimple-ssa-warn-alloca.cc (INCLUDE_MEMORY): Remove.
      	* gimple-ssa-warn-restrict.cc (INCLUDE_MEMORY): Remove.
      	* gimple-streamer-in.cc (INCLUDE_MEMORY): Remove.
      	* gimple-streamer-out.cc (INCLUDE_MEMORY): Remove.
      	* gimple.cc (INCLUDE_MEMORY): Remove.
      	* gimplify.cc (INCLUDE_MEMORY): Remove.
      	* graph.cc (INCLUDE_MEMORY): Remove.
      	* graphite-dependences.cc (INCLUDE_MEMORY): Remove.
      	* graphite-isl-ast-to-gimple.cc (INCLUDE_MEMORY): Remove.
      	* graphite-optimize-isl.cc (INCLUDE_MEMORY): Remove.
      	* graphite-poly.cc (INCLUDE_MEMORY): Remove.
      	* graphite-scop-detection.cc (INCLUDE_MEMORY): Remove.
      	* graphite-sese-to-poly.cc (INCLUDE_MEMORY): Remove.
      	* graphite.cc (INCLUDE_MEMORY): Remove.
      	* graphviz.cc (INCLUDE_MEMORY): Remove.
      	* input.cc (INCLUDE_MEMORY): Remove.
      	* ipa-cp.cc (INCLUDE_MEMORY): Remove.
      	* ipa-devirt.cc (INCLUDE_MEMORY): Remove.
      	* ipa-fnsummary.cc (INCLUDE_MEMORY): Remove.
      	* ipa-free-lang-data.cc (INCLUDE_MEMORY): Remove.
      	* ipa-icf-gimple.cc (INCLUDE_MEMORY): Remove.
      	* ipa-icf.cc (INCLUDE_MEMORY): Remove.
      	* ipa-inline-analysis.cc (INCLUDE_MEMORY): Remove.
      	* ipa-inline.cc (INCLUDE_MEMORY): Remove.
      	* ipa-modref-tree.cc (INCLUDE_MEMORY): Remove.
      	* ipa-modref.cc (INCLUDE_MEMORY): Remove.
      	* ipa-param-manipulation.cc (INCLUDE_MEMORY): Remove.
      	* ipa-polymorphic-call.cc (INCLUDE_MEMORY): Remove.
      	* ipa-predicate.cc (INCLUDE_MEMORY): Remove.
      	* ipa-profile.cc (INCLUDE_MEMORY): Remove.
      	* ipa-prop.cc (INCLUDE_MEMORY): Remove.
      	* ipa-pure-const.cc (INCLUDE_MEMORY): Remove.
      	* ipa-reference.cc (INCLUDE_MEMORY): Remove.
      	* ipa-split.cc (INCLUDE_MEMORY): Remove.
      	* ipa-sra.cc (INCLUDE_MEMORY): Remove.
      	* ipa-strub.cc (INCLUDE_MEMORY): Remove.
      	* ipa-utils.cc (INCLUDE_MEMORY): Remove.
      	* json-parsing.cc (INCLUDE_MEMORY): Remove.
      	* json.cc (INCLUDE_MEMORY): Remove.
      	* json.h: Don't check INCLUDE_MEMORY.
      	* langhooks.cc (INCLUDE_MEMORY): Remove.
      	* late-combine.cc (INCLUDE_MEMORY): Remove.
      	* lazy-diagnostic-path.cc (INCLUDE_MEMORY): Remove.
      	* libdiagnostics.cc (INCLUDE_MEMORY): Remove.
      	* libsarifreplay.cc (INCLUDE_MEMORY): Remove.
      	* lto-cgraph.cc (INCLUDE_MEMORY): Remove.
      	* lto-compress.cc (INCLUDE_MEMORY): Remove.
      	* lto-opts.cc (INCLUDE_MEMORY): Remove.
      	* lto-section-in.cc (INCLUDE_MEMORY): Remove.
      	* lto-section-out.cc (INCLUDE_MEMORY): Remove.
      	* lto-streamer-in.cc (INCLUDE_MEMORY): Remove.
      	* lto-streamer-out.cc (INCLUDE_MEMORY): Remove.
      	* lto-streamer.cc (INCLUDE_MEMORY): Remove.
      	* lto-wrapper.cc (INCLUDE_MEMORY): Remove.
      	* make-unique.h (GCC_MAKE_UNIQUE): Remove.
      	* multiple_target.cc (INCLUDE_MEMORY): Remove.
      	* omp-expand.cc (INCLUDE_MEMORY): Remove.
      	* omp-general.cc (INCLUDE_MEMORY): Remove.
      	* omp-low.cc (INCLUDE_MEMORY): Remove.
      	* omp-oacc-neuter-broadcast.cc (INCLUDE_MEMORY): Remove.
      	* omp-offload.cc (INCLUDE_MEMORY): Remove.
      	* omp-simd-clone.cc (INCLUDE_MEMORY): Remove.
      	* opt-problem.cc (INCLUDE_MEMORY): Remove.
      	* optinfo-emit-json.cc (INCLUDE_MEMORY): Remove.
      	* optinfo.cc (INCLUDE_MEMORY): Remove.
      	* optinfo.h: Don't check INCLUDE_MEMORY.
      	* opts-common.cc (INCLUDE_MEMORY): Remove.
      	* opts-diagnostic.cc (INCLUDE_MEMORY): Remove.
      	* opts-global.cc (INCLUDE_MEMORY): Remove.
      	* opts.cc (INCLUDE_MEMORY): Remove.
      	* pair-fusion.cc (INCLUDE_MEMORY): Remove.
      	* passes.cc (INCLUDE_MEMORY): Remove.
      	* pointer-query.cc (INCLUDE_MEMORY): Remove.
      	* predict.cc (INCLUDE_MEMORY): Remove.
      	* pretty-print.cc (INCLUDE_MEMORY): Remove.
      	* pretty-print.h: Don't check INCLUDE_MEMORY.
      	* print-rtl.cc (INCLUDE_MEMORY): Remove.
      	* print-tree.cc (INCLUDE_MEMORY): Remove.
      	* profile-count.cc (INCLUDE_MEMORY): Remove.
      	* range-op-float.cc (INCLUDE_MEMORY): Remove.
      	* range-op-ptr.cc (INCLUDE_MEMORY): Remove.
      	* range-op.cc (INCLUDE_MEMORY): Remove.
      	* range.cc (INCLUDE_MEMORY): Remove.
      	* read-rtl-function.cc (INCLUDE_MEMORY): Remove.
      	* rtl-error.cc (INCLUDE_MEMORY): Remove.
      	* rtl-ssa/accesses.cc (INCLUDE_MEMORY): Remove.
      	* rtl-ssa/blocks.cc (INCLUDE_MEMORY): Remove.
      	* rtl-ssa/changes.cc (INCLUDE_MEMORY): Remove.
      	* rtl-ssa/functions.cc (INCLUDE_MEMORY): Remove.
      	* rtl-ssa/insns.cc (INCLUDE_MEMORY): Remove.
      	* rtl-ssa/movement.cc (INCLUDE_MEMORY): Remove.
      	* rtl-tests.cc (INCLUDE_MEMORY): Remove.
      	* sanopt.cc (INCLUDE_MEMORY): Remove.
      	* sched-rgn.cc (INCLUDE_MEMORY): Remove.
      	* selftest-diagnostic-path.cc (INCLUDE_MEMORY): Remove.
      	* selftest-diagnostic.cc (INCLUDE_MEMORY): Remove.
      	* selftest-json.cc (INCLUDE_MEMORY): Remove.
      	* sese.cc (INCLUDE_MEMORY): Remove.
      	* simple-diagnostic-path.cc (INCLUDE_MEMORY): Remove.
      	* splay-tree-utils.cc (INCLUDE_MEMORY): Remove.
      	* sreal.cc (INCLUDE_MEMORY): Remove.
      	* stmt.cc (INCLUDE_MEMORY): Remove.
      	* substring-locations.cc (INCLUDE_MEMORY): Remove.
      	* symtab-clones.cc (INCLUDE_MEMORY): Remove.
      	* symtab-thunks.cc (INCLUDE_MEMORY): Remove.
      	* symtab.cc (INCLUDE_MEMORY): Remove.
      	* system.h: Include memory unconditionally for C++.
      	Also remove support for INCLUDE_MEMORY.
      	* targhooks.cc (INCLUDE_MEMORY): Remove.
      	* text-art/box-drawing.cc (INCLUDE_MEMORY): Remove.
      	* text-art/canvas.cc (INCLUDE_MEMORY): Remove.
      	* text-art/ruler.cc (INCLUDE_MEMORY): Remove.
      	* text-art/selftests.cc (INCLUDE_MEMORY): Remove.
      	* text-art/style.cc (INCLUDE_MEMORY): Remove.
      	* text-art/styled-string.cc (INCLUDE_MEMORY): Remove.
      	* text-art/table.cc (INCLUDE_MEMORY): Remove.
      	* text-art/theme.cc (INCLUDE_MEMORY): Remove.
      	* text-art/tree-widget.cc (INCLUDE_MEMORY): Remove.
      	* text-art/widget.cc (INCLUDE_MEMORY): Remove.
      	* timevar.cc (INCLUDE_MEMORY): Remove.
      	* toplev.cc (INCLUDE_MEMORY): Remove.
      	* trans-mem.cc (INCLUDE_MEMORY): Remove.
      	* tree-affine.cc (INCLUDE_MEMORY): Remove.
      	* tree-assume.cc (INCLUDE_MEMORY): Remove.
      	* tree-call-cdce.cc (INCLUDE_MEMORY): Remove.
      	* tree-cfg.cc (INCLUDE_MEMORY): Remove.
      	* tree-chrec.cc (INCLUDE_MEMORY): Remove.
      	* tree-data-ref.cc (INCLUDE_MEMORY): Remove.
      	* tree-dfa.cc (INCLUDE_MEMORY): Remove.
      	* tree-diagnostic-client-data-hooks.cc (INCLUDE_MEMORY): Remove.
      	* tree-diagnostic.cc (INCLUDE_MEMORY): Remove.
      	* tree-dump.cc (INCLUDE_MEMORY): Remove.
      	* tree-if-conv.cc (INCLUDE_MEMORY): Remove.
      	* tree-inline.cc (INCLUDE_MEMORY): Remove.
      	* tree-into-ssa.cc (INCLUDE_MEMORY): Remove.
      	* tree-logical-location.cc (INCLUDE_MEMORY): Remove.
      	* tree-loop-distribution.cc (INCLUDE_MEMORY): Remove.
      	* tree-nested.cc (INCLUDE_MEMORY): Remove.
      	* tree-nrv.cc (INCLUDE_MEMORY): Remove.
      	* tree-object-size.cc (INCLUDE_MEMORY): Remove.
      	* tree-outof-ssa.cc (INCLUDE_MEMORY): Remove.
      	* tree-parloops.cc (INCLUDE_MEMORY): Remove.
      	* tree-predcom.cc (INCLUDE_MEMORY): Remove.
      	* tree-pretty-print.cc (INCLUDE_MEMORY): Remove.
      	* tree-profile.cc (INCLUDE_MEMORY): Remove.
      	* tree-scalar-evolution.cc (INCLUDE_MEMORY): Remove.
      	* tree-sra.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-address.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-alias.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-ccp.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-coalesce.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-copy.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-dce.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-dom.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-dse.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-forwprop.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-ifcombine.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-live.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-loop-ch.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-loop-im.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-loop-ivcanon.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-loop-ivopts.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-loop-manip.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-loop-niter.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-loop-prefetch.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-loop-split.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-loop-unswitch.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-math-opts.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-operands.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-phiopt.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-phiprop.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-pre.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-propagate.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-reassoc.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-sccvn.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-scopedtables.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-sink.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-strlen.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-structalias.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-ter.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-threadbackward.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-threadupdate.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa-uninit.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssa.cc (INCLUDE_MEMORY): Remove.
      	* tree-ssanames.cc (INCLUDE_MEMORY): Remove.
      	* tree-stdarg.cc (INCLUDE_MEMORY): Remove.
      	* tree-streamer-in.cc (INCLUDE_MEMORY): Remove.
      	* tree-streamer-out.cc (INCLUDE_MEMORY): Remove.
      	* tree-streamer.cc (INCLUDE_MEMORY): Remove.
      	* tree-switch-conversion.cc (INCLUDE_MEMORY): Remove.
      	* tree-tailcall.cc (INCLUDE_MEMORY): Remove.
      	* tree-vect-data-refs.cc (INCLUDE_MEMORY): Remove.
      	* tree-vect-generic.cc (INCLUDE_MEMORY): Remove.
      	* tree-vect-loop-manip.cc (INCLUDE_MEMORY): Remove.
      	* tree-vect-loop.cc (INCLUDE_MEMORY): Remove.
      	* tree-vect-patterns.cc (INCLUDE_MEMORY): Remove.
      	* tree-vect-slp-patterns.cc (INCLUDE_MEMORY): Remove.
      	* tree-vect-slp.cc (INCLUDE_MEMORY): Remove.
      	* tree-vect-stmts.cc (INCLUDE_MEMORY): Remove.
      	* tree-vectorizer.cc (INCLUDE_MEMORY): Remove.
      	* tree-vrp.cc (INCLUDE_MEMORY): Remove.
      	* tree.cc (INCLUDE_MEMORY): Remove.
      	* ubsan.cc (INCLUDE_MEMORY): Remove.
      	* value-pointer-equiv.cc (INCLUDE_MEMORY): Remove.
      	* value-prof.cc (INCLUDE_MEMORY): Remove.
      	* value-query.cc (INCLUDE_MEMORY): Remove.
      	* value-range-pretty-print.cc (INCLUDE_MEMORY): Remove.
      	* value-range-storage.cc (INCLUDE_MEMORY): Remove.
      	* value-range.cc (INCLUDE_MEMORY): Remove.
      	* value-relation.cc (INCLUDE_MEMORY): Remove.
      	* var-tracking.cc (INCLUDE_MEMORY): Remove.
      	* varpool.cc (INCLUDE_MEMORY): Remove.
      	* vr-values.cc (INCLUDE_MEMORY): Remove.
      	* wide-int-print.cc (INCLUDE_MEMORY): Remove.
      
      gcc/c-family/ChangeLog:
      
      	* c-ada-spec.cc (INCLUDE_MEMORY): Remove.
      	* c-attribs.cc (INCLUDE_MEMORY): Remove.
      	* c-common.cc (INCLUDE_MEMORY): Remove.
      	* c-format.cc (INCLUDE_MEMORY): Remove.
      	* c-gimplify.cc (INCLUDE_MEMORY): Remove.
      	* c-indentation.cc (INCLUDE_MEMORY): Remove.
      	* c-opts.cc (INCLUDE_MEMORY): Remove.
      	* c-pch.cc (INCLUDE_MEMORY): Remove.
      	* c-pragma.cc (INCLUDE_MEMORY): Remove.
      	* c-pretty-print.cc (INCLUDE_MEMORY): Remove.
      	* c-type-mismatch.cc (INCLUDE_MEMORY): Remove.
      	* c-warn.cc (INCLUDE_MEMORY): Remove.
      	* known-headers.cc (INCLUDE_MEMORY): Remove.
      	* name-hint.h: Remove check of INCLUDE_MEMORY.
      
      gcc/c/ChangeLog:
      
      	* c-aux-info.cc (INCLUDE_MEMORY): Remove.
      	* c-convert.cc (INCLUDE_MEMORY): Remove.
      	* c-decl.cc (INCLUDE_MEMORY): Remove.
      	* c-errors.cc (INCLUDE_MEMORY): Remove.
      	* c-fold.cc (INCLUDE_MEMORY): Remove.
      	* c-lang.cc (INCLUDE_MEMORY): Remove.
      	* c-objc-common.cc (INCLUDE_MEMORY): Remove.
      	* c-parser.cc (INCLUDE_MEMORY): Remove.
      	* c-typeck.cc (INCLUDE_MEMORY): Remove.
      	* gimple-parser.cc (INCLUDE_MEMORY): Remove.
      
      gcc/cp/ChangeLog:
      
      	* call.cc (INCLUDE_MEMORY): Remove.
      	* class.cc (INCLUDE_MEMORY): Remove.
      	* constexpr.cc (INCLUDE_MEMORY): Remove.
      	* constraint.cc (INCLUDE_MEMORY): Remove.
      	* contracts.cc (INCLUDE_MEMORY): Remove.
      	* coroutines.cc (INCLUDE_MEMORY): Remove.
      	* cp-gimplify.cc (INCLUDE_MEMORY): Remove.
      	* cp-lang.cc (INCLUDE_MEMORY): Remove.
      	* cp-objcp-common.cc (INCLUDE_MEMORY): Remove.
      	* cp-ubsan.cc (INCLUDE_MEMORY): Remove.
      	* cvt.cc (INCLUDE_MEMORY): Remove.
      	* cxx-pretty-print.cc (INCLUDE_MEMORY): Remove.
      	* decl.cc (INCLUDE_MEMORY): Remove.
      	* decl2.cc (INCLUDE_MEMORY): Remove.
      	* dump.cc (INCLUDE_MEMORY): Remove.
      	* error.cc (INCLUDE_MEMORY): Remove.
      	* except.cc (INCLUDE_MEMORY): Remove.
      	* expr.cc (INCLUDE_MEMORY): Remove.
      	* friend.cc (INCLUDE_MEMORY): Remove.
      	* init.cc (INCLUDE_MEMORY): Remove.
      	* lambda.cc (INCLUDE_MEMORY): Remove.
      	* lex.cc (INCLUDE_MEMORY): Remove.
      	* logic.cc (INCLUDE_MEMORY): Remove.
      	* mangle.cc (INCLUDE_MEMORY): Remove.
      	* mapper-client.cc (INCLUDE_MEMORY): Remove.
      	* mapper-resolver.cc (INCLUDE_MEMORY): Remove.
      	* method.cc (INCLUDE_MEMORY): Remove.
      	* module.cc (INCLUDE_MEMORY): Remove.
      	* name-lookup.cc (INCLUDE_MEMORY): Remove.
      	* optimize.cc (INCLUDE_MEMORY): Remove.
      	* parser.cc (INCLUDE_MEMORY): Remove.
      	* pt.cc (INCLUDE_MEMORY): Remove.
      	* ptree.cc (INCLUDE_MEMORY): Remove.
      	* rtti.cc (INCLUDE_MEMORY): Remove.
      	* search.cc (INCLUDE_MEMORY): Remove.
      	* semantics.cc (INCLUDE_MEMORY): Remove.
      	* tree.cc (INCLUDE_MEMORY): Remove.
      	* typeck.cc (INCLUDE_MEMORY): Remove.
      	* typeck2.cc (INCLUDE_MEMORY): Remove.
      	* vtable-class-hierarchy.cc (INCLUDE_MEMORY): Remove.
      
      gcc/d/ChangeLog:
      
      	* d-attribs.cc (INCLUDE_MEMORY): Remove.
      	* d-builtins.cc (INCLUDE_MEMORY): Remove.
      	* d-codegen.cc (INCLUDE_MEMORY): Remove.
      	* d-convert.cc (INCLUDE_MEMORY): Remove.
      	* d-diagnostic.cc (INCLUDE_MEMORY): Remove.
      	* d-frontend.cc (INCLUDE_MEMORY): Remove.
      	* d-lang.cc (INCLUDE_MEMORY): Remove.
      	* d-longdouble.cc (INCLUDE_MEMORY): Remove.
      	* d-target.cc (INCLUDE_MEMORY): Remove.
      	* decl.cc (INCLUDE_MEMORY): Remove.
      	* expr.cc (INCLUDE_MEMORY): Remove.
      	* intrinsics.cc (INCLUDE_MEMORY): Remove.
      	* modules.cc (INCLUDE_MEMORY): Remove.
      	* toir.cc (INCLUDE_MEMORY): Remove.
      	* typeinfo.cc (INCLUDE_MEMORY): Remove.
      	* types.cc (INCLUDE_MEMORY): Remove.
      
      gcc/fortran/ChangeLog:
      
      	* arith.cc (INCLUDE_MEMORY): Remove.
      	* array.cc (INCLUDE_MEMORY): Remove.
      	* bbt.cc (INCLUDE_MEMORY): Remove.
      	* check.cc (INCLUDE_MEMORY): Remove.
      	* class.cc (INCLUDE_MEMORY): Remove.
      	* constructor.cc (INCLUDE_MEMORY): Remove.
      	* convert.cc (INCLUDE_MEMORY): Remove.
      	* cpp.cc (INCLUDE_MEMORY): Remove.
      	* data.cc (INCLUDE_MEMORY): Remove.
      	* decl.cc (INCLUDE_MEMORY): Remove.
      	* dependency.cc (INCLUDE_MEMORY): Remove.
      	* dump-parse-tree.cc (INCLUDE_MEMORY): Remove.
      	* error.cc (INCLUDE_MEMORY): Remove.
      	* expr.cc (INCLUDE_MEMORY): Remove.
      	* f95-lang.cc (INCLUDE_MEMORY): Remove.
      	* frontend-passes.cc (INCLUDE_MEMORY): Remove.
      	* interface.cc (INCLUDE_MEMORY): Remove.
      	* intrinsic.cc (INCLUDE_MEMORY): Remove.
      	* io.cc (INCLUDE_MEMORY): Remove.
      	* iresolve.cc (INCLUDE_MEMORY): Remove.
      	* match.cc (INCLUDE_MEMORY): Remove.
      	* matchexp.cc (INCLUDE_MEMORY): Remove.
      	* misc.cc (INCLUDE_MEMORY): Remove.
      	* module.cc (INCLUDE_MEMORY): Remove.
      	* openmp.cc (INCLUDE_MEMORY): Remove.
      	* options.cc (INCLUDE_MEMORY): Remove.
      	* parse.cc (INCLUDE_MEMORY): Remove.
      	* primary.cc (INCLUDE_MEMORY): Remove.
      	* resolve.cc (INCLUDE_MEMORY): Remove.
      	* scanner.cc (INCLUDE_MEMORY): Remove.
      	* simplify.cc (INCLUDE_MEMORY): Remove.
      	* st.cc (INCLUDE_MEMORY): Remove.
      	* symbol.cc (INCLUDE_MEMORY): Remove.
      	* target-memory.cc (INCLUDE_MEMORY): Remove.
      	* trans-array.cc (INCLUDE_MEMORY): Remove.
      	* trans-common.cc (INCLUDE_MEMORY): Remove.
      	* trans-const.cc (INCLUDE_MEMORY): Remove.
      	* trans-decl.cc (INCLUDE_MEMORY): Remove.
      	* trans-expr.cc (INCLUDE_MEMORY): Remove.
      	* trans-intrinsic.cc (INCLUDE_MEMORY): Remove.
      	* trans-io.cc (INCLUDE_MEMORY): Remove.
      	* trans-openmp.cc (INCLUDE_MEMORY): Remove.
      	* trans-stmt.cc (INCLUDE_MEMORY): Remove.
      	* trans-types.cc (INCLUDE_MEMORY): Remove.
      	* trans.cc (INCLUDE_MEMORY): Remove.
      
      gcc/go/ChangeLog:
      
      	* go-backend.cc (INCLUDE_MEMORY): Remove.
      	* go-lang.cc (INCLUDE_MEMORY): Remove.
      
      gcc/jit/ChangeLog:
      
      	* dummy-frontend.cc (INCLUDE_MEMORY): Remove.
      	* jit-playback.cc (INCLUDE_MEMORY): Remove.
      	* jit-recording.cc (INCLUDE_MEMORY): Remove.
      
      gcc/lto/ChangeLog:
      
      	* lto-common.cc (INCLUDE_MEMORY): Remove.
      	* lto-dump.cc (INCLUDE_MEMORY): Remove.
      	* lto-partition.cc (INCLUDE_MEMORY): Remove.
      	* lto-symtab.cc (INCLUDE_MEMORY): Remove.
      	* lto.cc (INCLUDE_MEMORY): Remove.
      
      gcc/m2/ChangeLog:
      
      	* gm2-gcc/gcc-consolidation.h (INCLUDE_MEMORY): Remove.
      	* gm2-gcc/m2configure.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GASCII.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GASCII.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GArgs.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GArgs.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GAssertion.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GAssertion.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GBreak.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GBreak.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GCOROUTINES.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GCmdArgs.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GCmdArgs.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GDebug.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GDebug.h (INCLUDE_MEMORY): Remove. Remove.
      	* mc-boot/GDynamicStrings.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GDynamicStrings.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GEnvironment.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GEnvironment.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GFIO.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GFIO.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GFormatStrings.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GFormatStrings.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GFpuIO.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GFpuIO.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GIO.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GIO.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GIndexing.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GIndexing.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GM2Dependent.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GM2Dependent.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GM2EXCEPTION.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GM2EXCEPTION.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GM2RTS.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GM2RTS.h (INCLUDE_MEMORY): Remove. Remove.
      	* mc-boot/GMemUtils.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GMemUtils.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GNumberIO.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GNumberIO.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GPushBackInput.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GPushBackInput.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GRTExceptions.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GRTExceptions.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GRTco.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GRTentity.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GRTint.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GRTint.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GSArgs.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GSArgs.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GSFIO.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GSFIO.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GSYSTEM.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GSelective.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStdIO.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStdIO.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStorage.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStorage.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStrCase.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStrCase.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStrIO.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStrIO.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStrLib.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStrLib.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStringConvert.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GStringConvert.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GSysExceptions.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GSysStorage.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GSysStorage.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GTimeString.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GTimeString.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GUnixArgs.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Galists.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Galists.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gdecl.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gdecl.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gdtoa.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gerrno.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gkeyc.cc (INCLUDE_MEMORY): Remove.
      	(checkGccConfigSystem): Remove printing out `#define INCLUDE_MEMORY`.
      	* mc-boot/Gkeyc.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gldtoa.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Glibc.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Glibm.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Glists.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Glists.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcComment.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcComment.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcComp.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcComp.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcDebug.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcDebug.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcError.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcError.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcFileName.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcFileName.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcLexBuf.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcLexBuf.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcMetaError.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcMetaError.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcOptions.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcOptions.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcPreprocess.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcPreprocess.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcPretty.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcPretty.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcPrintf.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcPrintf.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcQuiet.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcQuiet.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcReserved.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcReserved.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcSearch.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcSearch.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcStack.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcStack.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcStream.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GmcStream.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcflex.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp1.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp1.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp2.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp2.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp3.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp3.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp4.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp4.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp5.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gmcp5.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GnameKey.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GnameKey.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/GsymbolKey.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/GsymbolKey.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gtermios.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gtop.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gvarargs.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gvarargs.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gwlists.cc (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gwlists.h (INCLUDE_MEMORY): Remove.
      	* mc-boot/Gwrapc.h (INCLUDE_MEMORY): Remove.
      	* pge-boot/GIndexing.h (INCLUDE_MEMORY): Remove.
      	* pge-boot/GSEnvironment.h (INCLUDE_MEMORY): Remove.
      	* pge-boot/GScan.h (INCLUDE_MEMORY): Remove.
      
      gcc/objc/ChangeLog:
      
      	* objc-act.cc (INCLUDE_MEMORY): Remove.
      	* objc-encoding.cc (INCLUDE_MEMORY): Remove.
      	* objc-gnu-runtime-abi-01.cc (INCLUDE_MEMORY): Remove.
      	* objc-lang.cc (INCLUDE_MEMORY): Remove.
      	* objc-next-runtime-abi-01.cc (INCLUDE_MEMORY): Remove.
      	* objc-next-runtime-abi-02.cc (INCLUDE_MEMORY): Remove.
      	* objc-runtime-shared-support.cc (INCLUDE_MEMORY): Remove.
      
      gcc/objcp/ChangeLog:
      
      	* objcp-decl.cc (INCLUDE_MEMORY): Remove.
      	* objcp-lang.cc (INCLUDE_MEMORY): Remove.
      
      gcc/rust/ChangeLog:
      
      	* resolve/rust-ast-resolve-expr.cc (INCLUDE_MEMORY): Remove.
      	* rust-attribs.cc (INCLUDE_MEMORY): Remove.
      	* rust-system.h (INCLUDE_MEMORY): Remove.
      
      Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
      b3f1b9e2
  2. Mar 03, 2024
    • Iain Buclaw's avatar
      d: Merge upstream dmd, druntime f8bae04558, phobos ba2ade9dec · bbfbaa79
      Iain Buclaw authored
      D front-end changes:
      
          - Import dmd v2.108.1-beta-1.
      
      D runtime changes:
      
          - Import druntime v2.108.1-beta-1.
      
      Phobos changes:
      
          - Import phobos v2.108.1-beta-1.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd f8bae04558.
      	* dmd/VERSION: Bump version to v2.108.0-beta.1.
      	* d-builtins.cc (build_frontend_type): Update for new front-end
      	interface.
      	* d-codegen.cc (build_assert_call): Likewise.
      	* d-convert.cc (d_array_convert): Likewise.
      	* decl.cc (get_vtable_decl): Likewise.
      	* expr.cc (ExprVisitor::visit (EqualExp *)): Likewise.
      	(ExprVisitor::visit (VarExp *)): Likewise.
      	(ExprVisitor::visit (ArrayLiteralExp *)): Likewise.
      	(ExprVisitor::visit (AssocArrayLiteralExp)): Likewise.
      	* intrinsics.cc (build_shuffle_mask_type): Likewise.
      	(maybe_warn_intrinsic_mismatch): Likewise.
      	* runtime.cc (get_libcall_type): Likewise.
      	* typeinfo.cc (TypeInfoVisitor::layout_string): Likewise.
      	(TypeInfoVisitor::visit(TypeInfoTupleDeclaration *)): Likewise.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime 02d6d07a69.
      	* src/MERGE: Merge upstream phobos a2ade9dec.
      bbfbaa79
    • Iain Buclaw's avatar
      d: Fix gdc -O2 -mavx generates misaligned vmovdqa instruction [PR114171] · 623f5277
      Iain Buclaw authored
      	PR d/114171
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (lower_struct_comparison): Keep alignment of original
      	type in reinterpret cast for comparison.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/torture/pr114171.d: New test.
      623f5277
  3. Feb 17, 2024
    • Iain Buclaw's avatar
      d: Merge dmd, druntime 9471b25db9, phobos 547886846. · 5aff58e5
      Iain Buclaw authored
      D front-end changes:
      
      	- Import dmd v2.107.1-rc.1.
      
      D runtime changes:
      
      	- Import druntime v2.107.1-rc.1.
      
      Phobos changes:
      
      	- Import phobos v2.107.1-rc.1.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd 9471b25db9.
      	* dmd/VERSION: Bump version to v2.107.1-rc.1.
      	* Make-lang.in (D_FRONTEND_OBJS): Add d/cxxfrontend.o.
      	* d-attribs.cc (build_attributes): Update for new front-end interface.
      	* d-builtins.cc (build_frontend_type): Likewise.
      	(strip_type_modifiers): Likewise.
      	(covariant_with_builtin_type_p): Likewise.
      	* d-codegen.cc (declaration_type): Likewise.
      	(parameter_type): Likewise.
      	(build_array_struct_comparison): Likewise.
      	(void_okay_p): Likewise.
      	* d-convert.cc (convert_expr): Likewise.
      	(check_valist_conversion): Likewise.
      	* d-lang.cc (d_generate_ddoc_file): Likewise.
      	(d_parse_file): Likewise.
      	* d-target.cc (TargetCPP::toMangle): Likewise.
      	(TargetCPP::typeInfoMangle): Likewise.
      	(TargetCPP::thunkMangle): Likewise.
      	(TargetCPP::parameterType): Likewise.
      	* decl.cc (d_mangle_decl): Likewise.
      	(DeclVisitor::visit): Likewise.
      	(DeclVisitor::visit (CAsmDeclaration *)): New method.
      	(get_symbol_decl): Update for new front-end interface.
      	(layout_class_initializer): Likewise.
      	* expr.cc (ExprVisitor::visit): Likewise.
      	* intrinsics.cc (maybe_set_intrinsic): Likewise.
      	(expand_intrinsic_rotate): Likewise.
      	* modules.cc (layout_moduleinfo_fields): Likewise.
      	(layout_moduleinfo): Likewise.
      	* runtime.cc (get_libcall_type): Likewise.
      	* typeinfo.cc (make_frontend_typeinfo): Likewise.
      	(TypeInfoVisitor::visit): Likewise.
      	(create_typeinfo): Likewise.
      	* types.cc (same_type_p): Likewise.
      	(build_ctype): Likewise.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime 9471b25db9.
      	* src/MERGE: Merge upstream phobos 547886846.
      5aff58e5
  4. Feb 12, 2024
    • Iain Buclaw's avatar
      d: Fix callee destructor call invalidates the live object [PR113758] · 3c57b1c1
      Iain Buclaw authored
      When generating the argument, check the isCalleeDestroyingArgs hook, and
      force a TARGET_EXPR to be created if true, so that a reference to the
      live object isn't passed directly to the function that runs dtors.
      
      When instead dealing with caller running destructors, two temporaries
      were being generated, one explicit temporary generated by the D
      front-end, and another implicitly by the code generator.  This has been
      reduced to one by setting DECL_VALUE_EXPR on the explicit temporary to
      bind it to the implicit slot created for the TARGET_EXPR, as that has
      the shorter lifetime of the two.
      
      	PR d/113758
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (d_build_call): Force a TARGET_EXPR when callee
      	destorys its arguments.
      	* decl.cc (DeclVisitor::visit (VarDeclaration *)): Set
      	SET_DECL_VALUE_EXPR on the temporary variable to make it a placeholder
      	for the TARGET_EXPR_SLOT.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/torture/pr113758.d: New test.
      3c57b1c1
  5. Feb 04, 2024
    • Iain Buclaw's avatar
      d: Merge dmd, druntime a6f1083699, phobos 31dedd7da · c428454e
      Iain Buclaw authored
      D front-end changes:
      
      	- Import dmd v2.107.0.
      	- Character postfixes can now also be used for integers of size
      	  two or four.
      
      D run-time changes:
      
      	- Import druntime v2.107.0.
      
      Phobos changes:
      
      	- Import phobos v2.107.0.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd a6f1083699.
      	* dmd/VERSION: Bump version to v2.107.0
      	* Make-lang.in (D_FRONTEND_OBJS): Add d/pragmasem.o.
      	* d-builtins.cc (strip_type_modifiers): Update for new front-end
      	interface.
      	* d-codegen.cc (declaration_type): Likewise.
      	(parameter_type): Likewise.
      	* d-target.cc (TargetCPP::parameterType): Likewise.
      	* expr.cc (ExprVisitor::visit (IndexExp *)): Likewise.
      	(ExprVisitor::visit (VarExp *)): Likewise.
      	(ExprVisitor::visit (AssocArrayLiteralExp *)): Likewise.
      	* runtime.cc (get_libcall_type): Likewise.
      	* typeinfo.cc (TypeInfoVisitor::visit (TypeInfoConstDeclaration *)):
      	Likewise.
      	(TypeInfoVisitor::visit (TypeInfoInvariantDeclaration *)): Likewise.
      	(TypeInfoVisitor::visit (TypeInfoSharedDeclaration *)): Likewise.
      	(TypeInfoVisitor::visit (TypeInfoWildDeclaration *)): Likewise.
      	* types.cc (build_ctype): Likewise.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime a6f1083699.
      	* src/MERGE: Merge upstream phobos 31dedd7da.
      c428454e
  6. Feb 03, 2024
    • Iain Buclaw's avatar
      d: Merge dmd. druntime e770945277, phobos 6d6e0b9b9 · 51c4eb28
      Iain Buclaw authored
      D front-end changes:
      
          - Import latest fixes from dmd v2.107.0-beta.1.
          - Hex strings can now be cast to integer arrays.
          - Add support for Interpolated Expression Sequences.
      
      D runtime changes:
      
          - Import latest fixes from druntime v2.107.0-beta.1.
          - New core.interpolation module to provide run-time support for D
            interpolated expression sequence literals.
      
      Phobos changes:
      
          - Import latest fixes from phobos v2.107.0-beta.1.
          - `std.range.primitives.isBidirectionalRange', and
            `std.range.primitives.isRandomAccessRange' now take an optional
            element type.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd e770945277.
      	* Make-lang.in (D_FRONTEND_OBJS): Add d/basicmangle.o, d/enumsem.o,
      	d/funcsem.o, d/templatesem.o.
      	* d-builtins.cc (build_frontend_type): Update for new front-end
      	interface.
      	* d-codegen.cc (declaration_type): Likewise.
      	(parameter_type): Likewise.
      	* d-incpath.cc (add_globalpaths): Likewise.
      	(add_filepaths): Likewise.
      	(add_import_paths): Likewise.
      	* d-lang.cc (d_init_options): Likewise.
      	(d_handle_option): Likewise.
      	(d_parse_file): Likewise.
      	* decl.cc (DeclVisitor::finish_vtable): Likewise.
      	(DeclVisitor::visit (FuncDeclaration *)): Likewise.
      	(get_symbol_decl): Likewise.
      	* expr.cc (ExprVisitor::visit (StringExp *)): Likewise.
      	Implement support for 8-byte hexadecimal strings.
      	* typeinfo.cc (create_tinfo_types): Update internal TypeInfo
      	representation.
      	(TypeInfoVisitor::visit (TypeInfoConstDeclaration *)): Update for new
      	front-end interface.
      	(TypeInfoVisitor::visit (TypeInfoInvariantDeclaration *)): Likewise.
      	(TypeInfoVisitor::visit (TypeInfoSharedDeclaration *)): Likewise.
      	(TypeInfoVisitor::visit (TypeInfoWildDeclaration *)): Likewise.
      	(TypeInfoVisitor::visit (TypeInfoClassDeclaration *)): Move data for
      	TypeInfo_Class.nameSig to the end of the object.
      	(create_typeinfo): Update for new front-end interface.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime e770945277.
      	* libdruntime/Makefile.am (DRUNTIME_SOURCES): Add
      	core/interpolation.d.
      	* libdruntime/Makefile.in: Regenerate.
      	* src/MERGE: Merge upstream phobos 6d6e0b9b9.
      51c4eb28
  7. Oct 24, 2024
    • David Malcolm's avatar
      Use unique_ptr in more places in pretty_printer/diagnostics [PR116613] · bf43fe6a
      David Malcolm authored
      
      My forthcoming patches for PR other/116613 make much more use of
      cloning of pretty_printers than before, so it makes sense as a
      preliminary patch for the result of pretty_printer::clone to be a
      std::unique_ptr, rather than add more manual uses of "delete".
      
      On doing so, I noticed various other places where naked new/delete is
      used for run-time configuration of diagnostics:
      * the output format (text vs SARIF)
      * client data hooks
      * the option manager
      * the URLifier
      
      Hence this patch also makes use of std::unique_ptr and ::make_unique for
      managing such client policy classes, and also for diagnostic_buffer's
      per-format implementations.
      
      Unfortunately we can't directly include <memory> in our internal headers
      but instead any of our TUs that make use of std::unique_ptr must #define
      INCLUDE_MEMORY before including system.h.
      
      Hence the bulk of this patch is taken up with adding a define of
      INCLUDE_MEMORY to hundreds of source files: everything that includes
      diagnostic.h or pretty-print.h (and thus anything transitively such as
      includers of lto-wrapper.h, c-tree.h, cp-tree.h and rtl-ssa.h).
      
      Thanks to Gaius Mulley for the parts of the patch that regenerated the
      m2 files.
      
      gcc/ada/ChangeLog:
      	PR other/116613
      	* gcc-interface/misc.cc: Add #define INCLUDE_MEMORY
      	* gcc-interface/trans.cc: Likewise.
      	* gcc-interface/utils.cc: Likewise.
      
      gcc/analyzer/ChangeLog:
      	PR other/116613
      	* analyzer-logging.cc: Add #define INCLUDE_MEMORY
      	(logger::logger): Update for m_pp becoming a unique_ptr.
      	(logger::~logger): Likewise.
      	(logger::log_va_partial): Likewise.
      	(logger::end_log_line): Likewise.
      	* analyzer-logging.h (logger::get_printer): Likewise.
      	(logger::m_pp): Convert to a unique_ptr.
      	* analyzer.cc (make_label_text): Use
      	diagnostic_context::clone_printer and use unique_ptr.
      	(make_label_text_n): Likewise.
      	* bar-chart.cc: Add #define INCLUDE_MEMORY
      	* pending-diagnostic.cc (evdesc::event_desc::formatted_print):
      	Use diagnostic_context::clone_printer and use unique_ptr.
      	* sm-malloc.cc (sufficiently_similar_p): Likewise.
      	* supergraph.cc (supergraph::dump_dot_to_file): Likewise.
      
      gcc/c-family/ChangeLog:
      	PR other/116613
      	* c-ada-spec.cc: Add #define INCLUDE_MEMORY.
      	* c-attribs.cc: Likewise.
      	* c-common.cc: Likewise.
      	* c-format.cc: Likewise.
      	* c-gimplify.cc: Likewise.
      	* c-indentation.cc: Likewise.
      	* c-opts.cc: Likewise.
      	* c-pch.cc: Likewise.
      	* c-pragma.cc: Likewise.
      	* c-pretty-print.cc: Likewise.  Add #include "make-unique.h".
      	(c_pretty_printer::clone): Use std::unique_ptr and ::make_unique.
      	* c-pretty-print.h (c_pretty_printer::clone): Use std::unique_ptr.
      	* c-type-mismatch.cc: Add #define INCLUDE_MEMORY.
      	* c-warn.cc: Likewise.
      
      gcc/c/ChangeLog:
      	PR other/116613
      	* c-aux-info.cc: Add #define INCLUDE_MEMORY.
      	* c-convert.cc: Likewise.
      	* c-errors.cc: Likewise.
      	* c-fold.cc: Likewise.
      	* c-lang.cc: Likewise.
      	* c-objc-common.cc: Likewise.
      	(pp_markup::element_quoted_type::print_type): Use unique_ptr.
      	* c-typeck.cc: Add #define INCLUDE_MEMORY.
      	* gimple-parser.cc: Likewise.
      
      gcc/cp/ChangeLog:
      	PR other/116613
      	* call.cc: Add #define INCLUDE_MEMORY.
      	* class.cc: Likewise.
      	* constexpr.cc: Likewise.
      	* constraint.cc: Likewise.
      	* contracts.cc: Likewise.
      	* coroutines.cc: Likewise.
      	* cp-gimplify.cc: Likewise.
      	* cp-lang.cc: Likewise.
      	* cp-objcp-common.cc: Likewise.
      	* cp-ubsan.cc: Likewise.
      	* cvt.cc: Likewise.
      	* cxx-pretty-print.cc: Likewise.  Add #include "cp-tree.h".
      	(cxx_pretty_printer::clone): Use std::unique_ptr and
      	::make_unique.
      	* cxx-pretty-print.h (cxx_pretty_printer::clone): Use
      	std::unique_ptr.
      	* decl2.cc: Add #define INCLUDE_MEMORY.
      	* dump.cc: Likewise.
      	* except.cc: Likewise.
      	* expr.cc: Likewise.
      	* friend.cc: Likewise.
      	* init.cc: Likewise.
      	* lambda.cc: Likewise.
      	* logic.cc: Likewise.
      	* mangle.cc: Likewise.
      	* method.cc: Likewise.
      	* optimize.cc: Likewise.
      	* pt.cc: Likewise.
      	* ptree.cc: Likewise.
      	* rtti.cc: Likewise.
      	* search.cc: Likewise.
      	* semantics.cc: Likewise.
      	* tree.cc: Likewise.
      	* typeck.cc: Likewise.
      	* typeck2.cc: Likewise.
      	* vtable-class-hierarchy.cc: Likewise.
      
      gcc/d/ChangeLog:
      	PR other/116613
      	* d-attribs.cc: Add #define INCLUDE_MEMORY.
      	* d-builtins.cc: Likewise.
      	* d-codegen.cc: Likewise.
      	* d-convert.cc: Likewise.
      	* d-diagnostic.cc: Likewise.
      	* d-frontend.cc: Likewise.
      	* d-lang.cc: Likewise.
      	* d-longdouble.cc: Likewise.
      	* d-target.cc: Likewise.
      	* decl.cc: Likewise.
      	* expr.cc: Likewise.
      	* intrinsics.cc: Likewise.
      	* modules.cc: Likewise.
      	* toir.cc: Likewise.
      	* typeinfo.cc: Likewise.
      	* types.cc: Likewise.
      
      gcc/fortran/ChangeLog:
      	PR other/116613
      	* arith.cc: Add #define INCLUDE_MEMORY.
      	* array.cc: Likewise.
      	* bbt.cc: Likewise.
      	* check.cc: Likewise.
      	* class.cc: Likewise.
      	* constructor.cc: Likewise.
      	* convert.cc: Likewise.
      	* cpp.cc: Likewise.
      	* data.cc: Likewise.
      	* decl.cc: Likewise.
      	* dependency.cc: Likewise.
      	* dump-parse-tree.cc: Likewise.
      	* error.cc: Likewise.
      	* expr.cc: Likewise.
      	* f95-lang.cc: Likewise.
      	* frontend-passes.cc: Likewise.
      	* interface.cc: Likewise.
      	* intrinsic.cc: Likewise.
      	* io.cc: Likewise.
      	* iresolve.cc: Likewise.
      	* match.cc: Likewise.
      	* matchexp.cc: Likewise.
      	* misc.cc: Likewise.
      	* module.cc: Likewise.
      	* openmp.cc: Likewise.
      	* options.cc: Likewise.
      	* parse.cc: Likewise.
      	* primary.cc: Likewise.
      	* resolve.cc: Likewise.
      	* scanner.cc: Likewise.
      	* simplify.cc: Likewise.
      	* st.cc: Likewise.
      	* symbol.cc: Likewise.
      	* target-memory.cc: Likewise.
      	* trans-array.cc: Likewise.
      	* trans-common.cc: Likewise.
      	* trans-const.cc: Likewise.
      	* trans-decl.cc: Likewise.
      	* trans-expr.cc: Likewise.
      	* trans-intrinsic.cc: Likewise.
      	* trans-io.cc: Likewise.
      	* trans-openmp.cc: Likewise.
      	* trans-stmt.cc: Likewise.
      	* trans-types.cc: Likewise.
      	* trans.cc: Likewise.
      
      gcc/go/ChangeLog:
      	PR other/116613
      	* go-backend.cc: Add #define INCLUDE_MEMORY.
      	* go-lang.cc: Likewise.
      
      gcc/jit/ChangeLog:
      	PR other/116613
      	* dummy-frontend.cc: Add #define INCLUDE_MEMORY.
      	* jit-playback.cc: Likewise.
      	* jit-recording.cc: Likewise.
      
      gcc/lto/ChangeLog:
      	PR other/116613
      	* lto-common.cc: Add #define INCLUDE_MEMORY.
      	* lto-dump.cc: Likewise.
      	* lto-partition.cc: Likewise.
      	* lto-symtab.cc: Likewise.
      	* lto.cc: Likewise.
      
      gcc/m2/ChangeLog:
      	PR other/116613
      	* gm2-gcc/gcc-consolidation.h: Add #define INCLUDE_MEMORY.
      	* gm2-gcc/m2configure.cc: Likewise.
      	* mc-boot/GASCII.cc: Regenerate.
      	* mc-boot/GASCII.h: Ditto.
      	* mc-boot/GArgs.cc: Ditto.
      	* mc-boot/GArgs.h: Ditto.
      	* mc-boot/GAssertion.cc: Ditto.
      	* mc-boot/GAssertion.h: Ditto.
      	* mc-boot/GBreak.cc: Ditto.
      	* mc-boot/GBreak.h: Ditto.
      	* mc-boot/GCOROUTINES.h: Ditto.
      	* mc-boot/GCmdArgs.cc: Ditto.
      	* mc-boot/GCmdArgs.h: Ditto.
      	* mc-boot/GDebug.cc: Ditto.
      	* mc-boot/GDebug.h: Ditto.
      	* mc-boot/GDynamicStrings.cc: Ditto.
      	* mc-boot/GDynamicStrings.h: Ditto.
      	* mc-boot/GEnvironment.cc: Ditto.
      	* mc-boot/GEnvironment.h: Ditto.
      	* mc-boot/GFIO.cc: Ditto.
      	* mc-boot/GFIO.h: Ditto.
      	* mc-boot/GFormatStrings.cc: Ditto.
      	* mc-boot/GFormatStrings.h: Ditto.
      	* mc-boot/GFpuIO.cc: Ditto.
      	* mc-boot/GFpuIO.h: Ditto.
      	* mc-boot/GIO.cc: Ditto.
      	* mc-boot/GIO.h: Ditto.
      	* mc-boot/GIndexing.cc: Ditto.
      	* mc-boot/GIndexing.h: Ditto.
      	* mc-boot/GM2Dependent.cc: Ditto.
      	* mc-boot/GM2Dependent.h: Ditto.
      	* mc-boot/GM2EXCEPTION.cc: Ditto.
      	* mc-boot/GM2EXCEPTION.h: Ditto.
      	* mc-boot/GM2RTS.cc: Ditto.
      	* mc-boot/GM2RTS.h: Ditto.
      	* mc-boot/GMemUtils.cc: Ditto.
      	* mc-boot/GMemUtils.h: Ditto.
      	* mc-boot/GNumberIO.cc: Ditto.
      	* mc-boot/GNumberIO.h: Ditto.
      	* mc-boot/GPushBackInput.cc: Ditto.
      	* mc-boot/GPushBackInput.h: Ditto.
      	* mc-boot/GRTExceptions.cc: Ditto.
      	* mc-boot/GRTExceptions.h: Ditto.
      	* mc-boot/GRTco.h: Ditto.
      	* mc-boot/GRTentity.h: Ditto.
      	* mc-boot/GRTint.cc: Ditto.
      	* mc-boot/GRTint.h: Ditto.
      	* mc-boot/GSArgs.cc: Ditto.
      	* mc-boot/GSArgs.h: Ditto.
      	* mc-boot/GSFIO.cc: Ditto.
      	* mc-boot/GSFIO.h: Ditto.
      	* mc-boot/GSYSTEM.h: Ditto.
      	* mc-boot/GSelective.h: Ditto.
      	* mc-boot/GStdIO.cc: Ditto.
      	* mc-boot/GStdIO.h: Ditto.
      	* mc-boot/GStorage.cc: Ditto.
      	* mc-boot/GStorage.h: Ditto.
      	* mc-boot/GStrCase.cc: Ditto.
      	* mc-boot/GStrCase.h: Ditto.
      	* mc-boot/GStrIO.cc: Ditto.
      	* mc-boot/GStrIO.h: Ditto.
      	* mc-boot/GStrLib.cc: Ditto.
      	* mc-boot/GStrLib.h: Ditto.
      	* mc-boot/GStringConvert.cc: Ditto.
      	* mc-boot/GStringConvert.h: Ditto.
      	* mc-boot/GSysExceptions.h: Ditto.
      	* mc-boot/GSysStorage.cc: Ditto.
      	* mc-boot/GSysStorage.h: Ditto.
      	* mc-boot/GTimeString.cc: Ditto.
      	* mc-boot/GTimeString.h: Ditto.
      	* mc-boot/GUnixArgs.h: Ditto.
      	* mc-boot/Galists.cc: Ditto.
      	* mc-boot/Galists.h: Ditto.
      	* mc-boot/Gdecl.cc: Ditto.
      	* mc-boot/Gdecl.h: Ditto.
      	* mc-boot/Gdtoa.h: Ditto.
      	* mc-boot/Gerrno.h: Ditto.
      	* mc-boot/Gkeyc.cc: Ditto.
      	* mc-boot/Gkeyc.h: Ditto.
      	* mc-boot/Gldtoa.h: Ditto.
      	* mc-boot/Glibc.h: Ditto.
      	* mc-boot/Glibm.h: Ditto.
      	* mc-boot/Glists.cc: Ditto.
      	* mc-boot/Glists.h: Ditto.
      	* mc-boot/GmcComment.cc: Ditto.
      	* mc-boot/GmcComment.h: Ditto.
      	* mc-boot/GmcComp.cc: Ditto.
      	* mc-boot/GmcComp.h: Ditto.
      	* mc-boot/GmcDebug.cc: Ditto.
      	* mc-boot/GmcDebug.h: Ditto.
      	* mc-boot/GmcError.cc: Ditto.
      	* mc-boot/GmcError.h: Ditto.
      	* mc-boot/GmcFileName.cc: Ditto.
      	* mc-boot/GmcFileName.h: Ditto.
      	* mc-boot/GmcLexBuf.cc: Ditto.
      	* mc-boot/GmcLexBuf.h: Ditto.
      	* mc-boot/GmcMetaError.cc: Ditto.
      	* mc-boot/GmcMetaError.h: Ditto.
      	* mc-boot/GmcOptions.cc: Ditto.
      	* mc-boot/GmcOptions.h: Ditto.
      	* mc-boot/GmcPreprocess.cc: Ditto.
      	* mc-boot/GmcPreprocess.h: Ditto.
      	* mc-boot/GmcPretty.cc: Ditto.
      	* mc-boot/GmcPretty.h: Ditto.
      	* mc-boot/GmcPrintf.cc: Ditto.
      	* mc-boot/GmcPrintf.h: Ditto.
      	* mc-boot/GmcQuiet.cc: Ditto.
      	* mc-boot/GmcQuiet.h: Ditto.
      	* mc-boot/GmcReserved.cc: Ditto.
      	* mc-boot/GmcReserved.h: Ditto.
      	* mc-boot/GmcSearch.cc: Ditto.
      	* mc-boot/GmcSearch.h: Ditto.
      	* mc-boot/GmcStack.cc: Ditto.
      	* mc-boot/GmcStack.h: Ditto.
      	* mc-boot/GmcStream.cc: Ditto.
      	* mc-boot/GmcStream.h: Ditto.
      	* mc-boot/Gmcflex.h: Ditto.
      	* mc-boot/Gmcp1.cc: Ditto.
      	* mc-boot/Gmcp1.h: Ditto.
      	* mc-boot/Gmcp2.cc: Ditto.
      	* mc-boot/Gmcp2.h: Ditto.
      	* mc-boot/Gmcp3.cc: Ditto.
      	* mc-boot/Gmcp3.h: Ditto.
      	* mc-boot/Gmcp4.cc: Ditto.
      	* mc-boot/Gmcp4.h: Ditto.
      	* mc-boot/Gmcp5.cc: Ditto.
      	* mc-boot/Gmcp5.h: Ditto.
      	* mc-boot/GnameKey.cc: Ditto.
      	* mc-boot/GnameKey.h: Ditto.
      	* mc-boot/GsymbolKey.cc: Ditto.
      	* mc-boot/GsymbolKey.h: Ditto.
      	* mc-boot/Gtermios.h: Ditto.
      	* mc-boot/Gtop.cc: Ditto.
      	* mc-boot/Gvarargs.cc: Ditto.
      	* mc-boot/Gvarargs.h: Ditto.
      	* mc-boot/Gwlists.cc: Ditto.
      	* mc-boot/Gwlists.h: Ditto.
      	* mc-boot/Gwrapc.h: Ditto.
      	* mc/keyc.mod (checkGccConfigSystem): Add
      	#define INCLUDE_MEMORY.
      	* pge-boot/GASCII.cc: Regenerate.
      	* pge-boot/GASCII.h: Ditto.
      	* pge-boot/GArgs.cc: Ditto.
      	* pge-boot/GArgs.h: Ditto.
      	* pge-boot/GAssertion.cc: Ditto.
      	* pge-boot/GAssertion.h: Ditto.
      	* pge-boot/GBreak.h: Ditto.
      	* pge-boot/GCmdArgs.h: Ditto.
      	* pge-boot/GDebug.cc: Ditto.
      	* pge-boot/GDebug.h: Ditto.
      	* pge-boot/GDynamicStrings.cc: Ditto.
      	* pge-boot/GDynamicStrings.h: Ditto.
      	* pge-boot/GEnvironment.h: Ditto.
      	* pge-boot/GFIO.cc: Ditto.
      	* pge-boot/GFIO.h: Ditto.
      	* pge-boot/GFormatStrings.h: Ditto.
      	* pge-boot/GFpuIO.h: Ditto.
      	* pge-boot/GIO.cc: Ditto.
      	* pge-boot/GIO.h: Ditto.
      	* pge-boot/GIndexing.cc: Ditto.
      	* pge-boot/GIndexing.h: Ditto.
      	* pge-boot/GLists.cc: Ditto.
      	* pge-boot/GLists.h: Ditto.
      	* pge-boot/GM2Dependent.cc: Ditto.
      	* pge-boot/GM2Dependent.h: Ditto.
      	* pge-boot/GM2EXCEPTION.cc: Ditto.
      	* pge-boot/GM2EXCEPTION.h: Ditto.
      	* pge-boot/GM2RTS.cc: Ditto.
      	* pge-boot/GM2RTS.h: Ditto.
      	* pge-boot/GNameKey.cc: Ditto.
      	* pge-boot/GNameKey.h: Ditto.
      	* pge-boot/GNumberIO.cc: Ditto.
      	* pge-boot/GNumberIO.h: Ditto.
      	* pge-boot/GOutput.cc: Ditto.
      	* pge-boot/GOutput.h: Ditto.
      	* pge-boot/GPushBackInput.cc: Ditto.
      	* pge-boot/GPushBackInput.h: Ditto.
      	* pge-boot/GRTExceptions.cc: Ditto.
      	* pge-boot/GRTExceptions.h: Ditto.
      	* pge-boot/GSArgs.h: Ditto.
      	* pge-boot/GSEnvironment.h: Ditto.
      	* pge-boot/GSFIO.cc: Ditto.
      	* pge-boot/GSFIO.h: Ditto.
      	* pge-boot/GSYSTEM.h: Ditto.
      	* pge-boot/GScan.h: Ditto.
      	* pge-boot/GStdIO.cc: Ditto.
      	* pge-boot/GStdIO.h: Ditto.
      	* pge-boot/GStorage.cc: Ditto.
      	* pge-boot/GStorage.h: Ditto.
      	* pge-boot/GStrCase.cc: Ditto.
      	* pge-boot/GStrCase.h: Ditto.
      	* pge-boot/GStrIO.cc: Ditto.
      	* pge-boot/GStrIO.h: Ditto.
      	* pge-boot/GStrLib.cc: Ditto.
      	* pge-boot/GStrLib.h: Ditto.
      	* pge-boot/GStringConvert.h: Ditto.
      	* pge-boot/GSymbolKey.cc: Ditto.
      	* pge-boot/GSymbolKey.h: Ditto.
      	* pge-boot/GSysExceptions.h: Ditto.
      	* pge-boot/GSysStorage.cc: Ditto.
      	* pge-boot/GSysStorage.h: Ditto.
      	* pge-boot/GTimeString.h: Ditto.
      	* pge-boot/GUnixArgs.h: Ditto.
      	* pge-boot/Gbnflex.cc: Ditto.
      	* pge-boot/Gbnflex.h: Ditto.
      	* pge-boot/Gdtoa.h: Ditto.
      	* pge-boot/Gerrno.h: Ditto.
      	* pge-boot/Gldtoa.h: Ditto.
      	* pge-boot/Glibc.h: Ditto.
      	* pge-boot/Glibm.h: Ditto.
      	* pge-boot/Gpge.cc: Ditto.
      	* pge-boot/Gtermios.h: Ditto.
      	* pge-boot/Gwrapc.h: Ditto.
      
      gcc/objc/ChangeLog:
      	PR other/116613
      	* objc-act.cc: Add #define INCLUDE_MEMORY.
      	* objc-encoding.cc: Likewise.
      	* objc-gnu-runtime-abi-01.cc: Likewise.
      	* objc-lang.cc: Likewise.
      	* objc-next-runtime-abi-01.cc: Likewise.
      	* objc-next-runtime-abi-02.cc: Likewise.
      	* objc-runtime-shared-support.cc: Likewise.
      
      gcc/objcp/ChangeLog:: Add #define INCLUDE_MEMORY.
      	PR other/116613
      	* objcp-decl.cc
      	* objcp-lang.cc: Likewise.
      
      gcc/rust/ChangeLog:
      	PR other/116613
      	* resolve/rust-ast-resolve-expr.cc: Add #define INCLUDE_MEMORY.
      	* rust-attribs.cc: Likewise.
      	* rust-system.h: Likewise.
      
      gcc/ChangeLog:
      	PR other/116613
      	* asan.cc: Add #define INCLUDE_MEMORY.
      	* attribs.cc: Likewise.
      	(attr_access::array_as_string): Use
      	diagnostic_context::clone_printer and use unique_ptr.
      	* auto-profile.cc: Add #define INCLUDE_MEMORY.
      	* calls.cc: Likewise.
      	* cfganal.cc: Likewise.
      	* cfgexpand.cc: Likewise.
      	* cfghooks.cc: Likewise.
      	* cfgloop.cc: Likewise.
      	* cgraph.cc: Likewise.
      	* cgraphclones.cc: Likewise.
      	* cgraphunit.cc: Likewise.
      	* collect-utils.cc: Likewise.
      	* collect2.cc: Likewise.
      	* common/config/aarch64/aarch64-common.cc: Likewise.
      	* common/config/arm/arm-common.cc: Likewise.
      	* common/config/avr/avr-common.cc: Likewise.
      	* config/aarch64/aarch64-cc-fusion.cc: Likewise.
      	* config/aarch64/aarch64-early-ra.cc: Likewise.
      	* config/aarch64/aarch64-sve-builtins.cc: Likewise.
      	* config/arc/arc.cc: Likewise.
      	* config/arm/aarch-common.cc: Likewise.
      	* config/arm/arm-mve-builtins.cc: Likewise.
      	* config/avr/avr-devices.cc: Likewise.
      	* config/avr/driver-avr.cc: Likewise.
      	* config/bpf/bpf.cc: Likewise.
      	* config/bpf/btfext-out.cc: Likewise.
      	* config/bpf/core-builtins.cc: Likewise.
      	* config/darwin.cc: Likewise.
      	* config/i386/driver-i386.cc: Likewise.
      	* config/i386/i386-builtins.cc: Likewise.
      	* config/i386/i386-expand.cc: Likewise.
      	* config/i386/i386-features.cc: Likewise.
      	* config/i386/i386-options.cc: Likewise.
      	* config/loongarch/loongarch-builtins.cc: Likewise.
      	* config/mingw/winnt-cxx.cc: Likewise.
      	* config/mingw/winnt.cc: Likewise.
      	* config/mips/mips.cc: Likewise.
      	* config/msp430/driver-msp430.cc: Likewise.
      	* config/nvptx/mkoffload.cc: Likewise.
      	* config/nvptx/nvptx.cc: Likewise.
      	* config/riscv/riscv-avlprop.cc: Likewise.
      	* config/riscv/riscv-vector-builtins.cc: Likewise.
      	* config/riscv/riscv-vsetvl.cc: Likewise.
      	* config/rs6000/driver-rs6000.cc: Likewise.
      	* config/rs6000/host-darwin.cc: Likewise.
      	* config/rs6000/rs6000-c.cc: Likewise.
      	* config/s390/s390-c.cc: Likewise.
      	* config/s390/s390.cc: Likewise.
      	* config/sol2-cxx.cc: Likewise.
      	* config/vms/vms-c.cc: Likewise.
      	* config/xtensa/xtensa-dynconfig.cc: Likewise.
      	* coroutine-passes.cc: Likewise.
      	* coverage.cc: Likewise.
      	* data-streamer-in.cc: Likewise.
      	* data-streamer-out.cc: Likewise.
      	* data-streamer.cc: Likewise.
      	* diagnostic-buffer.h (diagnostic_buffer::~diagnostic_buffer):
      	Delete.
      	(diagnostic_buffer::m_per_format_buffer): Use std::unique_ptr.
      	* diagnostic-client-data-hooks.h (make_compiler_data_hooks): Use
      	std::unique_ptr for return type.
      	* diagnostic-format-json.cc
      	(json_output_format::make_per_format_buffer): Likewise.
      	(diagnostic_output_format_init_json): Update for usage of
      	std::unique_ptr in set_output_format.
      	* diagnostic-format-sarif.cc
      	(sarif_output_format::make_per_format_buffer): Use std::unique_ptr
      	for return type.
      	(diagnostic_output_format_init_sarif): Update for usage of
      	std::unique_ptr.
      	(test_message_with_embedded_link): Likewise for set_urlifier.
      	* diagnostic-format-text.cc: Add #define INCLUDE_MEMORY.  Include
      	"make-unique.h".
      	(diagnostic_text_output_format::set_buffer): Use std::unique_ptr.
      	* diagnostic-format-text.h
      	(diagnostic_text_output_format::set_buffer): Likewise.
      	* diagnostic-format.h
      	(diagnostic_output_format::make_per_format_buffer): Likewise.
      	* diagnostic-global-context.cc:
      	* diagnostic-macro-unwinding.cc: Likewise.
      	* diagnostic-show-locus.cc: Likewise.
      	* diagnostic-spec.cc: Likewise.
      	* diagnostic.cc (diagnostic_context::set_output_format): Use
      	std::unique_ptr for input.
      	(diagnostic_context::set_client_data_hooks): Likewise.
      	(diagnostic_context::set_option_manager): Likewise.
      	(diagnostic_context::set_urlifier): Likewise.
      	(diagnostic_context::set_diagnostic_buffer): Update for use of
      	std::unique_ptr.
      	(diagnostic_buffer::diagnostic_buffer): Likewise.
      	(diagnostic_buffer::~diagnostic_buffer): Delete.
      	* diagnostic.h: Complain if INCLUDE_MEMORY was not defined.
      	(diagnostic_context::set_output_format): Use std::unique_ptr for
      	input.
      	(diagnostic_context::set_client_data_hooks): Likewise.
      	(diagnostic_context::set_option_manager): Likewise.
      	(diagnostic_context::set_urlifier): Likewise.
      	(diagnostic_context::clone_printer): New.
      	(diagnostic_context::m_printer): Update comment.
      	(diagnostic_context::m_option_mgr): Likewise.
      	(diagnostic_context::m_urlifier): Likewise.
      	(diagnostic_context::m_edit_context_ptr): Likewise.
      	(diagnostic_context::m_output_format): Likewise.
      	(diagnostic_context::m_client_data_hooks): Likewise.
      	(diagnostic_context::m_theme): Likewise.
      	* digraph.cc: Add #define INCLUDE_MEMORY.
      	* dwarf2out.cc: Likewise.
      	* edit-context.cc: Likewise.
      	* except.cc: Likewise.
      	* expr.cc: Likewise.
      	* file-prefix-map.cc: Likewise.
      	* final.cc: Likewise.
      	* fwprop.cc: Likewise.
      	* gcc-plugin.h: Likewise.
      	* gcc-rich-location.cc: Likewise.
      	* gcc-urlifier.cc: Likewise.  Add #include "make-unique.h".
      	(make_gcc_urlifier): Use std::unique_ptr and ::make_unique.
      	* gcc-urlifier.h (make_gcc_urlifier): Use std::unique_ptr.
      	* gcc.cc: Add #define INCLUDE_MEMORY.  Include
      	"pretty-print-urlifier.h".
      	* gcov-dump.cc: Add #define INCLUDE_MEMORY.
      	* gcov-tool.cc: Likewise.
      	* gengtype.cc (open_base_files): Likewise to output.
      	* genmatch.cc: Likewise.
      	* gimple-fold.cc: Likewise.
      	* gimple-harden-conditionals.cc: Likewise.
      	* gimple-harden-control-flow.cc: Likewise.
      	* gimple-if-to-switch.cc: Likewise.
      	* gimple-lower-bitint.cc: Likewise.
      	* gimple-predicate-analysis.cc: Likewise.
      	* gimple-pretty-print.cc: Likewise.
      	* gimple-range-cache.cc: Likewise.
      	* gimple-range-edge.cc: Likewise.
      	* gimple-range-fold.cc: Likewise.
      	* gimple-range-gori.cc: Likewise.
      	* gimple-range-infer.cc: Likewise.
      	* gimple-range-op.cc: Likewise.
      	* gimple-range-path.cc: Likewise.
      	* gimple-range-phi.cc: Likewise.
      	* gimple-range-trace.cc: Likewise.
      	* gimple-range.cc: Likewise.
      	* gimple-ssa-backprop.cc: Likewise.
      	* gimple-ssa-sprintf.cc: Likewise.
      	* gimple-ssa-store-merging.cc: Likewise.
      	* gimple-ssa-strength-reduction.cc: Likewise.
      	* gimple-ssa-warn-access.cc: Likewise.
      	* gimple-ssa-warn-alloca.cc: Likewise.
      	* gimple-ssa-warn-restrict.cc: Likewise.
      	* gimple-streamer-in.cc: Likewise.
      	* gimple-streamer-out.cc: Likewise.
      	* gimple.cc: Likewise.
      	* gimplify.cc: Likewise.
      	* graph.cc: Likewise.
      	* graphviz.cc: Likewise.
      	* input.cc: Likewise.
      	* ipa-cp.cc: Likewise.
      	* ipa-devirt.cc: Likewise.
      	* ipa-fnsummary.cc: Likewise.
      	* ipa-free-lang-data.cc: Likewise.
      	* ipa-icf-gimple.cc: Likewise.
      	* ipa-icf.cc: Likewise.
      	* ipa-inline-analysis.cc: Likewise.
      	* ipa-inline.cc: Likewise.
      	* ipa-modref-tree.cc: Likewise.
      	* ipa-modref.cc: Likewise.
      	* ipa-param-manipulation.cc: Likewise.
      	* ipa-polymorphic-call.cc: Likewise.
      	* ipa-predicate.cc: Likewise.
      	* ipa-profile.cc: Likewise.
      	* ipa-prop.cc: Likewise.
      	* ipa-pure-const.cc: Likewise.
      	* ipa-reference.cc: Likewise.
      	* ipa-split.cc: Likewise.
      	* ipa-sra.cc: Likewise.
      	* ipa-strub.cc: Likewise.
      	* ipa-utils.cc: Likewise.
      	* langhooks.cc: Likewise.
      	* late-combine.cc: Likewise.
      	* lto-cgraph.cc: Likewise.
      	* lto-compress.cc: Likewise.
      	* lto-opts.cc: Likewise.
      	* lto-section-in.cc: Likewise.
      	* lto-section-out.cc: Likewise.
      	* lto-streamer-in.cc: Likewise.
      	* lto-streamer-out.cc: Likewise.
      	* lto-streamer.cc: Likewise.
      	* lto-wrapper.cc: Likewise.  Include "make-unique.h".
      	(main): Use ::make_unique when creating option manager.
      	* multiple_target.cc: Likewise.
      	* omp-expand.cc: Likewise.
      	* omp-general.cc: Likewise.
      	* omp-low.cc: Likewise.
      	* omp-oacc-neuter-broadcast.cc: Likewise.
      	* omp-offload.cc: Likewise.
      	* omp-simd-clone.cc: Likewise.
      	* optc-gen.awk: Likewise in output.
      	* optc-save-gen.awk: Likewise in output.
      	* options-urls-cc-gen.awk: Likewise in output.
      	* opts-common.cc: Likewise.
      	* opts-global.cc: Likewise.
      	* opts.cc: Likewise.
      	* pair-fusion.cc: Likewise.
      	* passes.cc: Likewise.
      	* pointer-query.cc: Likewise.
      	* predict.cc: Likewise.
      	* pretty-print.cc (pretty_printer::clone): Use std::unique_ptr and
      	::make_unique.
      	* pretty-print.h: Complain if INCLUDE_MEMORY is not defined.
      	(pretty_printer::clone): Use std::unique_ptr.
      	* print-rtl.cc: Add #define INCLUDE_MEMORY.
      	* print-tree.cc: Likewise.
      	* profile-count.cc: Likewise.
      	* range-op-float.cc: Likewise.
      	* range-op-ptr.cc: Likewise.
      	* range-op.cc: Likewise.
      	* range.cc: Likewise.
      	* read-rtl-function.cc: Likewise.
      	* rtl-error.cc: Likewise.
      	* rtl-ssa/accesses.cc: Likewise.
      	* rtl-ssa/blocks.cc: Likewise.
      	* rtl-ssa/changes.cc: Likewise.
      	* rtl-ssa/functions.cc: Likewise.
      	* rtl-ssa/insns.cc: Likewise.
      	* rtl-ssa/movement.cc: Likewise.
      	* rtl-tests.cc: Likewise.
      	* sanopt.cc: Likewise.
      	* sched-rgn.cc: Likewise.
      	* selftest-diagnostic-path.cc: Likewise.
      	* selftest-diagnostic.cc: Likewise.
      	* splay-tree-utils.cc: Likewise.
      	* sreal.cc: Likewise.
      	* stmt.cc: Likewise.
      	* substring-locations.cc: Likewise.
      	* symtab-clones.cc: Likewise.
      	* symtab-thunks.cc: Likewise.
      	* symtab.cc: Likewise.
      	* text-art/box-drawing.cc: Likewise.
      	* text-art/canvas.cc: Likewise.
      	* text-art/ruler.cc: Likewise.
      	* text-art/selftests.cc: Likewise.
      	* text-art/theme.cc: Likewise.
      	* toplev.cc: Likewise.  Include "make-unique.h".
      	(general_init): Use ::make_unique when setting option_manager.
      	* trans-mem.cc: Add #define INCLUDE_MEMORY.
      	* tree-affine.cc: Likewise.
      	* tree-call-cdce.cc: Likewise.
      	* tree-cfg.cc: Likewise.
      	* tree-chrec.cc: Likewise.
      	* tree-dfa.cc: Likewise.
      	* tree-diagnostic-client-data-hooks.cc: Include "make-unique.h".
      	(make_compiler_data_hooks): Use std::unique_ptr and ::make_unique.
      	* tree-diagnostic.cc: Add #define INCLUDE_MEMORY.
      	* tree-dump.cc: Likewise.
      	* tree-inline.cc: Likewise.
      	* tree-into-ssa.cc: Likewise.
      	* tree-logical-location.cc: Likewise.
      	* tree-nested.cc: Likewise.
      	* tree-nrv.cc: Likewise.
      	* tree-object-size.cc: Likewise.
      	* tree-outof-ssa.cc: Likewise.
      	* tree-pretty-print.cc: Likewise.
      	* tree-profile.cc: Likewise.
      	* tree-scalar-evolution.cc: Likewise.
      	* tree-sra.cc: Likewise.
      	* tree-ssa-address.cc: Likewise.
      	* tree-ssa-alias.cc: Likewise.
      	* tree-ssa-ccp.cc: Likewise.
      	* tree-ssa-coalesce.cc: Likewise.
      	* tree-ssa-copy.cc: Likewise.
      	* tree-ssa-dce.cc: Likewise.
      	* tree-ssa-dom.cc: Likewise.
      	* tree-ssa-forwprop.cc: Likewise.
      	* tree-ssa-ifcombine.cc: Likewise.
      	* tree-ssa-loop-ch.cc: Likewise.
      	* tree-ssa-loop-im.cc: Likewise.
      	* tree-ssa-loop-manip.cc: Likewise.
      	* tree-ssa-loop-niter.cc: Likewise.
      	* tree-ssa-loop-split.cc: Likewise.
      	* tree-ssa-math-opts.cc: Likewise.
      	* tree-ssa-operands.cc: Likewise.
      	* tree-ssa-phiprop.cc: Likewise.
      	* tree-ssa-pre.cc: Likewise.
      	* tree-ssa-propagate.cc: Likewise.
      	* tree-ssa-reassoc.cc: Likewise.
      	* tree-ssa-sccvn.cc: Likewise.
      	* tree-ssa-scopedtables.cc: Likewise.
      	* tree-ssa-sink.cc: Likewise.
      	* tree-ssa-strlen.cc: Likewise.
      	* tree-ssa-structalias.cc: Likewise.
      	* tree-ssa-ter.cc: Likewise.
      	* tree-ssa-uninit.cc: Likewise.
      	* tree-ssa.cc: Likewise.
      	* tree-ssanames.cc: Likewise.
      	* tree-stdarg.cc: Likewise.
      	* tree-streamer-in.cc: Likewise.
      	* tree-streamer-out.cc: Likewise.
      	* tree-streamer.cc: Likewise.
      	* tree-switch-conversion.cc: Likewise.
      	* tree-tailcall.cc: Likewise.
      	* tree-vrp.cc: Likewise.
      	* tree.cc: Likewise.
      	* ubsan.cc: Likewise.
      	* value-pointer-equiv.cc: Likewise.
      	* value-prof.cc: Likewise.
      	* value-query.cc: Likewise.
      	* value-range-pretty-print.cc: Likewise.
      	* value-range-storage.cc: Likewise.
      	* value-range.cc: Likewise.
      	* value-relation.cc: Likewise.
      	* var-tracking.cc: Likewise.
      	* varpool.cc: Likewise.
      	* vr-values.cc: Likewise.
      	* wide-int-print.cc: Likewise.
      
      gcc/testsuite/ChangeLog:
      	PR other/116613
      	* gcc.dg/plugin/diagnostic_group_plugin.c: Update for use of
      	std::unique_ptr.
      	* gcc.dg/plugin/diagnostic_plugin_xhtml_format.c: Likewise.
      	* gcc.dg/plugin/ggcplug.c: Likewise.
      
      libgcc/ChangeLog:
      	PR other/116613
      	* libgcov-util.c: Add #define INCLUDE_MEMORY.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      Co-authored-by: default avatarGaius Mulley <gaiusmod2@gmail.com>
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      bf43fe6a
  8. Jan 03, 2024
  9. Oct 29, 2023
    • Iain Buclaw's avatar
      d: Fix ICE: verify_gimple_failed (conversion of register to a different size... · ea8ffdca
      Iain Buclaw authored
      d: Fix ICE: verify_gimple_failed (conversion of register to a different size in 'view_convert_expr')
      
      Static arrays in D are passed around by value, rather than decaying to a
      pointer.  On x86_64 __builtin_va_list is an exception to this rule, but
      semantically it's still treated as a static array.
      
      This makes certain assignment operations fail due a mismatch in types.
      As all examples in the test program are rejected by C/C++ front-ends,
      these are now errors in D too to be consistent.
      
      	PR d/110712
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (d_build_call): Update call to convert_for_argument.
      	* d-convert.cc (is_valist_parameter_type): New function.
      	(check_valist_conversion): New function.
      	(convert_for_assignment): Update signature.  Add check whether
      	assigning va_list is permissible.
      	(convert_for_argument): Likewise.
      	* d-tree.h (convert_for_assignment): Update signature.
      	(convert_for_argument): Likewise.
      	* expr.cc (ExprVisitor::visit (AssignExp *)): Update call to
      	convert_for_assignment.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/pr110712.d: New test.
      ea8ffdca
  10. Oct 28, 2023
    • Iain Buclaw's avatar
      d: Fix ICE: in verify_gimple_in_seq on powerpc-darwin9 [PR112270] · 10f1489d
      Iain Buclaw authored
      This ICE was seen during stage2 on powerpc-darwin9 only.  There were
      still some uses of GCC's boolean_type_node in the D front-end, which
      caused a type mismatch to trigger as D bool size is fixed to 1 byte on
      all targets.
      
      So two new nodes have been introduced - d_bool_false_node and
      d_bool_true_node - which have replaced all remaining uses of
      boolean_false_node and boolean_true_node respectively.
      
      	PR d/112270
      
      gcc/d/ChangeLog:
      
      	* d-builtins.cc (d_build_d_type_nodes): Initialize d_bool_false_node,
      	d_bool_true_node.
      	* d-codegen.cc (build_array_struct_comparison): Use d_bool_false_node
      	instead of boolean_false_node.
      	* d-convert.cc (d_truthvalue_conversion): Use d_bool_false_node and
      	d_bool_true_node instead of boolean_false_node and boolean_true_node.
      	* d-tree.h (enum d_tree_index): Add DTI_BOOL_FALSE and DTI_BOOL_TRUE.
      	(d_bool_false_node): New macro.
      	(d_bool_true_node): New macro.
      	* modules.cc (build_dso_cdtor_fn): Use d_bool_false_node and
      	d_bool_true_node instead of boolean_false_node and boolean_true_node.
      	(register_moduleinfo): Use d_bool_type instead of boolean_type_node.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/pr112270.d: New test.
      10f1489d
    • Iain Buclaw's avatar
      d: Add warning for call expression without side effects · 5d2a360f
      Iain Buclaw authored
      In the last merge of the dmd front-end with upstream (r14-4830), this
      warning got removed from the semantic passes.  Reimplement the warning
      for the code generation pass instead, where it cannot have an effect on
      conditional compilation.
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (call_side_effect_free_p): New function.
      	* d-tree.h (CALL_EXPR_WARN_IF_UNUSED): New macro.
      	(call_side_effect_free_p): New prototype.
      	* expr.cc (ExprVisitor::visit (CallExp *)): Set
      	CALL_EXPR_WARN_IF_UNUSED on matched call expressions.
      	(ExprVisitor::visit (NewExp *)): Don't dereference the result of an
      	allocation call here.
      	* toir.cc (add_stmt): Emit warning when call expression added to
      	statement list without being used.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/Wunused_value.d: New test.
      5d2a360f
  11. Aug 20, 2023
    • Iain Buclaw's avatar
      d: Merge upstream dmd, druntime 26f049fb26, phobos 330d6a4fd. · d77c2804
      Iain Buclaw authored
      D front-end changes:
      
      	- Import dmd v2.105.0-beta.1.
      	- Added predefined version identifier VisionOS (ignored by GDC).
      	- Functions can no longer have `enum` storage class.
      	- The deprecation of the `body` keyword has been reverted, it is
      	  now an obsolete feature.
      	- The error for `scope class` has been reverted, it is now an
      	  obsolete feature.
      
      D runtime changes:
      
      	- Import druntime v2.105.0-beta.1.
      
      Phobos changes:
      
      	- Import phobos v2.105.0-beta.1.
      	- AliasSeq has been removed from std.math.
      	- extern(C) getdelim and getline have been removed from
      	  std.stdio.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd 26f049fb26.
      	* dmd/VERSION: Bump version to v2.105.0-beta.1.
      	* d-codegen.cc (get_frameinfo): Check useGC in condition.
      	* d-lang.cc (d_handle_option): Set obsolete parameter when compiling
      	with -Wall.
      	(d_post_options): Set useGC to false when compiling with
      	-fno-druntime.  Propagate obsolete flag to compileEnv.
      	* expr.cc (ExprVisitor::visit (CatExp *)): Check useGC in condition.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime 26f049fb26.
      	* src/MERGE: Merge upstream phobos 330d6a4fd.
      d77c2804
  12. Jul 10, 2023
    • Iain Buclaw's avatar
      d: Merge upstream dmd, druntime 17ccd12af3, phobos 8d3800bee. · 0cafc3b6
      Iain Buclaw authored
      D front-end changes:
      
      	- Import dmd v2.104.0.
      	- Assignment-style syntax is now allowed for `alias this'.
      	- Overloading `extern(C)' functions is now an error.
      
      D runtime changes:
      
      	- Import druntime v2.104.0.
      
      Phobos changes:
      
      	- Import phobos v2.104.0.
      	- Better static assert messages when instantiating
      	`std.algorithm.iteration.permutations' with wrong inputs.
      	- Added `std.system.instructionSetArchitecture' and
      	  `std.system.ISA'.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd 17ccd12af3.
      	* dmd/VERSION: Bump version to v2.104.0.
      	* Make-lang.in (D_FRONTEND_OBJS): Rename d/apply.o to
      	d/postordervisitor.o.
      	* d-codegen.cc (make_location_t): Update for new front-end interface.
      	(build_filename_from_loc): Likewise.
      	(build_assert_call): Likewise.
      	(build_array_bounds_call): Likewise.
      	(build_bounds_index_condition): Likewise.
      	(build_bounds_slice_condition): Likewise.
      	(build_frame_type): Likewise.
      	(get_frameinfo): Likewise.
      	* d-diagnostic.cc (d_diagnostic_report_diagnostic): Likewise.
      	* decl.cc (build_decl_tree): Likewise.
      	(start_function): Likewise.
      	* expr.cc (ExprVisitor::visit (NewExp *)): Replace code generation of
      	`new pointer' with front-end lowering.
      	* runtime.def (NEWITEMT): Remove.
      	(NEWITEMIT): Remove.
      	* toir.cc (IRVisitor::visit (LabelStatement *)): Update for new
      	front-end interface.
      	* typeinfo.cc (check_typeinfo_type): Likewise.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime 17ccd12af3.
      	* src/MERGE: Merge upstream phobos 8d3800bee.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/asm4.d: Update test.
      0cafc3b6
  13. Jul 09, 2023
    • Iain Buclaw's avatar
      d: Merge upstream dmd, druntime 28a3b24c2e, phobos 8ab95ded5. · 3b007164
      Iain Buclaw authored
      D front-end changes:
      
      	- Import dmd v2.104.0-beta.1.
      	- Better error message when attribute inference fails down the
      	  call stack.
      	- Using `;' as an empty statement has been turned into an error.
      	- Using `in' parameters with non- `extern(D)' or `extern(C++)'
      	  functions is deprecated.
      	- `in ref' on parameters has been deprecated in favor of
      	  `-preview=in'.
      	- Throwing `immutable', `const', `inout', and `shared' qualified
      	  objects is now deprecated.
      	- User Defined Attributes now parse Template Arguments.
      
      D runtime changes:
      
      	- Import druntime v2.104.0-beta.1.
      
      Phobos changes:
      
      	- Import phobos v2.104.0-beta.1.
      	- Better static assert messages when instantiating
      	  `std.algorithm.comparison.clamp' with wrong inputs.
      	- `std.typecons.Rebindable' now supports all types.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd 28a3b24c2e.
      	* dmd/VERSION: Bump version to v2.104.0-beta.1.
      	* d-codegen.cc (build_bounds_slice_condition): Update for new
      	front-end interface.
      	* d-lang.cc (d_init_options): Likewise.
      	(d_handle_option): Likewise.
      	(d_post_options): Initialize global.compileEnv.
      	* expr.cc (ExprVisitor::visit (CatExp *)): Replace code generation
      	with new front-end lowering.
      	(ExprVisitor::visit (LoweredAssignExp *)): New method.
      	(ExprVisitor::visit (StructLiteralExp *)): Don't generate static
      	initializer symbols for structs defined in C sources.
      	* runtime.def (ARRAYCATT): Remove.
      	(ARRAYCATNTX): Remove.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime 28a3b24c2e.
      	* src/MERGE: Merge upstream phobos 8ab95ded5.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/rtti1.d: Move array concat testcase to ...
      	* gdc.dg/nogc1.d: ... here.  New test.
      3b007164
  14. May 18, 2023
  15. Mar 16, 2023
    • Iain Buclaw's avatar
      d: Fix closure fields don't get same alignment as local variable [PR109144] · 46c4be98
      Iain Buclaw authored
      Local variables with both non-local references and explicit alignment
      did not propagate their alignment to either the closure field or closure
      frame type, resulting in the closure being misaligned. This is now
      correctly set-up when building the frame type.
      
      	PR d/109144
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (build_frame_type): Set frame field and type alignment.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/torture/pr109144.d: New test.
      46c4be98
  16. Mar 03, 2023
    • Iain Buclaw's avatar
      d: vector float comparison doesn't result in 0 or -1 [PR108945] · 51af8a64
      Iain Buclaw authored
      When comparing two vectors, the type of vector was used as the result of
      the condition result.  This meant that for floating point comparisons,
      each value would either be `0.0' or `-1.0' reinterpreted as an integer,
      not the expected integral bitmask values `0' and `-1'.
      
      Instead, use the comparison type determined by truth_type_for as the
      result of the comparison.  If a reinterpret is later required by the
      final conversion for generating CmpExp, it is still only going to
      reinterpret one integer kind as another.
      
      	PR d/108945
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (build_boolop): Evaluate vector comparison as
      	the truth_type_for vector type.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/pr108945.d: New test.
      51af8a64
  17. Feb 21, 2023
  18. Jan 16, 2023
  19. Aug 15, 2022
    • Iain Buclaw's avatar
      d: Fix internal compiler error: Segmentation fault at gimple-expr.cc:88 · e206feca
      Iain Buclaw authored
      Because complex types are deprecated in the language, the new way to
      expose native complex types is by defining an enum with a basetype of a
      library-defined struct that is implicitly treated as-if it is native.
      As casts are not implicitly added by the front-end when downcasting from
      enum to its underlying type, we must insert an explicit cast during the
      code generation pass.
      
      	PR d/106623
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (underlying_complex_expr): New function.
      	(d_build_call): Handle passing native complex objects as the
      	library-defined equivalent.
      	* d-tree.h (underlying_complex_expr): Declare.
      	* expr.cc (ExprVisitor::visit (DotVarExp *)): Call
      	underlying_complex_expr instead of build_vconvert.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/torture/pr106623.d: New test.
      e206feca
    • Iain Buclaw's avatar
      d: Field names of anonymous delegates should be same as regular delegate types. · 9fb12ee6
      Iain Buclaw authored
      Doesn't change anything in the code generation or ABI, but makes it
      consistent with regular delegates as names would match up when
      inspecting tree dumps.
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (build_delegate_cst): Give anonymous delegate field
      	names same as per ABI spec.
      9fb12ee6
  20. Aug 03, 2022
    • Iain Buclaw's avatar
      d: Merge upstream dmd d7772a2369, phobos 5748ca43f. · b6df1132
      Iain Buclaw authored
      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:
      b6df1132
  21. Jun 28, 2022
    • Iain Buclaw's avatar
      d: Use create_tmp_var_raw and get_callee_fndecl · ad4c44d2
      Iain Buclaw authored
      A couple of small patterns that repeat are generating a temporary, and
      getting a function out of a CALL_EXPR.  There are convenience functions
      for these in the common parts of gcc, use them instead.
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc: Include gimple-expr.h.
      	(force_target_expr): Use create_tmp_var_raw.
      	* decl.cc: Inlucde gimple-expr.h.
      	(build_local_temp): Use create_tmp_var_raw.
      	* intrinsics.cc (expand_intrinsic_rotate): Use get_callee_fndecl.
      	(maybe_expand_intrinsic): Likewise.
      ad4c44d2
  22. Jun 24, 2022
    • Iain Buclaw's avatar
      d: Add `@register' attribute to compiler and library. · 91418c42
      Iain Buclaw authored
      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.
      91418c42
    • Iain Buclaw's avatar
      d: Construct indexes of ARRAY_TYPE using ARRAY_REF. · 8288cd63
      Iain Buclaw authored
      This is a small simplification over `((T *)&array)[index]', which also
      allows eliding an unneccesary marking of TREE_ADDRESSABLE when the array
      expression is a parameter or variable declaration.
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (build_array_index): Rename to...
      	(build_pointer_index): ...this.
      	* d-tree.h (build_array_index): Rename declaration to...
      	(build_pointer_index): ...this.
      	* expr.cc (ExprVisitor::visit (IndexExp *)): Construct indexes of
      	ARRAY_TYPE using ARRAY_REF.
      	(ExprVisitor::visit (SliceExp *)): Update.
      	* intrinsics.cc (expand_intrinsic_bt): Update.
      8288cd63
  23. Jun 15, 2022
    • Iain Buclaw's avatar
      d: Delay completing aggregate and enum types until after attributes have been applied. · f4c3ce32
      Iain Buclaw authored
      Because of forward/recursive references, the TYPE_SIZE, TYPE_ALIGN, and
      TYPE_MODE of structs and enums were set before laying out its members.
      
      This adds a new macro TYPE_FORWARD_REFERENCES for storing those forward
      references against the incomplete type, laying them out after the type
      has been completed.  Construction of the TYPE_DECL has also been moved
      on earlier in the type generation pass, which will allow the possibility
      of adding gdc-specific type attributes to the D front-end in the future.
      
      gcc/d/ChangeLog:
      
      	* d-attribs.cc (apply_user_attributes): Set ATTR_FLAG_TYPE_IN_PLACE
      	only on incomplete types.
      	* d-codegen.cc (copy_aggregate_type): Set TYPE_STUB_DECL after copy.
      	* d-compiler.cc (Compiler::onParseModule): Adjust.
      	* d-tree.h (AGGREGATE_OR_ENUM_TYPE_CHECK): Define.
      	(TYPE_FORWARD_REFERENCES): Define.
      	* decl.cc (gcc_attribute_p): Update documentation.
      	(DeclVisitor::visit (StructDeclaration *)): Exit before building type
      	node if gcc.attributes symbol.
      	(DeclVisitor::visit (ClassDeclaration *)): Build type node and add
      	TYPE_NAME to current binding level before emitting anything else.
      	(DeclVisitor::visit (InterfaceDeclaration *)): Likewise.
      	(DeclVisitor::visit (EnumDeclaration *)): Likewise.
      	(build_type_decl): Move rest_of_decl_compilation() call to
      	finish_aggregate_type().
      	* types.cc (insert_aggregate_field): Move layout_decl() call to
      	finish_aggregate_type().
      	(insert_aggregate_bitfield): Likewise.
      	(layout_aggregate_members): Adjust.
      	(finish_incomplete_fields): New function.
      	(finish_aggregate_type): Handle forward referenced field types.  Call
      	rest_of_type_compilation() after completing the aggregate.
      	(TypeVisitor::visit (TypeEnum *)): Don't set size and alignment until
      	after apply_user_attributes().  Call rest_of_type_compilation() after
      	completing the enumeral.
      	(TypeVisitor::visit (TypeStruct *)): Call build_type_decl() before
      	apply_user_attributes().  Don't set size, alignment, and mode until
      	after apply_user_attributes().
      	(TypeVisitor::visit (TypeClass *)): Call build_type_decl() before
      	applly_user_attributes().
      f4c3ce32
  24. May 16, 2022
    • Iain Buclaw's avatar
      d: Merge upstream dmd 60bfa0ee7, druntime 94bd5bcb, phobos 3a1cd9a01. · 5eb9927a
      Iain Buclaw authored
      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.
      5eb9927a
  25. Apr 02, 2022
    • Iain Buclaw's avatar
      d: Merge upstream dmd 47871363d, druntime, c52e28b7, phobos 99e9c1b77. · 235d5a96
      Iain Buclaw authored
      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.
      235d5a96
  26. Mar 21, 2022
    • Iain Buclaw's avatar
      d: Fix internal compiler error: in build_complex, at tree.c:2358 · 1dd51373
      Iain Buclaw authored
      The conversion from the special _Complex enum to native complex used
      build_complex, however the input value isn't necessarily a literal.
      
      	PR d/105004
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (build_struct_literal): Use complex_expr to build
      	complex expressions from __c_complex types.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/pr105004.d: New test.
      1dd51373
  27. Jan 03, 2022
  28. Dec 10, 2021
    • Iain Buclaw's avatar
      d: Merge upstream dmd 3982604c5, druntime bc58b1e9, phobos 12329adb6. · 9c7d5e88
      Iain Buclaw authored
      D front-end changes:
      
          - Import dmd mainline development.
          - Split off enum EXP from enum TOK.
          - Integer promotions now follow C integral promotions by default.
          - Implements __traits(initSymbol).
          - Lowering of array construction has been moved to the dmd
            front-end.
          - Fix segfault in dmd.lexer from unaligned read (PR103529).
      
      Druntime changes:
      
          - Import druntime mainline development.
          - Define SIG_BLOCK for Solaris (PR103528).
      
      Phobos changes:
      
          - Import phobos mainline development.
      
      gcc/d/ChangeLog:
      
      	PR d/103529
      	* dmd/MERGE: Merge upstream dmd 3982604c5.
      	* Make-lang.in (D_FRONTEND_OBJS): Add d/root-optional.o.
      	* d-attribs.cc (build_attributes): Update for new front-end interface.
      	* d-codegen.cc (d_build_call): Likewise.
      	* d-compiler.cc (Compiler::paintAsType): Likewise.
      	* d-lang.cc (d_handle_option): Remove OPT_fpreview_intpromote, add
      	handling of OPT_frevert_intpromote.
      	* d-port.cc (Port::valcpy): Assert buffer is aligned.
      	* d-target.cc (Target::isVectorOpSupported): Update for new front-end
      	interface.
      	* decl.cc (layout_class_initializer): Likewise.
      	* expr.cc (lvalue_p): Likewise.
      	(binop_assignment): Likewise.
      	(ExprVisitor::visit): Likewise.
      	(ExprVisitor::visit (AssignExp *)): Remove generation of _d_arrayctor
      	and _d_arraysetctor library helpers.
      	(ExprVisitor::visit (VarExp *)): Support __traits(initSymbol).
      	* intrinsics.cc (expand_intrinsic_rotate): Update for new front-end
      	interface.
      	* lang.opt (fpreview=intpromote): Remove.
      	(frevert=intpromote): New.
      	* runtime.def (ARRAYCTOR): Remove.
      	(ARRAYSETCTOR): Remove.
      	* toir.cc (IRVisitor::visit): Update for new front-end interface.
      	* types.cc (layout_aggregate_members): Likewise.
      	* dmd/root/optional.d: New file.
      	* dmd/root/optional.h: New file.
      
      libphobos/ChangeLog:
      
      	PR d/103528
      	* libdruntime/MERGE: Merge upstream druntime bc58b1e9.
      	* libdruntime/Makefile.am (DRUNTIME_DSOURCES_LINUX): Remove
      	core/sys/linux/syscalls.d.
      	* libdruntime/Makefile.in: Regenerate.
      	* src/MERGE: Merge upstream phobos 12329adb6.
      	* testsuite/libphobos.config/config.exp: Add test22523.
      	* libdruntime/core/sys/linux/syscalls.d: Removed.
      	* testsuite/libphobos.config/test22523.d: New test.
      9c7d5e88
  29. Dec 08, 2021
    • Iain Buclaw's avatar
      d: Merge upstream dmd 568496d5b, druntime 178c44ff, phobos 574bf883b. · 0fb57034
      Iain Buclaw authored
      D front-end changes:
      
          - Import dmd v2.098.0
          - New ImportC module for compiling preprocessed C11 code into D.
          - New -ftransition=in switch.
          - Improved handling of new 'noreturn' type.
      
      Druntime changes:
      
          - Import druntime v2.098.0
          - Fix broken import in core.sys.linux.perf_event module (PR103558).
      
      Phobos changes:
      
          - Import phobos v2.098.0
          - All sources are now compiled with -fpreview=fieldwise.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd 568496d5b.
      	* Make-lang.in (D_FRONTEND_OBJS): Add d/common-file.o,
      	d/common-outbuffer.o, d/common-string.o, d/file_manager.o,
      	d/importc.o.  Remove d/root-outbuffer.o.
      	(d/common-%.o): New recipe.
      	* d-builtins.cc (build_frontend_type): Update for new front-end
      	interface.
      	(d_build_d_type_nodes): Set noreturn_type_node.
      	* d-codegen.cc (d_build_call): Don't call function if one of the
      	arguments is type 'noreturn'.
      	(build_vthis_function): Propagate TYPE_QUAL_VOLATILE from original
      	function type.
      	* d-frontend.cc (eval_builtin): Update signature.
      	(getTypeInfoType): Likewise.
      	(toObjFile): New function.
      	* d-gimplify.cc (d_gimplify_call_expr): Always evaluate arguments from
      	left to right.
      	* d-lang.cc (d_handle_option): Handle OPT_ftransition_in.
      	(d_parse_file): Don't generate D main if it is declared in user code.
      	* d-tree.h (CALL_EXPR_ARGS_ORDERED): Remove.
      	(enum d_tree_index): Add DTI_BOTTOM_TYPE.
      	(noreturn_type_node): New.
      	* decl.cc (apply_pragma_crt): Remove.
      	(DeclVisitor::visit): Update for new front-end interface.
      	(DeclVisitor::visit (PragmaDeclaration *)): Don't handle
      	crt_constructor and crt_destructor pragmas.
      	(DeclVisitor::visit (VarDeclaration *)): Don't generate declarations
      	of type 'noreturn'.
      	(DeclVisitor::visit (FuncDeclaration *)): Stop adding parameters when
      	'noreturn' type has been encountered.
      	(get_symbol_decl): Set DECL_STATIC_CONSTRUCTOR and
      	DECL_STATIC_DESTRUCTOR on decl node if requested.
      	(aggregate_initializer_decl): Update for new front-end interface.
      	* expr.cc (ExprVisitor::visit (CallExp *)): Always use the 'this'
      	object as the result of calling any constructor function.
      	(ExprVisitor::visit): Update for new front-end interface.
      	* gdc.texi (Runtime Options): Document -fmain and -ftransition=in.
      	* lang.opt (ftransition=in): New option.
      	* modules.cc (get_internal_fn): Update for new front-end interface.
      	* types.cc (TypeVisitor::visit): Likewise.
      	(TypeVisitor::visit (TypeNoreturn *)): Return noreturn_type_node.
      	(TypeVisitor::visit (TypeFunction *)): Stop adding parameters when
      	'notreturn' type has been encountered.  Qualify function types that
      	return 'noreturn' as TYPE_QUAL_VOLATILE.
      
      libphobos/ChangeLog:
      
      	PR d/103558
      	* libdruntime/MERGE: Merge upstream druntime 178c44ff.
      	* libdruntime/Makefile.am (DRUNTIME_DSOURCES_LINUX): Add
      	core/sys/linux/syscalls.d.
      	(DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/pthread_np.d.
      	* libdruntime/Makefile.in: Regenerate.
      	* src/MERGE: Merge upstream phobos 574bf883b.
      	* src/Makefile.am (D_EXTRA_DFLAGS): Add -fpreview=fieldwise.
      	* src/Makefile.in: Regenerate.
      	* testsuite/libphobos.exceptions/assert_fail.d: Update test.
      	* testsuite/libphobos.betterc/test22336.d: New test.
      0fb57034
  30. Nov 30, 2021
    • Iain Buclaw's avatar
      d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1) · 5fee5ec3
      Iain Buclaw authored
      The D front-end is now itself written in D, in order to build GDC, you
      will need a working GDC compiler (GCC version 9.1 or later).
      
      GCC changes:
      
          - Add support for bootstrapping the D front-end.
      
      These add the required components in order to have a D front-end written
      in D itself.  Because the compiler front-end only depends on the core
      runtime modules, only libdruntime is built for the bootstrap stages.
      
      D front-end changes:
      
          - Import dmd v2.098.0-beta.1.
      
      Druntime changes:
      
          - Import druntime v2.098.0-beta.1.
      
      Phobos changes:
      
          - Import phobos v2.098.0-beta.1.
      
      The jump from v2.076.1 to v2.098.0 covers nearly 4 years worth of
      development on the D programming language and run-time libraries.
      
      ChangeLog:
      
      	* Makefile.def: Add bootstrap to libbacktrace, libphobos, zlib, and
      	libatomic.
      	* Makefile.in: Regenerate.
      	* Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Fix command for GDC.
      	(STAGE1_CONFIGURE_FLAGS): Add --with-libphobos-druntime-only if
      	target-libphobos-bootstrap.
      	(STAGE2_CONFIGURE_FLAGS): Likewise.
      	* configure: Regenerate.
      	* configure.ac: Add support for bootstrapping D front-end.
      
      config/ChangeLog:
      
      	* acx.m4 (ACX_PROG_GDC): New m4 function.
      
      gcc/ChangeLog:
      
      	* Makefile.in (GDC): New variable.
      	(GDCFLAGS): New variable.
      	* configure: Regenerate.
      	* configure.ac: Add call to ACX_PROG_GDC.  Substitute GDCFLAGS.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd b8384668f.
      	* Make-lang.in (d-warn): Use strict warnings.
      	(DMD_WARN_CXXFLAGS): Remove.
      	(DMD_COMPILE): Remove.
      	(CHECKING_DFLAGS): Define.
      	(WARN_DFLAGS): Define.
      	(ALL_DFLAGS): Define.
      	(DCOMPILE.base): Define.
      	(DCOMPILE): Define.
      	(DPOSTCOMPILE): Define.
      	(DLINKER): Define.
      	(DLLINKER): Define.
      	(D_FRONTEND_OBJS): Add new dmd front-end objects.
      	(D_GENERATED_SRCS): Remove.
      	(D_GENERATED_OBJS): Remove.
      	(D_ALL_OBJS): Remove D_GENERATED_OBJS.
      	(d21$(exeext)): Build using DLLINKER and -static-libphobos.
      	(d.tags): Remove dmd/*.c and dmd/root/*.c.
      	(d.mostlyclean): Remove D_GENERATED_SRCS, d/idgen$(build_exeext),
      	d/impcnvgen$(build_exeext).
      	(D_INCLUDES): Include $(srcdir)/d/dmd/res.
      	(CFLAGS-d/id.o): Remove.
      	(CFLAGS-d/impcnvtab.o): Remove.
      	(d/%.o): Build using DCOMPILE and DPOSTCOMPILE.  Update dependencies
      	from d/dmd/%.c to d/dmd/%.d.
      	(d/idgen$(build_exeext)): Remove.
      	(d/impcnvgen$(build_exeext)): Remove.
      	(d/id.c): Remove.
      	(d/id.h): Remove.
      	(d/impcnvtab.c): Remove.
      	(d/%.dmdgen.o): Remove.
      	(D_SYSTEM_H): Remove.
      	(d/idgen.dmdgen.o): Remove.
      	(d/impcnvgen.dmdgen.o): Remove.
      	* config-lang.in (boot_language): New variable.
      	* d-attribs.cc: Include dmd/expression.h.
      	* d-builtins.cc: Include d-frontend.h.
      	(build_frontend_type): Update for new front-end interface.
      	(d_eval_constant_expression): Likewise.
      	(d_build_builtins_module): Likewise.
      	(maybe_set_builtin_1): Likewise.
      	(d_build_d_type_nodes): Likewise.
      	* d-codegen.cc (d_decl_context): Likewise.
      	(declaration_reference_p): Likewise.
      	(declaration_type): Likewise.
      	(parameter_reference_p): Likewise.
      	(parameter_type): Likewise.
      	(get_array_length): Likewise.
      	(build_delegate_cst): Likewise.
      	(build_typeof_null_value): Likewise.
      	(identity_compare_p): Likewise.
      	(lower_struct_comparison): Likewise.
      	(build_filename_from_loc): Likewise.
      	(build_assert_call): Remove LIBCALL_SWITCH_ERROR.
      	(build_bounds_index_condition): Call LIBCALL_ARRAYBOUNDS_INDEXP on
      	bounds error.
      	(build_bounds_slice_condition): Call LIBCALL_ARRAYBOUNDS_SLICEP on
      	bounds error.
      	(array_bounds_check): Update for new front-end interface.
      	(checkaction_trap_p): Handle CHECKACTION_context.
      	(get_function_type): Update for new front-end interface.
      	(d_build_call): Likewise.
      	* d-compiler.cc: Remove include of dmd/scope.h.
      	(Compiler::genCmain): Remove.
      	(Compiler::paintAsType): Update for new front-end interface.
      	(Compiler::onParseModule): Likewise.
      	* d-convert.cc (convert_expr): Remove call to LIBCALL_ARRAYCAST.
      	(convert_for_rvalue): Update for new front-end interface.
      	(convert_for_assignment): Likewise.
      	(convert_for_condition): Likewise.
      	(d_array_convert): Likewise.
      	* d-diagnostic.cc (error): Remove.
      	(errorSupplemental): Remove.
      	(warning): Remove.
      	(warningSupplemental): Remove.
      	(deprecation): Remove.
      	(deprecationSupplemental): Remove.
      	(message): Remove.
      	(vtip): New.
      	* d-frontend.cc (global): Remove.
      	(Global::_init): Remove.
      	(Global::startGagging): Remove.
      	(Global::endGagging): Remove.
      	(Global::increaseErrorCount): Remove.
      	(Loc::Loc): Remove.
      	(Loc::toChars): Remove.
      	(Loc::equals): Remove.
      	(isBuiltin): Update for new front-end interface.
      	(eval_builtin): Likewise.
      	(getTypeInfoType): Likewise.
      	(inlineCopy): Remove.
      	* d-incpath.cc: Include d-frontend.h.
      	(add_globalpaths): Call d_gc_malloc to allocate Strings.
      	(add_filepaths): Likewise.
      	* d-lang.cc: Include dmd/id.h, dmd/root/file.h, d-frontend.h.  Remove
      	include of dmd/mars.h, id.h.
      	(entrypoint_module): Remove.
      	(entrypoint_root_module): Remove.
      	(deps_write_string): Update for new front-end interface.
      	(deps_write): Likewise.
      	(d_init_options): Call rt_init.  Remove setting global params that are
      	default initialized by the front-end.
      	(d_handle_option): Handle OPT_fcheckaction_, OPT_fdump_c___spec_,
      	OPT_fdump_c___spec_verbose, OPT_fextern_std_, OPT_fpreview,
      	OPT_revert, OPT_fsave_mixins_, and OPT_ftransition.
      	(d_post_options): Propagate dip1021 and dip1000 preview flags to
      	dip25, and flag_diagnostics_show_caret to printErrorContext.
      	(d_add_entrypoint_module): Remove.
      	(d_parse_file): Update for new front-end interface.
      	(d_type_promotes_to): Likewise.
      	(d_types_compatible_p): Likewise.
      	* d-longdouble.cc (CTFloat::zero): Remove.
      	(CTFloat::one): Remove.
      	(CTFloat::minusone): Remove.
      	(CTFloat::half): Remove.
      	* d-system.h (POSIX): Remove.
      	(realpath): Remove.
      	(isalpha): Remove.
      	(isalnum): Remove.
      	(isdigit): Remove.
      	(islower): Remove.
      	(isprint): Remove.
      	(isspace): Remove.
      	(isupper): Remove.
      	(isxdigit): Remove.
      	(tolower): Remove.
      	(_mkdir): Remove.
      	(INT32_MAX): Remove.
      	(INT32_MIN): Remove.
      	(INT64_MIN): Remove.
      	(UINT32_MAX): Remove.
      	(UINT64_MAX): Remove.
      	* d-target.cc: Include calls.h.
      	(target): Remove.
      	(define_float_constants): Remove initialization of snan.
      	(Target::_init): Update for new front-end interface.
      	(Target::isVectorTypeSupported): Likewise.
      	(Target::isVectorOpSupported): Remove cases for unordered operators.
      	(TargetCPP::typeMangle): Update for new front-end interface.
      	(TargetCPP::parameterType): Likewise.
      	(Target::systemLinkage): Likewise.
      	(Target::isReturnOnStack): Likewise.
      	(Target::isCalleeDestroyingArgs): Define.
      	(Target::preferPassByRef): Define.
      	* d-tree.h (d_add_entrypoint_module): Remove.
      	* decl.cc (gcc_attribute_p): Update for new front-end interface.
      	(apply_pragma_crt): Define.
      	(DeclVisitor::visit(PragmaDeclaration *)): Handle pragmas
      	crt_constructor and crt_destructor.
      	(DeclVisitor::visit(TemplateDeclaration *)): Update for new front-end
      	interface.
      	(DeclVisitor::visit): Likewise.
      	(DeclVisitor::finish_vtable): Likewise.
      	(get_symbol_decl): Error if template has more than one nesting
      	context.  Update for new front-end interface.
      	(make_thunk): Update for new front-end interface.
      	(get_vtable_decl): Likewise.
      	* expr.cc (ExprVisitor::visit): Likewise.
      	(build_return_dtor): Likewise.
      	* imports.cc (ImportVisitor::visit): Likewise.
      	* intrinsics.cc: Include dmd/expression.h.  Remove include of
      	dmd/mangle.h.
      	(maybe_set_intrinsic): Update for new front-end interface.
      	* intrinsics.def (INTRINSIC_ROL): Update intrinsic signature.
      	(INTRINSIC_ROR): Likewise.
      	(INTRINSIC_ROR_TIARG): Likewise.
      	(INTRINSIC_TOPREC): Likewise.
      	(INTRINSIC_TOPRECL): Likewise.
      	(INTRINSIC_TAN): Update intrinsic module and signature.
      	(INTRINSIC_ISNAN): Likewise.
      	(INTRINSIC_ISFINITE): Likewise.
      	(INTRINSIC_COPYSIGN): Define intrinsic.
      	(INTRINSIC_COPYSIGNI): Define intrinsic.
      	(INTRINSIC_EXP): Update intrinsic module.
      	(INTRINSIC_EXPM1): Likewise.
      	(INTRINSIC_EXP2): Likewise.
      	(INTRINSIC_LOG): Likewise.
      	(INTRINSIC_LOG2): Likewise.
      	(INTRINSIC_LOG10): Likewise.
      	(INTRINSIC_POW): Likewise.
      	(INTRINSIC_ROUND): Likewise.
      	(INTRINSIC_FLOORF): Likewise.
      	(INTRINSIC_FLOOR): Likewise.
      	(INTRINSIC_FLOORL): Likewise.
      	(INTRINSIC_CEILF): Likewise.
      	(INTRINSIC_CEIL): Likewise.
      	(INTRINSIC_CEILL): Likewise.
      	(INTRINSIC_TRUNC): Likewise.
      	(INTRINSIC_FMIN): Likewise.
      	(INTRINSIC_FMAX): Likewise.
      	(INTRINSIC_FMA): Likewise.
      	(INTRINSIC_VA_ARG): Update intrinsic signature.
      	(INTRINSIC_VASTART): Likewise.
      	* lang.opt (fcheck=): Add alternate aliases for contract switches.
      	(fcheckaction=): New option.
      	(check_action): New Enum and EnumValue entries.
      	(fdump-c++-spec-verbose): New option.
      	(fdump-c++-spec=): New option.
      	(fextern-std=): New option.
      	(extern_stdcpp): New Enum and EnumValue entries
      	(fpreview=): New options.
      	(frevert=): New options.
      	(fsave-mixins): New option.
      	(ftransition=): Update options.
      	* modules.cc (get_internal_fn): Replace Prot with Visibility.
      	(build_internal_fn): Likewise.
      	(build_dso_cdtor_fn): Likewise.
      	(build_module_tree): Remove check for __entrypoint module.
      	* runtime.def (P5): Define.
      	(ARRAYBOUNDS_SLICEP): Define.
      	(ARRAYBOUNDS_INDEXP): Define.
      	(NEWTHROW): Define.
      	(ADCMP2): Remove.
      	(ARRAYCAST): Remove.
      	(SWITCH_STRING): Remove.
      	(SWITCH_USTRING): Remove.
      	(SWITCH_DSTRING): Remove.
      	(SWITCH_ERROR): Remove.
      	* toir.cc (IRVisitor::visit): Update for new front-end interface.
      	(IRVisitor::check_previous_goto): Remove checks for case and default
      	statements.
      	(IRVisitor::visit(SwitchStatement *)): Remove handling of string
      	switch conditions.
      	* typeinfo.cc: Include d-frontend.h.
      	(get_typeinfo_kind): Update for new front-end interface.
      	(make_frontend_typeinfo): Likewise.
      	(TypeInfoVisitor::visit): Likewise.
      	(builtin_typeinfo_p): Likewise.
      	(get_typeinfo_decl): Likewise.
      	(build_typeinfo): Likewise.
      	* types.cc (valist_array_p): Likewise.
      	(make_array_type): Likewise.
      	(merge_aggregate_types): Likewise.
      	(TypeVisitor::visit(TypeBasic *)): Likewise.
      	(TypeVisitor::visit(TypeFunction *)): Likewise.
      	(TypeVisitor::visit(TypeStruct *)): Update comment.
      	* verstr.h: Removed.
      	* d-frontend.h: New file.
      
      gcc/po/ChangeLog:
      
      	* EXCLUDES: Remove d/dmd sources from list.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/Wcastresult2.d: Update test.
      	* gdc.dg/asm1.d: Likewise.
      	* gdc.dg/asm2.d: Likewise.
      	* gdc.dg/asm3.d: Likewise.
      	* gdc.dg/gdc282.d: Likewise.
      	* gdc.dg/imports/gdc170.d: Likewise.
      	* gdc.dg/intrinsics.d: Likewise.
      	* gdc.dg/pr101672.d: Likewise.
      	* gdc.dg/pr90650a.d: Likewise.
      	* gdc.dg/pr90650b.d: Likewise.
      	* gdc.dg/pr94777a.d: Likewise.
      	* gdc.dg/pr95250.d: Likewise.
      	* gdc.dg/pr96869.d: Likewise.
      	* gdc.dg/pr98277.d: Likewise.
      	* gdc.dg/pr98457.d: Likewise.
      	* gdc.dg/simd1.d: Likewise.
      	* gdc.dg/simd2a.d: Likewise.
      	* 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.
      	* gdc.dg/simd7951.d: Likewise.
      	* gdc.dg/torture/gdc309.d: Likewise.
      	* gdc.dg/torture/pr94424.d: Likewise.
      	* gdc.dg/torture/pr94777b.d: Likewise.
      	* lib/gdc-utils.exp (gdc-convert-args): Handle new compiler options.
      	(gdc-convert-test): Handle CXXFLAGS, EXTRA_OBJC_SOURCES, and ARG_SETS
      	test directives.
      	(gdc-do-test): Only import modules in the test run directory.
      	* gdc.dg/pr94777c.d: New test.
      	* gdc.dg/pr96156b.d: New test.
      	* gdc.dg/pr96157c.d: New test.
      	* gdc.dg/simd_ctfe.d: New test.
      	* gdc.dg/torture/simd17344.d: New test.
      	* gdc.dg/torture/simd20052.d: New test.
      	* gdc.dg/torture/simd6.d: New test.
      	* gdc.dg/torture/simd7.d: New test.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime e6caaab9.
      	* libdruntime/Makefile.am (D_EXTRA_FLAGS): Build libdruntime with
      	-fpreview=dip1000, -fpreview=fieldwise, and -fpreview=dtorfields.
      	(ALL_DRUNTIME_SOURCES): Add DRUNTIME_DSOURCES_STDCXX.
      	(DRUNTIME_DSOURCES): Update list of C binding modules.
      	(DRUNTIME_DSOURCES_STDCXX): Likewise.
      	(DRUNTIME_DSOURCES_LINUX): Likewise.
      	(DRUNTIME_DSOURCES_OPENBSD): Likewise.
      	(DRUNTIME_DISOURCES): Remove __entrypoint.di.
      	* libdruntime/Makefile.in: Regenerated.
      	* libdruntime/__entrypoint.di: Removed.
      	* libdruntime/gcc/deh.d (_d_isbaseof): Update signature.
      	(_d_createTrace): Likewise.
      	(__gdc_begin_catch): Remove reference to the exception.
      	(_d_throw): Increment reference count of thrown object before unwind.
      	(__gdc_personality): Chain exceptions with  Throwable.chainTogether.
      	* libdruntime/gcc/emutls.d: Update imports.
      	* libdruntime/gcc/sections/elf.d: Update imports.
      	(DSO.moduleGroup): Update signature.
      	* libdruntime/gcc/sections/macho.d: Update imports.
      	(DSO.moduleGroup): Update signature.
      	* libdruntime/gcc/sections/pecoff.d: Update imports.
      	(DSO.moduleGroup): Update signature.
      	* src/MERGE: Merge upstream phobos 5ab9ad256.
      	* src/Makefile.am (D_EXTRA_DFLAGS): Add -fpreview=dip1000 and
      	-fpreview=dtorfields flags.
      	(PHOBOS_DSOURCES): Update list of std modules.
      	* src/Makefile.in: Regenerate.
      	* testsuite/lib/libphobos.exp (libphobos-dg-test): Handle assembly
      	compile types.
      	(dg-test): Override.
      	(additional_prunes): Define.
      	(libphobos-dg-prune): Filter any additional_prunes set by tests.
      	* testsuite/libphobos.aa/test_aa.d: Update test.
      	* testsuite/libphobos.druntime/druntime.exp (version_flags): Add
      	-fversion=CoreUnittest.
      	* testsuite/libphobos.druntime_shared/druntime_shared.exp
      	(version_flags): Add -fversion=CoreUnittest -fversion=Shared.
      	* testsuite/libphobos.exceptions/unknown_gc.d: Update test.
      	* testsuite/libphobos.hash/test_hash.d: Update test.
      	* testsuite/libphobos.phobos/phobos.exp (version_flags): Add
      	-fversion=StdUnittest
      	* testsuite/libphobos.phobos_shared/phobos_shared.exp (version_flags):
      	Likewise.
      	* testsuite/libphobos.shared/host.c: Update test.
      	* testsuite/libphobos.shared/load.d: Update test.
      	* testsuite/libphobos.shared/load_13414.d: Update test.
      	* testsuite/libphobos.thread/fiber_guard_page.d: Update test.
      	* testsuite/libphobos.thread/tlsgc_sections.d: Update test.
      	* testsuite/testsuite_flags.in: Add -fpreview=dip1000 to --gdcflags.
      	* testsuite/libphobos.shared/link_mod_collision.d: Removed.
      	* testsuite/libphobos.shared/load_mod_collision.d: Removed.
      	* testsuite/libphobos.betterc/betterc.exp: New test.
      	* testsuite/libphobos.config/config.exp: New test.
      	* testsuite/libphobos.gc/gc.exp: New test.
      	* testsuite/libphobos.imports/imports.exp: New test.
      	* testsuite/libphobos.lifetime/lifetime.exp: New test.
      	* testsuite/libphobos.unittest/unittest.exp: New test.
      5fee5ec3
  31. Aug 29, 2021
    • Iain Buclaw's avatar
      d: Call the assertp and boundsp variants for assert and array contract failures. · 766f5f87
      Iain Buclaw authored
      gcc/d/ChangeLog:
      
      	* d-codegen.cc: Include dmd/module.h.
      	(build_filename_from_loc): New function.
      	(d_assert_call): Rename to...
      	(build_assert_call): ...this.
      	(build_array_bounds_call): Call arrayboundsp variant of the array
      	bounds failure callback.
      	(build_bounds_condition): Rename to...
      	(build_bounds_index_condition): ...this.  Update signature.
      	(build_bounds_slice_condition): New function.
      	(checkaction_trap_p): New function.
      	(d_assert_call): Call assertp variant of assert failure callback.
      	* d-tree.h (class IndexExp): Declare.
      	(class SliceExp): Declare.
      	(build_bounds_condition): Remove.
      	(build_assert_call): Declare.
      	(build_bounds_index_condition): Declare.
      	(build_bounds_slice_condition): Declare.
      	(checkaction_trap_p): Declare.
      	(d_assert_call): Remove.
      	* expr.cc (ExprVisitor::visit(IndexExp *)): Call
      	build_bounds_index_condition.
      	(ExprVisitor::visit(SliceExp *)): Call build_bounds_slice_condition.
      	(ExprVisitor::visit(AssertExp *)): Update setting of libcall.
      	* runtime.cc (enum d_libcall_type): Add LCT_IMMUTABLE_CHARPTR.
      	(get_libcall_type): Handle LCT_IMMUTABLE_CHARPTR.
      	* runtime.def (ASSERT): Rename to...
      	(ASSERTP): ...this.  Update signature.
      	(UNITTEST): Rename to...
      	(UNITTESTP): ...this.  Update signature.
      	(ARRAY_BOUNDS): Rename to...
      	(ARRAYBOUNDSP): ...this.  Updates signature.
      	* toir.cc (IRVisitor::visit(SwitchErrorStatement *)): Update call.
      766f5f87
    • Iain Buclaw's avatar
      d: ICE in gimple_register_canonical_type_1, at lto/lto-common.c:430 (PR102094) · 07984707
      Iain Buclaw authored
      User defined types have the TYPE_CXX_ODR_P flag set, but closure frames
      did not.  This mismatch led to an ICE in the conflict detection for ODR
      and interoperable non-ODR types.  As a given closure frame is tied
      explicitly to a function, it already conforms to ODR.
      
      	PR d/102094
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (build_frame_type): Set TYPE_CXX_ODR_P.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/lto/pr102094_0.d: New test.
      07984707
  32. Jul 30, 2021
    • Iain Buclaw's avatar
      d: Factor d_nested_class and d_nested_struct into single function. · 55303957
      Iain Buclaw authored
      Both do the exact same operation, just on different AST nodes.
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (d_nested_class): Rename to ...
      	(get_outer_function): ... this.  Handle all aggregate declarations.
      	(d_nested_struct): Remove.
      	(find_this_tree): Use get_outer_function.
      	(get_framedecl): Likewise.
      55303957
  33. Jul 28, 2021
    • Iain Buclaw's avatar
      d: fix ICE at convert_expr(tree_node*, Type*, Type*) (PR101490) · c936c39f
      Iain Buclaw authored
      Both the front-end and code generator had a modulo by zero bug when testing if
      a conversion from a static array to dynamic array was valid.
      
      	PR d/101490
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd 27e388b4c.
      	* d-codegen.cc (build_array_index): Handle void arrays same as byte.
      	* d-convert.cc (convert_expr): Handle converting to zero-sized arrays.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/pr101490.d: New test.
      c936c39f
  34. Jul 02, 2021
    • Iain Buclaw's avatar
      d: RHS value lost when a target_expr modifies LHS in a cond_expr · c7723085
      Iain Buclaw authored
      To prevent the RHS of an assignment modifying the LHS before the
      assignment proper, a target_expr is forced so that function calls that
      return with slot optimization modify the temporary instead.  This did
      not work for conditional expressions however, to give one example.  So
      now the RHS is always forced to a temporary.
      
      	PR d/101282
      
      gcc/d/ChangeLog:
      
      	* d-codegen.cc (build_assign): Force target_expr on RHS for non-POD
      	assignment expressions.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/torture/pr101282.d: New test.
      c7723085
  35. Jun 04, 2021
    • Iain Buclaw's avatar
      d: Fix ICE in gimplify_var_or_parm_decl, at gimplify.c:2755 (PR100882) · df3fbd59
      Iain Buclaw authored
      Constructor calls for temporaries were reusing the TARGET_EXPR_SLOT of a
      TARGET_EXPR for an assignment, which later got passed to `build_assign',
      which stripped away the outer TARGET_EXPR, leaving a reference to a lone
      temporary with no declaration.
      
      This stripping away of the TARGET_EXPR also discarded any cleanups that
      may have been assigned to the expression as well.
      
      So now the reuse of TARGET_EXPR_SLOT has been removed, and
      `build_assign' now constructs assignments inside the TARGET_EXPR_INITIAL
      slot.  This has also been extended to `return_expr', to deal with
      possibility of a TARGET_EXPR being returned.
      
      gcc/d/ChangeLog:
      
      	PR d/100882
      	* d-codegen.cc (build_assign): Construct initializations inside
      	TARGET_EXPR_INITIAL.
      	(compound_expr): Remove intermediate expressions that have no
      	side-effects.
      	(return_expr): Construct returns inside TARGET_EXPR_INITIAL.
      	* expr.cc (ExprVisitor::visit (CallExp *)): Remove useless assignment
      	to TARGET_EXPR_SLOT.
      
      gcc/testsuite/ChangeLog:
      
      	PR d/100882
      	* gdc.dg/pr100882a.d: New test.
      	* gdc.dg/pr100882b.d: New test.
      	* gdc.dg/pr100882c.d: New test.
      	* gdc.dg/torture/pr100882.d: New test.
      df3fbd59
Loading