[llvm-bugs] [Bug 138463] is choco install llvm a malware ?

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138463




Summary

is choco install llvm a malware ?




  Labels
  
new issue
  



  Assignees
  
  



  Reporter
  
  gogo2464
  




I am confused with the documentation at: https://llvm.org/docs/GettingStartedVS.html#alternatives-to-manual-installation .

Could we explicitely set that choco install llvm is not a malware (if it is not) please? Could we also put opensource https://community.chocolatey.org/packages/llvm repo to llvm organisation package please?


___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138471] [flang] bug passing non-contiguous array to MPI procedure

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138471




Summary

[flang] bug passing non-contiguous array to MPI procedure




  Labels
  
flang
  



  Assignees
  
  



  Reporter
  
  nncarlson
  




I've run into errors with flang 20.1.0 when passing a non-contiguous dummy array to MPI procedures (MPICH 4.3.0), where it needs to be doing copy-in/copy-out. It appears that the address of the initial array element is being passed instead of the address of a _contiguous copy_ of the array. I'm not sure if this is a bug with flang, or a problem with MPICH where it doesn't know how to provide a correct `mpi` module for flang.

I've pared it down to a small (serial) reproducer that doesn't use MPI at all, but mimics the `mpi` module from MPICH 4.3.0. There are two files `mpi_bcast.c`:
```C
// Dummy version of MPI_Bcast to dump the received buffer
#include 
void mpi_bcast_(void *buffer, int *count) {
  float *vector = (float*) buffer;
 printf(" in mpi_bcast: buffer=");
  for (int i = 0; i < *count; ++i) {
printf(" %f", vector[i]);
  }
  printf("\n");
}
```
and the main program  `flang-20240504.F90`:

```fortran
module mpi_dummy

  !! Actual form of the interface from the MPICH 4.3.0 mpi module
  interface MPI_Bcast
subroutine MPI_Bcast(buffer, count)!, datatype, root, comm, ierror)
  implicit none
#ifdef __flang__
  !DIR$ IGNORE_TKR buffer
#endif
#ifdef __INTEL_COMPILER
  !DEC$ ATTRIBUTES NO_ARG_CHECK :: buffer
#endif
#ifdef __GFORTRAN__
  !GCC$ ATTRIBUTES NO_ARG_CHECK :: buffer
#endif
  real :: buffer
  integer :: count
 !integer :: datatype
  !integer :: root
  !integer :: comm
 !integer :: ierror
end subroutine
  end interface

end module

program main

  use mpi_dummy

  real :: x(5)
  x = [1,2,3,4,5]
  print *, 'x=', x
  call bcast(x(1::2))

contains

 subroutine bcast(buffer)
real, intent(inout) :: buffer(:)
print *, '  in bcast: buffer=', buffer
! A CONTIGUOUS COPY OF BUFFER MUST BE PASSED HERE
call MPI_Bcast(buffer, size(buffer))
  end subroutine

end program
```
To compile:
```sh
clang -c mpi_bcast.c
flang flang-20240504.F90 mpi_bcast.o
```
The expected output from running should be
```
$ ./a.out
 x= 1. 2. 3. 4. 5.
   in bcast: buffer= 1. 3. 5.
 in mpi_bcast: buffer= 1.00 3.00 5.00
```
But with flang I'm getting
```
$ ./a.out
 x= 1. 2. 3. 4. 5.
   in bcast: buffer= 1. 3. 5.
 in mpi_bcast: buffer= 1.00 2.00 3.00
```
Both Intel ifx and gfortran produce the expected results.


___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138473] Bytecode interpreter: Implement support for `EvaluateWithSubstitution`

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138473




Summary

Bytecode interpreter: Implement support for `EvaluateWithSubstitution`




  Labels
  
clang:frontend,
clang:bytecode
  



  Assignees
  
  



  Reporter
  
  tbaederr
  




This is only used for the `enable_if` attribute AFAICS.


___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138474] Bytecode Interpreter: Use in `Expr::tryEvaluateObjectSize`

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138474




