www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Error: Instruction does not dominate all uses!

reply Renato <renato athaydes.com> writes:
I was writing some pretty basic stuff when suddenly my code 
stopped compiling with LDC on release mode.

I got the commit which introduced the problem: 
https://github.com/renatoathaydes/dzipper/commit/2f2cd6f2b00d36129a97446bec25e660baef3187

Basically, I started using the `std.datetime.systime` module.

With DMD, I can still compile with release mode:

```
▶ dub build -c exe -b release
     Starting Performing "release" build using 
/Users/renato/dlang/dmd-2.106.1/osx/bin/dmd for x86_64.
     Building console-colors 1.2.0: building configuration 
[library]
     Building dzipper ~main: building configuration [exe]
      Linking dzipper
(dmd-2.106.1)
```

But with LDC, I get this error:

```
▶ dub build -c exe -b release
     Starting Performing "release" build using 
/Users/renato/dlang/ldc-1.35.0/bin/ldc2 for x86_64.
   Up-to-date console-colors 1.2.0: target for configuration 
[library] is up to date.
     Building dzipper ~main: building configuration [exe]
Error: Instruction does not dominate all uses!
   %93 = getelementptr inbounds i8, i8* %4, i64 12
   %91 = bitcast i8* %93 to i32*
Instruction does not dominate all uses!
   %30 = getelementptr inbounds i8, i8* %4, i64 10
   %28 = bitcast i8* %30 to i32*

Error /Users/renato/dlang/ldc-1.35.0/bin/ldc2 failed with exit 
code 1.
(ldc-1.35.0)
```

Without `-b release`, it works.
Jan 09
parent reply Johan <j j.nl> writes:
On Tuesday, 9 January 2024 at 20:40:48 UTC, Renato wrote:
 I was writing some pretty basic stuff when suddenly my code 
 stopped compiling with LDC on release mode.

 I got the commit which introduced the problem: 
 https://github.com/renatoathaydes/dzipper/commit/2f2cd6f2b00d36129a97446bec25e660baef3187
Hello Renato, Please report the problem in our bugtracker here: https://github.com/ldc-developers/ldc/issues It would greatly help us if you can minimize the problem to a small test case that reproduces the issue. You can use `dustmite` for that, or try manually (might take a long time). Thanks! Johan
Jan 09
parent Renato <renato athaydes.com> writes:
On Tuesday, 9 January 2024 at 23:12:03 UTC, Johan wrote:
 On Tuesday, 9 January 2024 at 20:40:48 UTC, Renato wrote:
 I was writing some pretty basic stuff when suddenly my code 
 stopped compiling with LDC on release mode.

 I got the commit which introduced the problem: 
 https://github.com/renatoathaydes/dzipper/commit/2f2cd6f2b00d36129a97446bec25e660baef3187
Hello Renato, Please report the problem in our bugtracker here: https://github.com/ldc-developers/ldc/issues It would greatly help us if you can minimize the problem to a small test case that reproduces the issue. You can use `dustmite` for that, or try manually (might take a long time). Thanks! Johan
Done! And thanks for telling me about Dustmite :) I did try to find a minimum example manually but couldn't, but Dustmite managed it in around 5 minutes. Awesome tool.
Jan 10