Re: LDC Internal Compiler Error (ICE) mentioning attribute 'nocapture'

2024-03-31 Thread Basile B. via Digitalmars-d-learn

On Saturday, 30 March 2024 at 09:35:24 UTC, Per Nordlöw wrote:

Does anybody recognize the error

```
Attribute 'nocapture' does not apply to function return values
  %12 = call noalias nocapture align 8 ptr @_D3xxx(ptr nonnull 
%10, { i64, ptr } %11) #2, !dbg !7978

Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz1
Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz2
Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz3
Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz4
Attribute 'nocapture' does not apply to function return values
  %164 = call noalias nocapture align 8 ptr @_D3xyz5(ptr 
nonnull %rS72) #0, !dbg !9872

Attribute 'nocapture' does not apply to function return values
  %285 = call noalias nocapture align 8 ptr @_D3xyz6(ptr 
nonnull %284) #0, !dbg !9949

LLVM ERROR: Broken module found, compilation aborted!
#0 0x5ee4d001e927 
llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) 
(~/.local/ldc2-1.37.0-beta1-linux-x86_64/bin/ldc2+0x6ad4927)

Error ldc2 failed with exit code -6.
```

? It's outputted when building and running a test application 
with ldc with the compiler flag `-fsanitize=address`.


You can try to add the flag `--disable-verify` (see 
https://github.com/ldc-developers/ldc/issues/4284, that prevents 
an internal verification).


The error message indicates that a "parameter-only" attribute is 
used as a "call-site" one. Not sure if this is a bug in LDC or in 
LLVM but if you're lucky the attribute will be a no-op and the 
generated binary will just work.


LDC Internal Compiler Error (ICE) mentioning attribute 'nocapture'

2024-03-30 Thread Per Nordlöw via Digitalmars-d-learn

Does anybody recognize the error

```
Attribute 'nocapture' does not apply to function return values
  %12 = call noalias nocapture align 8 ptr @_D3xxx(ptr nonnull 
%10, { i64, ptr } %11) #2, !dbg !7978

Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz1
Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz2
Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz3
Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz4
Attribute 'nocapture' does not apply to function return values
  %164 = call noalias nocapture align 8 ptr @_D3xyz5(ptr nonnull 
%rS72) #0, !dbg !9872

Attribute 'nocapture' does not apply to function return values
  %285 = call noalias nocapture align 8 ptr @_D3xyz6(ptr nonnull 
%284) #0, !dbg !9949

LLVM ERROR: Broken module found, compilation aborted!
#0 0x5ee4d001e927 
llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) 
(~/.local/ldc2-1.37.0-beta1-linux-x86_64/bin/ldc2+0x6ad4927)

Error ldc2 failed with exit code -6.
```

? It's outputted when building and running a test application 
with ldc with the compiler flag `-fsanitize=address`.