Summary

Bytecode Interpreter: Use in `Expr::tryEvaluateObjectSize`




  Labels
  
clang:frontend,
clang:bytecode
  



  Assignees
  
  



  Reporter
  
  tbaederr
  




This currently just calls `tryEvaluateBuiltinObjectSize()`, which does not take the bytecode interpreter into account.


___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138475] Bytecode Interpreter: Use in `Expr::tryEvaluateStrLen`

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138475




Summary

Bytecode Interpreter: Use in `Expr::tryEvaluateStrLen`




  Labels
  
clang:frontend,
clang:bytecode
  



  Assignees
  
  



  Reporter
  
  tbaederr
  




We need an equivalent of `EvaluateBuiltinStrLen`, and use that in `Expr::tryEvaluateStrLen` as well as `Expr::tryEvaluateString`.


___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138465] Optimization pass to improve performance of interpreters, and other recursive programs

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138465




Summary

Optimization pass to improve performance of interpreters, and other recursive programs




  Labels
  
new issue
  



  Assignees
  
  



  Reporter
  
  the-ssd
  




Currently, LLVM generates an additional jump for interpreters, which could be inclined for better performance. (which is how interpreters written in Assembly like LuaJIT's interpreter work).

Example:
```llvm
define i32 @example() {
dispatch:
   ; dispatch logic
   br {instruction}
instruction1:
   ; instruction logic
 br label %dispatch
instruction2:
   ; instruction logic
  br label %dispatch
}
```
But a faster version inlines logic from dispatch into instructions, and usually runs faster.
```llvm
define i32 @example() {
 ; dispatch logic
   br {instruction}
instruction1:
   ; instruction logic
   ; dispatch logic
   br {instruction}
instruction2:
   ; instruction logic
   ; dispatch logic
   br {instruction}
}
```
But this is also a small optimization for a small amount of programs, and maybe better suited for a plugin.


___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138484] misformatting around objc attribute keywords

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138484




Summary

misformatting around objc attribute keywords




  Labels
  
clang-format,
regression,
objective-c,
objective-c++
  



  Assignees
  
  



  Reporter
  
  kadircet
  




expected formatting:
```objc
NSError *__autoreleasing *foo;
```

actual formatting:
```objc
NSError * __autoreleasing * foo;
```


___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138485] misformatting in complex logical expressions

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138485




Summary

misformatting in complex logical expressions




  Labels
  
new issue
  



  Assignees
  
  



  Reporter
  
  kadircet
  




actual formatting:
```cpp
bool foo = a e;
```

expected formatting:
```cpp
bool foo = a < b && (c * d) > e;
```



___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138486] clang-tidy: modernize-use-override does not work is a parameter has `__attribute__`

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138486




Summary

clang-tidy: modernize-use-override does not work is a parameter has `__attribute__`




  Labels
  
clang-tidy
  



  Assignees
  
  



  Reporter
  
  e-kwsm
  




Prepare `/tmp/a.cpp`:

```cpp
struct B {
  virtual ~B() = default;
  virtual void f([[maybe_unused]] int x) {}
  virtual void g(int x __attribute__((unused))) {}
};

struct D : B {
  ~D() = default;
 virtual void f([[maybe_unused]] int x) {}
  virtual void g(int x __attribute__((unused))) {}
};
```

and `/tmp/compile_commands.json`:

```json
[{
  "directory": "/tmp",
 "command": "clang++ -std=c++11 -Werror=unused-parameter -Wsuggest-override -Wsuggest-destructor-override -c -o a.o a.cpp",
  "file": "a.cpp",
 "output": "a.o"
}]
```

