[all-commits] [llvm/llvm-project] 74e019: [AIX][AsmPrinter] Fix unsigned subtraction wrap-ar...

Hubert Tong via All-commits all-commits at lists.llvm.org
Wed Jan 8 19:52:19 PST 2025


  Branch: refs/heads/users/hubert-reinterpretcast/AsmPrinter-FixAIXUnsignedWraparoundWithZeroElementStructType
  Home:   https://github.com/llvm/llvm-project
  Commit: 74e019a85e973456b70f787a4c3f866ad398b4b9
      https://github.com/llvm/llvm-project/commit/74e019a85e973456b70f787a4c3f866ad398b4b9
  Author: Hubert Tong <hubert.reinterpretcast at gmail.com>
  Date:   2025-01-08 (Wed, 08 Jan 2025)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    A llvm/test/CodeGen/PowerPC/global-merge-aix-zero-size-struct.ll

  Log Message:
  -----------
  [AIX][AsmPrinter] Fix unsigned subtraction wrap-around

Unsigned subtraction wrap-around occurs in `emitGlobalConstantImpl` on
an AIX-specific code path from 8e4423eb0888 when a structure type has
zero elements.

With assertions enabled, this manifests as:
```
TypeSize llvm::StructLayout::getElementOffset(unsigned int) const: Assertion `Idx < NumElements && "Invalid element idx!"' failed.
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list