[Issue 21950] cod1: Assertion failure for noreturn parameter

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21950

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #13179 "Fix 21950: Rewrite function calls depending on
noreturn arguments " was merged into stable:

- 783821f852836d3acd4fd815b1ef8f2161f33010 by MoonlightSentinel:
  Fix 21950: Rewrite function calls depending on noreturn arguments

  Replaces the function call with the evaluation of the arguments up to
  the first `noreturn` parameter. The remaining arguments / the function
  call will never be executed anyways and the backend cannot handle
  noreturn parameters.

https://github.com/dlang/dmd/pull/13179

--


[Issue 22394] std.getopt cannot handle "-"

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22394

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/phobos pull request #8287 "Fix Issue 22394 - std.getopt cannot handle
"-"" was merged into master:

- 20d30241ebb5aaac037d8875e51a01830b56dc29 by Vladimir Panteleev:
  Fix Issue 22394 - std.getopt cannot handle "-"

https://github.com/dlang/phobos/pull/8287

--


[Issue 22397] Out of memory during compilation

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22397

--- Comment #5 from Vladimir Panteleev  ---
Maybe something like this to avoid saying that out-of-memory errors are
compiler bugs:

diff --git a/src/dmd/mars.d b/src/dmd/mars.d
index 54c8298ea9..344ad207e2 100644
--- a/src/dmd/mars.d
+++ b/src/dmd/mars.d
@@ -1064,10 +1064,18 @@ else
 dmd_coverSetMerge(true);
 }

-scope(failure) stderr.printInternalFailure;
-
-auto args = Runtime.cArgs();
-return tryMain(args.argc, cast(const(char)**)args.argv,
global.params);
+try
+{
+auto args = Runtime.cArgs();
+return tryMain(args.argc, cast(const(char)**)args.argv,
global.params);
+}
+catch (OutOfMemoryError e)
+throw e;
+catch (Throwable e)
+{
+stderr.printInternalFailure;
+throw e;
+}
 }
 } // !NoMain

--


[Issue 22397] Out of memory during compilation

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22397