```console
$ clang-tidy --checks=modernize-use-override --fix a.cpp
6 warnings generated.
a.cpp:8:3: warning: '~D' overrides a destructor but is not marked 'override' [clang-diagnostic-suggest-destructor-override]
8 |   ~D() = default;
  |   ^
a.cpp:2:11: note: overridden virtual function is here
2 |   virtual ~B() = default;
  |   ^
a.cpp:8:3: warning: annotate this function with 'override' or (rarely) 'final' [modernize-use-override]
8 |   ~D() = default;
  |   ^
  | override
a.cpp:8:8: note: FIX-IT applied suggested code changes
8 | ~D() = default;
  |^
a.cpp:9:16: warning: 'f' overrides a member function but is not marked 'override' [clang-diagnostic-suggest-override]
9 |   virtual void f([[maybe_unused]] int x) {}
  |^
a.cpp:3:16: note: overridden virtual function is here
3 |   virtual void f([[maybe_unused]] int x) {}
  |^
a.cpp:9:16: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
9 |   virtual void f([[maybe_unused]] int x) {}
  |   ~~~  ^
  | override
a.cpp:9:3: note: FIX-IT applied suggested code changes
9 | virtual void f([[maybe_unused]] int x) {}
  |   ^
a.cpp:9:41: note: FIX-IT applied suggested code changes
9 |   virtual void f([[maybe_unused]] int x) {}
  | ^
a.cpp:10:16: warning: 'g' overrides a member function but is not marked 'override' [clang-diagnostic-suggest-override]
   10 |   virtual void g(int x __attribute__((unused))) {}
  |^
a.cpp:4:16: note: overridden virtual function is here
4 |   virtual void g(int x __attribute__((unused))) {}
  |^
a.cpp:10:16: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
   10 |   virtual void g(int x __attribute__((unused))) {}
  |   ~~~  ^
  | override
a.cpp:10:3: note: FIX-IT applied suggested code changes
 10 |   virtual void g(int x __attribute__((unused))) {}
  | ^
a.cpp:10:24: note: FIX-IT applied suggested code changes
   10 | virtual void g(int x __attribute__((unused))) {}
  | ^
clang-tidy applied 5 of 5 suggested fixes.
```

gives

```cpp
struct D : B {
  ~D() override = default;
 void f([[maybe_unused]] int x) override {}
  void g(int x override __attribute__((unused))) {}
};
```

Here, the `override` specifier for `g` is wrong, which must be

```cpp
  void g(int x __attribute__((unused))) override {}
```




___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138444] Crash in Clang when using sizeof(int[vec.size()]) with invalid std::vector initialization since version 19.0

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138444




Summary

Crash in Clang when using sizeof(int[vec.size()]) with invalid std::vector initialization since version 19.0




  Labels
  
clang
  



  Assignees
  
  



  Reporter
  
  mariete1223
  




## Summary 
Clang crashes with an internal compiler error when evaluating sizeof(int[vec.size()]) where vec is incorrectly initialized from an int. 

## Assertion
No assertion appears

## Stack dump

```
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -x c++ 
1.	:7:1: current parser token '}'
2.	:4:12: parsing function body 'main'
3.	:4:12: in compound statement ('{}')
 #0 0x03f710c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f710c8)
 #1 0x03f6ed54 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f6ed54)
 #2 0x03eb3d38 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x72de4b242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x076cb014 clang::computeDependence(clang::UnaryExprOrTypeTraitExpr*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x76cb014)
 #5 0x06b3bcf9 clang::Sema::CreateUnaryExprOrTypeTraitExpr(clang::TypeSourceInfo*, clang::SourceLocation, clang::UnaryExprOrTypeTrait, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6b3bcf9)
 #6 0x06b6ec5e clang::Sema::ActOnUnaryExprOrTypeTraitExpr(clang::SourceLocation, clang::UnaryExprOrTypeTrait, bool, void*, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6b6ec5e)
 #7 0x0666eefd clang::Parser::ParseUnaryExprOrTypeTraitExpression() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x666eefd)
 #8 0x0666240a clang::Parser::ParseCastExpression(clang::CastParseKind, bool, bool&, clang::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x666240a)
 #9 0x066642d7 clang::Parser::ParseCastExpression(clang::CastParseKind, bool, clang::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66642d7)
#10 0x06664369 clang::Parser::ParseAssignmentExpression(clang::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6664369)
#11 0x06668d49 clang::Parser::ParseExpression(clang::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6668d49)
#12 0x066ecc39 clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66ecc39)
#13 0x066e46f2 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66e46f2)
#14 0x066e561d clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66e561d)
#15 0x066ed333 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66ed333)
#16 0x066edafa clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66edafa)
#17 0x065f6003 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65f6003)
#18 0x0662c6ad clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x662c6ad)
#19 0x065e9b3e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65e9b3e)
#20 0x065ea2f9 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65ea2f9)
#21 0x065f1c1a clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-

[llvm-bugs] [Bug 138446] Compilation 20.1.4 - test fail during check

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138446




Summary

Compilation 20.1.4 - test fail during check




  Labels
  
new issue
  



  Assignees
  
  



  Reporter
  
  inglor
  




Test fails when check-clang for 20.1.4
```
RUN: at line 129: /build/clang/src/clang-20.1.4.src/build/bin/clang -### --target=aarch64-linux-gnu -resource-dir=/build/clang/src/clang-20.1.4.src/test/Driver/../../../clang/test/Driver/Inputs/resource_dir_with_arch_subdir -frtlib-add-rpath -fveclib=ArmPL /build/clang/src/clang-20.1.4.src/test/Driver/fveclib.c 2>&1 | /usr/bin/FileCheck --check-prefix=CHECK-RPATH-ARMPL /build/clang/src/clang-20.1.4.src/test/Driver/fveclib.c
+ /build/clang/src/clang-20.1.4.src/build/bin/clang -### --target=aarch64-linux-gnu -resource-dir=/build/clang/src/clang-20.1.4.src/test/Driver/../../../clang/test/Driver/Inputs/resource_dir_with_arch_subdir -frtlib-add-rpath -fveclib=ArmPL /build/clang/src/clang-20.1.4.src/test/Driver/fveclib.c
+ /usr/bin/FileCheck --check-prefix=CHECK-RPATH-ARMPL /build/clang/src/clang-20.1.4.src/test/Driver/fveclib.c
/build/clang/src/clang-20.1.4.src/test/Driver/fveclib.c:131:28: error: CHECK-RPATH-ARMPL-SAME: expected string not found in input
// CHECK-RPATH-ARMPL-SAME: "-rpath"
 ^
:6:386: note: scanning from here
 "/usr/bin/ld" "-EL" "--hash-style=gnu" "--build-id" "--eh-frame-hdr" "-m" "aarch64linux" "-pie" "-dynamic-linker" "/lib/ld-linux-aarch64.so.1" "-o" "a.out" "/lib/../lib64/Scrt1.o" "/lib/../lib64/crti.o" "crtbeginS.o" "-L/lib/../lib64" "-L/usr/lib/../lib64" "-L/lib" "-L/usr/lib" "/tmp/lit-tmp-u72gl9oh/fveclib-f983fd.o" "--push-state" "--as-needed" "-lm" "-lamath" "-lm" "--pop-state" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "crtendS.o" "/lib/../lib64/crtn.o"
 ^
:6:387: note: possible intended match here
 "/usr/bin/ld" "-EL" "--hash-style=gnu" "--build-id" "--eh-frame-hdr" "-m" "aarch64linux" "-pie" "-dynamic-linker" "/lib/ld-linux-aarch64.so.1" "-o" "a.out" "/lib/../lib64/Scrt1.o" "/lib/../lib64/crti.o" "crtbeginS.o" "-L/lib/../lib64" "-L/usr/lib/../lib64" "-L/lib" "-L/usr/lib" "/tmp/lit-tmp-u72gl9oh/fveclib-f983fd.o" "--push-state" "--as-needed" "-lm" "-lamath" "-lm" "--pop-state" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "crtendS.o" "/lib/../lib64/crtn.o"
 ^