--- Comment #4 from Vladimir Panteleev  ---
(In reply to Ray Kulhanek from comment #3)
> Ideally, the behavior would be to fail to compile while indicating the error
> in any way other than exhausting memory.

The compiler generally cannot predict that a program will exhaust all memory.
(Variation of halting problem)

--


[Issue 21956] ice on foreach over an AA of noreturn

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21956

moonlightsenti...@disroot.org changed:

   What|Removed |Added

   Hardware|x86_64  |All
 OS|Linux   |All

--


[Issue 22390] Compiler crash when iterating empty array of bottom types

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22390

moonlightsenti...@disroot.org changed:

   What|Removed |Added

   Keywords||backend
 CC||moonlightsentinel@disroot.o
   ||rg
   Hardware|x86_64  |All
 OS|Linux   |All

--- Comment #1 from moonlightsenti...@disroot.org ---
The first example is a duplicate of issue 21956.

The second one is new and manifests in an assertion failure:

dmd: src/dmd/backend/cod3.d:2400: Assertion `0' failed.

--


[Issue 21950] cod1: Assertion failure for noreturn parameter

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21950

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@MoonlightSentinel updated dlang/dmd pull request #13179 "e2ir: Rewrite
function calls depending on noreturn arguments " fixing this issue:

- Fix 21950: Rewrite function calls depending on noreturn arguments

  Replaces the function call with the evaluation of the arguments up to
  the first `noreturn` parameter. The remaining arguments / the function
  call will never be executed anyways and the backend cannot handle
  noreturn parameters.

https://github.com/dlang/dmd/pull/13179

--


[Issue 22397] Out of memory during compilation

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22397

--- Comment #3 from Ray Kulhanek  ---
Vladimir: I've no problem with it failing to compile. But the error message
called it a compiler bug, so I reported it.

Ideally, the behavior would be to fail to compile while indicating the error in
any way other than exhausting memory. I needed to hard reboot the first time I
ran it under Linux because I didn't manage to kill it before it started
thrashing the swap.

--


[Issue 22397] Out of memory during compilation

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22397

--- Comment #2 from Ray Kulhanek  ---
Be sure to set ulimit -v to something reasonable when running the test code.
It'll exhaust memory and freeze up in seconds if allowed to use unlimited swap.

--


[Issue 22397] Out of memory during compilation

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22397

Vladimir Panteleev  changed:

   What|Removed |Added

 CC||dlang-bugzilla@thecybershad
   ||ow.net

--- Comment #1 from Vladimir Panteleev  ---
What behavior do you expect?

"print" is instantiating itself recursively with a range type that is more
complicated every iteration, so this program cannot be compiled.

--


[Issue 22397] New: Out of memory during compilation

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22397

  Issue ID: 22397
   Summary: Out of memory during compilation
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: kulhane...@wright.edu

# Linux error message
---
ERROR: This is a compiler bug.
Please report it via https://issues.dlang.org/enter_bug.cgi
with, preferably, a reduced, reproducible example and the information below.
DustMite (https://github.com/CyberShadow/DustMite/wiki) can help with the
reduction.
---
DMD v2.090.0
predefs   DigitalMars Posix linux ELFv1 CRuntime_Glibc CppRuntime_Gcc
LittleEndian D_Version2 all D_SIMD D_InlineAsm_X86_64 X86_64 D_LP64 D_PIC
assert D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat
binarydmd
version   v2.090.0
config/etc/dmd.conf
DFLAGS-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import
-L-L/usr/lib/x86_64-linux-gnu -L--export-dynamic -fPIC
---
core.exception.OutOfMemoryError@src/core/exception.d(647): Memory allocation
failed
Segmentation fault

# Windows error message
The same error appears in the Windows build (on Windows 10).

predefs DigitalMars Windows CRuntime_DigitalMars CppRuntime_DigitalMars
LittleEndian D_Version2 all D_InlineAsm D_InlineAsm_X86 X86 Win32 assert
D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat
version v2.089.1-dirty


# Code
import std.file, std.stdio, std.algorithm, std.array, std.path;

void print(R)(R entries, uint depth) {
entries
.map!(a => a[depth..$])
.filter!(a => a.length > 1)
.map!(a => a[1..$])
.print(depth + 1);
}

void main() {
dirEntries(".", SpanMode.depth)
.map!(a => a.name.pathSplitter.array)
.print(0);
}

--


[Issue 22396] New: Assignments from function value parameters should pass by move when possible

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22396

  Issue ID: 22396
   Summary: Assignments from function value parameters should pass
by move when possible
   Product: D
   Version: D2
  Hardware: All
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: per.nord...@gmail.com

The number of cases where a variable (including function parameters passed by
value) is be passed by move should be extend to include at least assignments if
that assignment statement is the last reference of the variable.

This enables non-copyable (r-value) ranges to be passed to common range-based
Phobos algorithms. Such r-value ranges are typically created when a
non-copyable C++/Rust-style containers is passed by move _into_ a specific
range I propose to name `UniqueInputRange`. `UniqueInputRange`, itself
non-copyable, can then with this change be passed to Phobos' higher-order
algorithms, typically `map`, `filter`, `reduce` etc.

This idea has already be realized in Rust using
[IntoIterator](https://doc.rust-lang.org/std/iter/trait.IntoIterator.html).

Specifically, range algorithm constructor should be able to take a non-copyable
range as its source range parameter as in

```d
struct SomeRange
{
this(R range)
{
source = range; // TODO `range` should be passed by move to `source`
}
}
```

when `range` is not referenced after it being moved in the assignment. If the
compiler is modified to automatically allow such assignments to perform move
all the details described above can be implemented in phobos.

See also https://github.com/dlang/phobos/pull/4971.

--


[Issue 22395] OpenBSD: Add more OpenBSD-specific function prototypes in string.d and unistd.d

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22395

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ibara created dlang/druntime pull request #3590 "Fix Issue 22395 - OpenBSD:
Add more OpenBSD-specific function prototypes in string.d and unistd.d" fixing
this issue:

- Fix Issue 22395 - OpenBSD: Add more OpenBSD-specific function prototypes in
string.d and unistd.d

https://github.com/dlang/druntime/pull/3590

--


[Issue 22395] New: OpenBSD: Add more OpenBSD-specific function prototypes in string.d and unistd.d

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22395

  Issue ID: 22395
   Summary: OpenBSD: Add more OpenBSD-specific function prototypes
in string.d and unistd.d
   Product: D
   Version: D2
  Hardware: All
OS: Other
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: bcal...@openbsd.org

I'd like to add the following prototypes to the OpenBSD string.d:
void explicit_bzero(void*, size_t);
void* memrchr(scope const void*, int, size_t);
size_t strlcat(char*, scope const char*, size_t);
size_t strlcpy(char*, scope const char*, size_t);
void strmode(int, char*);
char* strsep(char**, scope const char*);

And the OpenBSD unistd.d:
int getentropy(void*, size_t);

--


[Issue 22394] std.getopt cannot handle "-"

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22394

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@CyberShadow created dlang/phobos pull request #8287 "Fix Issue 22394 -
std.getopt cannot handle "-"" fixing this issue:

- Fix Issue 22394 - std.getopt cannot handle "-"

https://github.com/dlang/phobos/pull/8287

--


[Issue 22394] New: std.getopt cannot handle "-"

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22394

  Issue ID: 22394
   Summary: std.getopt cannot handle "-"
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: dlang-bugzi...@thecybershadow.net

"-" is commonly used to refer to standard input. This convention is followed by
many tools, including GNU coreutils.

std.getopt currently always throws if it sees an "-" argument, unless
Config.passThrough mode is enabled.

--


[Issue 22393] OpenBSD: Add polyImpl implementation for x86

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22393

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ibara created dlang/phobos pull request #8285 "OpenBSD: Add polyImpl
implementation for x86" fixing this issue:

- OpenBSD: Add polyImpl implementation for x86
  Fix Issue 22393 - OpenBSD: Add polyImpl implementation for x86

https://github.com/dlang/phobos/pull/8285

--


[Issue 22393] New: OpenBSD: Add polyImpl implementation for x86

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22393

  Issue ID: 22393
   Summary: OpenBSD: Add polyImpl implementation for x86
   Product: D
   Version: D2
  Hardware: x86
OS: Other
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: bcal...@openbsd.org

The DMD build fails in Phobos on OpenBSD x86 because there is no x86
implementation of polyImpl on OpenBSD.

Already have a fix; this issue is for tracking.

--


[Issue 22376] importC: Error: cannot use non-constant CTFE pointer in an initializer

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22376

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #13178 "fix Issue 22376 - importC: Error: cannot use
non-constant CTFE pointe…" was merged into stable:

- b74f78263884c86e19772225e7cd3083a405567d by Walter Bright:
  fix Issue 22376 - importC: Error: cannot use non-constant CTFE pointer in an
initializer

https://github.com/dlang/dmd/pull/13178

--


[Issue 17488] Platform-inconsistent behavior from getTempDir()

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17488

--- Comment #6 from Dlang Bot  ---
@rjframe updated dlang/phobos pull request #5476 "Fix issue 17488: Add trailing
slash to POSIX tempDir() to match Windows behaviour" fixing this issue:

- Fix Issue 17488 - Add trailing slash to POSIX tempDir() to match Windows
behaviour

https://github.com/dlang/phobos/pull/5476

--


[Issue 17037] std.concurrency has random segfaults

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17037

--- Comment #9 from Dlang Bot  ---
@WalterWaldron updated dlang/phobos pull request #5004 "Fix issue 17037 -
std.concurrency has random segfaults" fixing this issue:

- Fix issue 17037 - std.concurrency has random segfaults

https://github.com/dlang/phobos/pull/5004

--


[Issue 22392] New: Simplify Visual C configuration for -m64/-m32mscoff builds

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22392

  Issue ID: 22392
   Summary: Simplify Visual C configuration for -m64/-m32mscoff
builds
   Product: D
   Version: D2
  Hardware: x86_64
OS: Windows
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: razvan.nitu1...@gmail.com

https://github.com/dlang/phobos/pull/2526

--


[Issue 22376] importC: Error: cannot use non-constant CTFE pointer in an initializer

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22376

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@WalterBright created dlang/dmd pull request #13178 "fix Issue 22376 - importC:
Error: cannot use non-constant CTFE pointe…" fixing this issue:

- fix Issue 22376 - importC: Error: cannot use non-constant CTFE pointer in an
initializer

https://github.com/dlang/dmd/pull/13178

--


[Issue 21794] Internal compiler assertion

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21794

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Dlang Bot  ---
dlang/dmd pull request #13172 "Fix Issue 21794 - ICE: Assertion hit in
dinterpret.d" was merged into stable:

- cdfccb118f51348930c6b48f022b044c9e9fc4e5 by Boris Carvajal:
  Fix Issue 21794 - ICE: Type painted NullExp hits assertion in dinterpret.d

https://github.com/dlang/dmd/pull/13172

--


[Issue 22389] noreturn functions are allowed to return normally

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22389

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #13173 "Fix 22389 - Check that noreturn functions don't
return normally" was merged into stable:

- 1613545d1978a489e471327de9433b0236017a55 by MoonlightSentinel:
  Fix 22389 - Check that noreturn functions don't return normally

  Such functions are malformed and hence could cause undefined behavior
  at the call site.

https://github.com/dlang/dmd/pull/13173

--


[Issue 22391] New: std.currency randomly seg faults in unittests

2021-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22391

  Issue ID: 22391
   Summary: std.currency randomly seg faults in unittests
   Product: D
   Version: D2
  Hardware: x86
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: bugzi...@digitalmars.com

make[1]: *** [unittest/std/concurrency.run] Segmentation fault (core dumped)
make[1]: *** Waiting for unfinished jobs

Ubuntu 18.04 x86, DMD (bootstrap)

--