Input file: 
Check file: /build/clang/src/clang-20.1.4.src/test/Driver/fveclib.c

-dump-input=help explains the following input dump.

Input was:
<<
1: clang version 20.1.4 
2: Target: aarch64-unknown-linux-gnu 
 3: Thread model: posix 
4: InstalledDir: /build/clang/src/clang-20.1.4.src/build/bin 
5: "/build/clang/src/clang-20.1.4.src/build/bin/clang-20" "-cc1" "-triple" "aarch64-unknown-linux-gnu" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "fveclib.c" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-fveclib=ArmPL" "-mframe-pointer=non-leaf" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "generic" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-abi" "aapcs" "-debugger-tuning=gdb" "-fdebug-compilation-dir=/build/clang/src/clang-20.1.4.src/build/test/Driver" "-fcoverage-compilation-dir=/build/clang/src/clang-20.1.4.src/build/test/Driver" "-resource-dir" "/build/clang/src/clang-20.1.4.src/test/Driver/../../../clang/test/Driver/Inputs/resource_dir_with_arch_subdir" "-internal-isystem" "/build/clang/src/clang-20.1.4.src/test/Driver/../../../clang/test/Driver/Inputs/resource_dir_with_arch_subdir/include" "-internal-isystem" "/usr/local/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-source-date-epoch" "1746268031" "-ferror-limit" "19" "-stack-protector" "2" "-fno-signed-char" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-target-feature" "-fmv" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/lit-tmp-u72gl9oh/fveclib-f983fd.o" "-x" "c" "/build/clang/src/clang-20.1.4.src/test/Driver/fveclib.c" 
6: "/usr/bin/ld" "-EL" "--hash-style=gnu" "--build-id" "--eh-frame-hdr" "-m" "aarch64linux" "-pie" "-dynamic-linker" "/lib/ld-linux-aarch64.so.1" "-o" "a.out" "/lib/../lib64/Scrt1.o" "/lib/../lib64/crti.o" "crtbeginS.o" "-L/lib/../lib64" "-L/usr/lib/../lib64" "-L/lib" "-L/usr/lib" "/tmp/lit-tmp-u72gl9oh/fveclib-f983fd.o" "--push-state" "--as-needed" "-lm" "-lamath" "-lm" "--pop-state" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "crtendS.o" "/lib/../lib64/crtn.o" 
same:131'0 X

[llvm-bugs] [Bug 138445] [OpenMP] clang++: /root/llvm-project/llvm/include/llvm/ADT/APSInt.h:99: int64_t llvm::APSInt::getExtValue() const: Assertion `isRepresentableByInt64() && "Too many bits for in

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138445




Summary

[OpenMP] clang++: /root/llvm-project/llvm/include/llvm/ADT/APSInt.h:99: int64_t llvm::APSInt::getExtValue() const: Assertion `isRepresentableByInt64() && "Too many bits for int64_t"' failed.




  Labels
  
clang
  



  Assignees
  
  



  Reporter
  
  k-arrows
  




Reproducible on Godbolt:
https://godbolt.org/z/477nWWrb4
```cpp
void f(void) {
#pragma omp simd collapse(0x)
  for (int i = 0; i < 10; i++)
 ;
}
```


___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 138449] enum and enum class give different values with bit field

2025-05-04 Thread LLVM Bugs via llvm-bugs


Issue

138449




Summary

enum and enum class give different values with bit field




  Labels
  
new issue
  



  Assignees
  
  



  Reporter
  
  LevoDeLellis
  




With the commented out enum clang/gcc give the same results which is the one I want
With the code below (using enum class) gcc gives me the expected results but clang gives me -2 

```
#include 

//enum E { A, B, C, D }; // <-- this gets C
enum class E { A, B, C, D }; // <-- this gets -2
struct S { E v : 2; long long i : 30; };

int main() {
	S s{E::C, -1};
	switch (s.v) {
		case E::C: printf("Got C\n"); return 0;
		default: printf("Got %d\n", s.v); return 0;
	}
}

```


___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs