aix: add required changes to build with clang [v8/v8 : main]

0 views
Skip to first unread message

Toon Verwaest (Gerrit)

unread,
Nov 4, 2025, 10:14:50 AMNov 4
to Abdirahim, Milad Farazmand, Mark Seaborn, Matthias Liedtke, Michael Achenbach, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Abdirahim, Mark Seaborn, Matthias Liedtke, Michael Achenbach and Milad Farazmand

Toon Verwaest added 4 comments

File src/builtins/ppc/builtins-ppc.cc
Line 4161, Patchset 1 (Latest): __ bind(&no_stack_change);
Toon Verwaest . unresolved

This label could move into the branch above?

File src/compiler/turboshaft/operations.h
Line 529, Patchset 1 (Latest):struct __attribute__((packed)) EffectDimensions {
Toon Verwaest . unresolved

Why is this necessary?

File src/execution/simulator.h
Line 203, Patchset 1 (Latest): void* function_desc[3];
Toon Verwaest . unresolved

Is there no way to achieve this without handwritten assembly?

File src/trap-handler/handler-shared.cc
Line 28, Patchset 1 (Latest):__thread bool TrapHandlerGuard::is_active_ = 0;
Toon Verwaest . unresolved

Why is this needed?

Open in Gerrit

Related details

Attention is currently required from:
  • Abdirahim
  • Mark Seaborn
  • Matthias Liedtke
  • Michael Achenbach
  • Milad Farazmand
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
Gerrit-Change-Number: 7107287
Gerrit-PatchSet: 1
Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Reviewer: Michael Achenbach <mache...@chromium.org>
Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-CC: Clemens Backes <clem...@chromium.org>
Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
Gerrit-Attention: Michael Achenbach <mache...@chromium.org>
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
Gerrit-Comment-Date: Tue, 04 Nov 2025 15:14:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Korinne Adler (Gerrit)

unread,
Nov 4, 2025, 12:44:24 PMNov 4
to Abdirahim, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Michael Achenbach, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Abdirahim, Mark Seaborn, Matthias Liedtke, Michael Achenbach and Milad Farazmand

Korinne Adler added 2 comments

File src/compiler/turboshaft/operations.h
Line 529, Patchset 1 (Latest):struct __attribute__((packed)) EffectDimensions {
Toon Verwaest . unresolved

Why is this necessary?

Korinne Adler

On AIX, Clang (like XLC) promotes bit fields to unsigned int unless packed. This breaks the assertions that the size of these structs are 1 byte large.

File src/execution/simulator.h
Line 203, Patchset 1 (Latest): void* function_desc[3];
Toon Verwaest . unresolved

Is there no way to achieve this without handwritten assembly?

Korinne Adler

We tried multiple ways to do this without, but Clang kept optimizing the descriptor setup away since casting to it is UB. Doing it directly in assembly assures that we get the behavior we need without the optimizer getting in our way.

Gerrit-Comment-Date: Tue, 04 Nov 2025 17:44:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
unsatisfied_requirement
open
diffy

Toon Verwaest (Gerrit)

unread,
Nov 6, 2025, 5:04:31 AMNov 6
to Abdirahim, Milad Farazmand, Mark Seaborn, Matthias Liedtke, Michael Achenbach, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Abdirahim, Korinne Adler, Mark Seaborn, Matthias Liedtke, Michael Achenbach and Milad Farazmand

Toon Verwaest added 2 comments

File src/compiler/turboshaft/operations.h
Line 529, Patchset 1 (Latest):struct __attribute__((packed)) EffectDimensions {
Toon Verwaest . resolved

Why is this necessary?

Korinne Adler

On AIX, Clang (like XLC) promotes bit fields to unsigned int unless packed. This breaks the assertions that the size of these structs are 1 byte large.

Toon Verwaest

I suppose we could use bitfields or maybe compile v8 with `-fpack-struct` but I guess this is less invasive and more likely to just work.

File src/execution/simulator.h
Line 203, Patchset 1 (Latest): void* function_desc[3];
Toon Verwaest . resolved

Is there no way to achieve this without handwritten assembly?

Korinne Adler

We tried multiple ways to do this without, but Clang kept optimizing the descriptor setup away since casting to it is UB. Doing it directly in assembly assures that we get the behavior we need without the optimizer getting in our way.

Toon Verwaest

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Abdirahim
  • Korinne Adler
Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
Gerrit-Attention: Michael Achenbach <mache...@chromium.org>
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
Gerrit-Comment-Date: Thu, 06 Nov 2025 10:04:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
Comment-In-Reply-To: Korinne Adler <kad...@us.ibm.com>
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Nov 17, 2025, 7:56:41 PMNov 17
to Michael Achenbach, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Korinne Adler, Mark Seaborn, Matthias Liedtke, Milad Farazmand and Toon Verwaest

Abdirahim added 1 comment

File src/trap-handler/handler-shared.cc
Line 28, Patchset 1 (Latest):__thread bool TrapHandlerGuard::is_active_ = 0;
Toon Verwaest . unresolved

Why is this needed?

Abdirahim

This is needed because clang complains that is_active is not initialized. on AIX is_active is a __thread.

Open in Gerrit

Related details

Attention is currently required from:
  • Korinne Adler
  • Mark Seaborn
  • Matthias Liedtke
  • Milad Farazmand
  • Toon Verwaest
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
Gerrit-Change-Number: 7107287
Gerrit-PatchSet: 1
Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-CC: Clemens Backes <clem...@chromium.org>
Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Michael Achenbach <mache...@chromium.org>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Comment-Date: Tue, 18 Nov 2025 00:56:38 +0000
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Nov 17, 2025, 7:59:07 PMNov 17
to Michael Achenbach, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Korinne Adler, Mark Seaborn, Matthias Liedtke, Milad Farazmand and Toon Verwaest

Abdirahim added 1 comment

File src/builtins/ppc/builtins-ppc.cc
Line 4161, Patchset 1 (Latest): __ bind(&no_stack_change);
Toon Verwaest . unresolved

This label could move into the branch above?

Abdirahim

I think we might be able to. @mfar...@ibm.com do you think this would be ok?

Gerrit-Comment-Date: Tue, 18 Nov 2025 00:59:05 +0000
unsatisfied_requirement
open
diffy

Milad Farazmand (Gerrit)

unread,
Nov 18, 2025, 8:27:27 AMNov 18
to Abdirahim, Michael Achenbach, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Abdirahim, Korinne Adler, Mark Seaborn, Matthias Liedtke and Toon Verwaest

Milad Farazmand added 1 comment

File src/builtins/ppc/builtins-ppc.cc
Line 4161, Patchset 1 (Latest): __ bind(&no_stack_change);
Toon Verwaest . unresolved

This label could move into the branch above?

Abdirahim

I think we might be able to. @mfar...@ibm.com do you think this would be ok?

Milad Farazmand

Yes this should be fine.

Open in Gerrit

Related details

Attention is currently required from:
  • Abdirahim
  • Korinne Adler
  • Mark Seaborn
  • Matthias Liedtke
  • Toon Verwaest
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
Gerrit-Comment-Date: Tue, 18 Nov 2025 13:27:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
Comment-In-Reply-To: Abdirahim <abdirah...@ibm.com>
unsatisfied_requirement
open
diffy

Toon Verwaest (Gerrit)

unread,
Nov 18, 2025, 10:57:13 AMNov 18
to Abdirahim, Michael Achenbach, Milad Farazmand, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Abdirahim, Korinne Adler, Mark Seaborn and Matthias Liedtke

Toon Verwaest added 2 comments

File src/execution/simulator.h
Line 206, Patchset 1 (Latest): "li 0, 0\n\t"
Toon Verwaest . unresolved

I don't 100% understand what this code does; but gemini told me that this clobbers r0 which isn't on the clobber list?

File src/trap-handler/handler-shared.cc
Line 28, Patchset 1 (Latest):__thread bool TrapHandlerGuard::is_active_ = 0;
Toon Verwaest . unresolved

Why is this needed?

Abdirahim

This is needed because clang complains that is_active is not initialized. on AIX is_active is a __thread.

Toon Verwaest

Mmh ok weird. Sounds like this might be a linker issue; while `thread_local` should actually be supported by clang?

Open in Gerrit

Related details

Attention is currently required from:
  • Abdirahim
  • Korinne Adler
  • Mark Seaborn
  • Matthias Liedtke
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
Gerrit-Change-Number: 7107287
Gerrit-PatchSet: 1
Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-CC: Clemens Backes <clem...@chromium.org>
Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Michael Achenbach <mache...@chromium.org>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
Gerrit-Comment-Date: Tue, 18 Nov 2025 15:57:08 +0000
unsatisfied_requirement
open
diffy

Korinne Adler (Gerrit)

unread,
Nov 18, 2025, 11:47:55 AMNov 18
to Abdirahim, Michael Achenbach, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Abdirahim, Mark Seaborn and Matthias Liedtke

Korinne Adler added 3 comments

File src/execution/simulator.h
Toon Verwaest . unresolved

I don't 100% understand what this code does; but gemini told me that this clobbers r0 which isn't on the clobber list?

Korinne Adler

It does indeed clobber r0, which is why it _is_ in the clobber list (along with memory).

The code is equivalent to the C++ code it replaces, initializing `function_desc` and assigning the address of the descriptor to the `Signature* fn`.

Line by line explanation:
```
std %1, 0(%2) // function_desc[0] = fn_ptr_
li 0, 0 // set r0 = 0 for use in the next two instructions
std 0, 8(%2) // function_desc[1] = 0
std 0, 16(%2) // function_desc[2] = 0
mr %0, %2 // fn = function_desc
```

File src/trap-handler/handler-shared.cc
Line 28, Patchset 1 (Latest):__thread bool TrapHandlerGuard::is_active_ = 0;
Toon Verwaest . unresolved

Why is this needed?

Abdirahim

This is needed because clang complains that is_active is not initialized. on AIX is_active is a __thread.

Toon Verwaest

Mmh ok weird. Sounds like this might be a linker issue; while `thread_local` should actually be supported by clang?

Korinne Adler

In trap-handler-internal.h, `is_active_` is declared as a `__thread` on AIX and links to a GCC bug report to explain why. However, the definition of the variable here still used `thread_local`, which while apparently acceptable on GCC gave a compile error on Clang.

We reached out to the AIX Clang devs to see the recommended way to fix this along with some other TLS-related questions. Hubert Tong (who commented in the GCC bug mentioned previously) told us that using `thread_local` here should be fine, but that it incurs extra overhead over using `__thread`. Since we still need to support GCC for now, it's easier to leave it consistent for AIX between GCC and Clang. Once we drop GCC we should be able to remove the ifdefs.

Line 28, Patchset 1 (Latest):__thread bool TrapHandlerGuard::is_active_ = 0;
Toon Verwaest . unresolved

Why is this needed?

Abdirahim

This is needed because clang complains that is_active is not initialized. on AIX is_active is a __thread.

Toon Verwaest

Mmh ok weird. Sounds like this might be a linker issue; while `thread_local` should actually be supported by clang?

Korinne Adler

In trap-handler-internal.h, is_active_ is defined as a __thread on AIX and links to a GCC bug report to explain why. However, the definition of the variable here still uses thread_local, which while apparently acceptable on GCC gave a compile error on Clang.

We reached out to the AIX Clang devs to see the recommended way to fix this along with some other TLS-related questions. Hubert Tong (who commented in the GCC bug mentioned previously) told us that using thread_local here should be fine, but that it incurs extra overhead over using __thread. Since we still need to support GCC for now, it's easier to leave it consistent for AIX between GCC and Clang. Once we drop GCC we should be able to remove the ifdefs.

Open in Gerrit

Related details

Attention is currently required from:
  • Abdirahim
  • Mark Seaborn
  • Matthias Liedtke
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
Gerrit-Comment-Date: Tue, 18 Nov 2025 16:47:49 +0000
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Nov 20, 2025, 9:46:37 PMNov 20
to Michael Achenbach, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Korinne Adler, Mark Seaborn, Matthias Liedtke and Toon Verwaest

Abdirahim added 1 comment

File src/execution/simulator.h
Toon Verwaest . resolved

I don't 100% understand what this code does; but gemini told me that this clobbers r0 which isn't on the clobber list?

Korinne Adler

It does indeed clobber r0, which is why it _is_ in the clobber list (along with memory).

The code is equivalent to the C++ code it replaces, initializing `function_desc` and assigning the address of the descriptor to the `Signature* fn`.

Line by line explanation:
```
std %1, 0(%2) // function_desc[0] = fn_ptr_
li 0, 0 // set r0 = 0 for use in the next two instructions
std 0, 8(%2) // function_desc[1] = 0
std 0, 16(%2) // function_desc[2] = 0
mr %0, %2 // fn = function_desc
```

Abdirahim

Acknowledged, @verw...@chromium.org any other questions on this?

Open in Gerrit

Related details

Attention is currently required from:
  • Korinne Adler
  • Mark Seaborn
  • Matthias Liedtke
  • Toon Verwaest
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
Gerrit-Change-Number: 7107287
Gerrit-PatchSet: 1
Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-CC: Clemens Backes <clem...@chromium.org>
Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Michael Achenbach <mache...@chromium.org>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Comment-Date: Fri, 21 Nov 2025 02:46:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
Comment-In-Reply-To: Korinne Adler <kad...@us.ibm.com>
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Nov 20, 2025, 9:47:46 PMNov 20
to Michael Achenbach, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Korinne Adler, Mark Seaborn, Matthias Liedtke and Toon Verwaest

Abdirahim added 1 comment

File src/trap-handler/handler-shared.cc
Line 28, Patchset 1 (Latest):__thread bool TrapHandlerGuard::is_active_ = 0;
Toon Verwaest . resolved

Why is this needed?

Abdirahim

This is needed because clang complains that is_active is not initialized. on AIX is_active is a __thread.

Toon Verwaest

Mmh ok weird. Sounds like this might be a linker issue; while `thread_local` should actually be supported by clang?

Korinne Adler

In trap-handler-internal.h, `is_active_` is declared as a `__thread` on AIX and links to a GCC bug report to explain why. However, the definition of the variable here still used `thread_local`, which while apparently acceptable on GCC gave a compile error on Clang.

We reached out to the AIX Clang devs to see the recommended way to fix this along with some other TLS-related questions. Hubert Tong (who commented in the GCC bug mentioned previously) told us that using `thread_local` here should be fine, but that it incurs extra overhead over using `__thread`. Since we still need to support GCC for now, it's easier to leave it consistent for AIX between GCC and Clang. Once we drop GCC we should be able to remove the ifdefs.

Abdirahim
Gerrit-Comment-Date: Fri, 21 Nov 2025 02:47:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
Comment-In-Reply-To: Korinne Adler <kad...@us.ibm.com>
Comment-In-Reply-To: Abdirahim <abdirah...@ibm.com>
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Nov 20, 2025, 9:48:38 PMNov 20
to Michael Achenbach, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Korinne Adler, Mark Seaborn, Matthias Liedtke, Milad Farazmand and Toon Verwaest

Abdirahim added 1 comment

File src/builtins/ppc/builtins-ppc.cc
Line 4161, Patchset 1 (Latest): __ bind(&no_stack_change);
Toon Verwaest . unresolved

This label could move into the branch above?

Abdirahim

I think we might be able to. @mfar...@ibm.com do you think this would be ok?

Milad Farazmand

Yes this should be fine.

Abdirahim

I'm working on this change now and will reply here once its uploaded.

Open in Gerrit

Related details

Attention is currently required from:
  • Korinne Adler
  • Mark Seaborn
  • Matthias Liedtke
  • Milad Farazmand
  • Toon Verwaest
Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Comment-Date: Fri, 21 Nov 2025 02:48:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
Comment-In-Reply-To: Milad Farazmand <mfar...@ibm.com>
Comment-In-Reply-To: Abdirahim <abdirah...@ibm.com>
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Nov 21, 2025, 12:36:42 AMNov 21
to Michael Achenbach, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Korinne Adler, Mark Seaborn, Matthias Liedtke, Milad Farazmand and Toon Verwaest

Abdirahim added 1 comment

File src/builtins/ppc/builtins-ppc.cc
Line 4161, Patchset 1 (Latest): __ bind(&no_stack_change);
Toon Verwaest . unresolved

This label could move into the branch above?

Abdirahim

I think we might be able to. @mfar...@ibm.com do you think this would be ok?

Milad Farazmand

Yes this should be fine.

Abdirahim

I'm working on this change now and will reply here once its uploaded.

Abdirahim

I don't quite understand the change I need to resolve the orignal question.

@verw...@chromium.org Can you please provide code suggestion on how this would look?

I could do something like this but I don't see the benefit:


```
if (needs_return_buffer) {
Label no_stack_change, done;
  if (switch_to_central_stack) {
__ CmpU64(kOldSPRegister, Operand(0), r0);
__ beq(&no_stack_change);
    __ addi(r3, kOldSPRegister,
Operand((kStackFrameExtraParamSlot + 1) * kSystemPointerSize));
__ b(&done);
    // Moved inside this block,
__ bind(&no_stack_change);
__ addi(r3, sp,
Operand((kStackFrameExtraParamSlot + 1) * kSystemPointerSize));
} else {
__ bind(&no_stack_change);
__ addi(r3, sp,
Operand((kStackFrameExtraParamSlot + 1) * kSystemPointerSize));
}
  __ bind(&done);
__ LoadU64(r4, MemOperand(r3, kSystemPointerSize));
__ LoadU64(r3, MemOperand(r3));
}
```
Gerrit-Comment-Date: Fri, 21 Nov 2025 05:36:39 +0000
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Nov 24, 2025, 6:56:46 PMNov 24
to Michael Achenbach, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
File src/builtins/ppc/builtins-ppc.cc
Abdirahim

@verw...@chromium.org polite ping to request apply on the above comment.

Gerrit-Comment-Date: Mon, 24 Nov 2025 23:56:43 +0000
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Nov 24, 2025, 7:13:34 PMNov 24
to Michael Achenbach, Milad Farazmand, Toon Verwaest, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
File src/builtins/ppc/builtins-ppc.cc
Abdirahim

*reply

Gerrit-Comment-Date: Tue, 25 Nov 2025 00:13:31 +0000
unsatisfied_requirement
open
diffy

Toon Verwaest (Gerrit)

unread,
Nov 26, 2025, 5:13:13 AMNov 26
to Abdirahim, Michael Achenbach, Milad Farazmand, Mark Seaborn, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Abdirahim, Korinne Adler, Mark Seaborn, Matthias Liedtke and Milad Farazmand

Toon Verwaest added 1 comment

File src/builtins/ppc/builtins-ppc.cc
Toon Verwaest

Instead of

```
if (needs_return_buffer) {
Label no_stack_change, done;
if (switch_to_central_stack) {
__ CmpU64(kOldSPRegister, Operand(0), r0);
__ beq(&no_stack_change);
__ addi(r3, kOldSPRegister,
Operand((kStackFrameExtraParamSlot + 1) * kSystemPointerSize));
__ b(&done);
}
    __ bind(&no_stack_change);
```

just do

```
if (needs_return_buffer) {
Label done;
if (switch_to_central_stack) {
Label no_stack_change;

__ CmpU64(kOldSPRegister, Operand(0), r0);
__ beq(&no_stack_change);
__ addi(r3, kOldSPRegister,
Operand((kStackFrameExtraParamSlot + 1) * kSystemPointerSize));
__ b(&done);
      __ bind(&no_stack_change);
}
```
?

I'm confused.
Open in Gerrit

Related details

Attention is currently required from:
  • Abdirahim
  • Korinne Adler
  • Mark Seaborn
  • Matthias Liedtke
  • Milad Farazmand
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
Gerrit-Change-Number: 7107287
Gerrit-PatchSet: 1
Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-CC: Clemens Backes <clem...@chromium.org>
Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Michael Achenbach <mache...@chromium.org>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
Gerrit-Comment-Date: Wed, 26 Nov 2025 10:13:09 +0000
unsatisfied_requirement
open
diffy

Mark Seaborn (Gerrit)

unread,
Dec 5, 2025, 8:55:11 PM (11 days ago) Dec 5
to Abdirahim, Mark Seaborn, Michael Achenbach, Milad Farazmand, Toon Verwaest, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Abdirahim, Korinne Adler, Matthias Liedtke, Milad Farazmand and Toon Verwaest

Mark Seaborn voted and added 3 comments

Votes added by Mark Seaborn

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Mark Seaborn . resolved

LGTM for trap-handler. You might want to split that into a separate CL to land sooner.

File src/execution/simulator.h
Line 203, Patchset 1 (Latest): void* function_desc[3];
Toon Verwaest . unresolved

Is there no way to achieve this without handwritten assembly?

Korinne Adler

We tried multiple ways to do this without, but Clang kept optimizing the descriptor setup away since casting to it is UB. Doing it directly in assembly assures that we get the behavior we need without the optimizer getting in our way.

Toon Verwaest

Acknowledged

Mark Seaborn

Have you tried declaring fn itself as volatile? e.g.:

```
Signature* volatile fn = reinterpret_cast<Signature*>(function_desc);
```

Or have you tried putting something like DoNotOptimize(&fn) just before the call to fn, where DoNotOptimize() is defined like this:

```
template <typename Type>
inline void DoNotOptimize(const Type& value) {
// The "memory" constraint tells the compiler that the inline assembly
// must be assumed to access memory that |value| points to.
asm volatile("" : : "g"(value) : "memory");
}
```

I suspect that might get the same effect as your assembly code without having to use actual assembly!

Sorry if those are obvious and you've tried them! Feel free to resolve this comment if those suggestions don't work.

I would also recommend filing an issue against Clang and linking to it here. I am not familiar with AIX function descriptors at all but it seems like there should be ways to stop Clang from optimising things away as undefined behaviour.

File src/trap-handler/handler-shared.cc
Line 28, Patchset 1 (Latest):__thread bool TrapHandlerGuard::is_active_ = 0;
Toon Verwaest . resolved

Why is this needed?

Abdirahim

This is needed because clang complains that is_active is not initialized. on AIX is_active is a __thread.

Toon Verwaest

Mmh ok weird. Sounds like this might be a linker issue; while `thread_local` should actually be supported by clang?

Korinne Adler

In trap-handler-internal.h, `is_active_` is declared as a `__thread` on AIX and links to a GCC bug report to explain why. However, the definition of the variable here still used `thread_local`, which while apparently acceptable on GCC gave a compile error on Clang.

We reached out to the AIX Clang devs to see the recommended way to fix this along with some other TLS-related questions. Hubert Tong (who commented in the GCC bug mentioned previously) told us that using `thread_local` here should be fine, but that it incurs extra overhead over using `__thread`. Since we still need to support GCC for now, it's easier to leave it consistent for AIX between GCC and Clang. Once we drop GCC we should be able to remove the ifdefs.

Abdirahim

Acknowledged, @verw...@chromium.org any other questions on this?

Mark Seaborn

In trap-handler-internal.h, is_active_ is defined as a __thread on AIX and links to a GCC bug report to explain why.

Makes sense, LGTM on this.

Open in Gerrit

Related details

Attention is currently required from:
  • Abdirahim
  • Korinne Adler
  • Matthias Liedtke
  • Milad Farazmand
  • Toon Verwaest
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
Gerrit-Change-Number: 7107287
Gerrit-PatchSet: 1
Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-CC: Clemens Backes <clem...@chromium.org>
Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Michael Achenbach <mache...@chromium.org>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
Gerrit-Comment-Date: Sat, 06 Dec 2025 01:55:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Dec 8, 2025, 12:14:21 PM (8 days ago) Dec 8
to Mark Seaborn, Michael Achenbach, Milad Farazmand, Toon Verwaest, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Korinne Adler, Matthias Liedtke, Milad Farazmand and Toon Verwaest

Abdirahim added 1 comment

File src/builtins/ppc/builtins-ppc.cc
Abdirahim

Ok I Think I better understand you suggestion now. I was a bit confused as well but I can see that you were suggesting moving the no_stack_change label to the branch where it gets bound to.

Open in Gerrit

Related details

Attention is currently required from:
Gerrit-Comment-Date: Mon, 08 Dec 2025 17:14:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
unsatisfied_requirement
open
diffy

Toon Verwaest (Gerrit)

unread,
Dec 9, 2025, 9:54:13 AM (7 days ago) Dec 9
to Abdirahim, Mark Seaborn, Michael Achenbach, Milad Farazmand, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Abdirahim, Korinne Adler, Matthias Liedtke and Milad Farazmand

Toon Verwaest added 2 comments

File src/builtins/ppc/builtins-ppc.cc
Toon Verwaest

So is this a thing you'll still address? I'm confused about the state.

File src/execution/simulator.h
Line 203, Patchset 1 (Latest): void* function_desc[3];
Toon Verwaest . unresolved

Is there no way to achieve this without handwritten assembly?

Korinne Adler

We tried multiple ways to do this without, but Clang kept optimizing the descriptor setup away since casting to it is UB. Doing it directly in assembly assures that we get the behavior we need without the optimizer getting in our way.

Toon Verwaest

Acknowledged

Mark Seaborn

Have you tried declaring fn itself as volatile? e.g.:

```
Signature* volatile fn = reinterpret_cast<Signature*>(function_desc);
```

Or have you tried putting something like DoNotOptimize(&fn) just before the call to fn, where DoNotOptimize() is defined like this:

```
template <typename Type>
inline void DoNotOptimize(const Type& value) {
// The "memory" constraint tells the compiler that the inline assembly
// must be assumed to access memory that |value| points to.
asm volatile("" : : "g"(value) : "memory");
}
```

I suspect that might get the same effect as your assembly code without having to use actual assembly!

Sorry if those are obvious and you've tried them! Feel free to resolve this comment if those suggestions don't work.

I would also recommend filing an issue against Clang and linking to it here. I am not familiar with AIX function descriptors at all but it seems like there should be ways to stop Clang from optimising things away as undefined behaviour.

Toon Verwaest

If any of Mark's suggestions work that would absolutely look better.

Open in Gerrit

Related details

Attention is currently required from:
  • Abdirahim
  • Korinne Adler
  • Matthias Liedtke
  • Milad Farazmand
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
Gerrit-Change-Number: 7107287
Gerrit-PatchSet: 1
Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-CC: Clemens Backes <clem...@chromium.org>
Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Michael Achenbach <mache...@chromium.org>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
Gerrit-Comment-Date: Tue, 09 Dec 2025 14:54:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
Comment-In-Reply-To: Milad Farazmand <mfar...@ibm.com>
Comment-In-Reply-To: Korinne Adler <kad...@us.ibm.com>
Comment-In-Reply-To: Mark Seaborn <msea...@chromium.org>
Comment-In-Reply-To: Abdirahim <abdirah...@ibm.com>
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Dec 11, 2025, 3:02:15 PM (5 days ago) Dec 11
to Mark Seaborn, Michael Achenbach, Milad Farazmand, Toon Verwaest, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Korinne Adler, Mark Seaborn, Matthias Liedtke, Milad Farazmand and Toon Verwaest

Abdirahim added 1 comment

File src/builtins/ppc/builtins-ppc.cc
Line 4161, Patchset 1: __ bind(&no_stack_change);
Toon Verwaest . resolved
Abdirahim

Acknowledged, I've made the change and tested it and things are still working. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Korinne Adler
  • Mark Seaborn
  • Matthias Liedtke
  • Milad Farazmand
  • Toon Verwaest
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
Gerrit-Change-Number: 7107287
Gerrit-PatchSet: 2
Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-CC: Clemens Backes <clem...@chromium.org>
Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
Gerrit-CC: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Michael Achenbach <mache...@chromium.org>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
Gerrit-Comment-Date: Thu, 11 Dec 2025 20:02:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
Comment-In-Reply-To: Milad Farazmand <mfar...@ibm.com>
Comment-In-Reply-To: Abdirahim <abdirah...@ibm.com>
unsatisfied_requirement
open
diffy

Abdirahim (Gerrit)

unread,
Dec 11, 2025, 3:06:38 PM (5 days ago) Dec 11
to Mark Seaborn, Michael Achenbach, Milad Farazmand, Toon Verwaest, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Korinne Adler, Mark Seaborn, Matthias Liedtke, Milad Farazmand and Toon Verwaest

Abdirahim added 2 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Abdirahim . resolved

We've tried all sorts of combinations of using volatile before we went down the path of using inline asm. Sometimes things would not get optimized away and other times tests failed due to optimizations happening. We've come to the conclusion that using the inline asm is the only fool proof solution.

@msea...@chromium.org @verw...@chromium.org

File src/execution/simulator.h
Line 203, Patchset 1: void* function_desc[3];
Toon Verwaest . resolved

Is there no way to achieve this without handwritten assembly?

Korinne Adler

We tried multiple ways to do this without, but Clang kept optimizing the descriptor setup away since casting to it is UB. Doing it directly in assembly assures that we get the behavior we need without the optimizer getting in our way.

Toon Verwaest

Acknowledged

Mark Seaborn

Have you tried declaring fn itself as volatile? e.g.:

```
Signature* volatile fn = reinterpret_cast<Signature*>(function_desc);
```

Or have you tried putting something like DoNotOptimize(&fn) just before the call to fn, where DoNotOptimize() is defined like this:

```
template <typename Type>
inline void DoNotOptimize(const Type& value) {
// The "memory" constraint tells the compiler that the inline assembly
// must be assumed to access memory that |value| points to.
asm volatile("" : : "g"(value) : "memory");
}
```

I suspect that might get the same effect as your assembly code without having to use actual assembly!

Sorry if those are obvious and you've tried them! Feel free to resolve this comment if those suggestions don't work.

I would also recommend filing an issue against Clang and linking to it here. I am not familiar with AIX function descriptors at all but it seems like there should be ways to stop Clang from optimising things away as undefined behaviour.

Toon Verwaest

If any of Mark's suggestions work that would absolutely look better.

Abdirahim

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Korinne Adler
  • Mark Seaborn
  • Matthias Liedtke
  • Milad Farazmand
  • Toon Verwaest
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    Gerrit-Comment-Date: Thu, 11 Dec 2025 20:06:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
    unsatisfied_requirement
    open
    diffy

    Toon Verwaest (Gerrit)

    unread,
    Dec 12, 2025, 9:03:09 AM (4 days ago) Dec 12
    to Abdirahim, Mark Seaborn, Michael Achenbach, Milad Farazmand, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
    Attention needed from Abdirahim, Korinne Adler, Mark Seaborn, Matthias Liedtke and Milad Farazmand

    Toon Verwaest voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Abdirahim
    • Korinne Adler
    • Mark Seaborn
    • Matthias Liedtke
    • Milad Farazmand
      Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: v8/v8
      Gerrit-Branch: main
      Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
      Gerrit-Change-Number: 7107287
      Gerrit-PatchSet: 2
      Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
      Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
      Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
      Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
      Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
      Gerrit-CC: Clemens Backes <clem...@chromium.org>
      Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
      Gerrit-CC: Mark Mentovai <ma...@chromium.org>
      Gerrit-CC: Michael Achenbach <mache...@chromium.org>
      Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
      Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
      Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
      Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
      Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
      Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
      Gerrit-Comment-Date: Fri, 12 Dec 2025 14:03:03 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Abdirahim (Gerrit)

      unread,
      Dec 12, 2025, 1:48:35 PM (4 days ago) Dec 12
      to Toon Verwaest, Mark Seaborn, Michael Achenbach, Milad Farazmand, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
      Attention needed from Korinne Adler, Mark Seaborn, Matthias Liedtke and Milad Farazmand

      Abdirahim added 1 comment

      Patchset-level comments
      Abdirahim . resolved

      @msea...@chromium.org @verw...@chromium.org

      Is there anything else we need to do to get this merged?

      Open in Gerrit

      Related details

      Attention is currently required from:
      Gerrit-Comment-Date: Fri, 12 Dec 2025 18:48:27 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Leszek Swirski (Gerrit)

      unread,
      Dec 15, 2025, 6:42:31 AM (yesterday) Dec 15
      to Abdirahim, Toon Verwaest, Mark Seaborn, Michael Achenbach, Milad Farazmand, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
      Attention needed from Abdirahim, Korinne Adler, Mark Seaborn, Matthias Liedtke and Milad Farazmand

      Leszek Swirski voted and added 1 comment

      Votes added by Leszek Swirski

      Code-Review+1

      1 comment

      File src/compiler/turboshaft/operations.h
      Line 529, Patchset 2 (Latest):struct __attribute__((packed)) EffectDimensions {
      Leszek Swirski . unresolved

      I'm not happy about these "packed" definitions leaking outside of AIX-define guarded code, but I can't think of an alternative which stills allows you to proceed with this CL. Please file a bug on Clang to make this configurable at a more granular level than `__attribute__((packed))`

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Abdirahim
      • Korinne Adler
      • Mark Seaborn
      • Matthias Liedtke
      • Milad Farazmand
        Submit Requirements:
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: v8/v8
        Gerrit-Branch: main
        Gerrit-Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
        Gerrit-Change-Number: 7107287
        Gerrit-PatchSet: 2
        Gerrit-Owner: Abdirahim <abdirah...@ibm.com>
        Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
        Gerrit-Reviewer: Mark Seaborn <msea...@chromium.org>
        Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
        Gerrit-Reviewer: Milad Farazmand <mfar...@ibm.com>
        Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
        Gerrit-CC: Clemens Backes <clem...@chromium.org>
        Gerrit-CC: Korinne Adler <kad...@us.ibm.com>
        Gerrit-CC: Mark Mentovai <ma...@chromium.org>
        Gerrit-CC: Michael Achenbach <mache...@chromium.org>
        Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
        Gerrit-Attention: Milad Farazmand <mfar...@ibm.com>
        Gerrit-Attention: Korinne Adler <kad...@us.ibm.com>
        Gerrit-Attention: Mark Seaborn <msea...@chromium.org>
        Gerrit-Attention: Matthias Liedtke <mlie...@chromium.org>
        Gerrit-Attention: Abdirahim <abdirah...@ibm.com>
        Gerrit-Comment-Date: Mon, 15 Dec 2025 11:42:26 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Abdirahim (Gerrit)

        unread,
        Dec 15, 2025, 7:02:17 PM (16 hours ago) Dec 15
        to Leszek Swirski, Toon Verwaest, Mark Seaborn, Michael Achenbach, Milad Farazmand, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
        Attention needed from Korinne Adler, Leszek Swirski, Mark Seaborn, Matthias Liedtke and Milad Farazmand

        Abdirahim added 1 comment

        File src/compiler/turboshaft/operations.h
        Line 529, Patchset 2 (Latest):struct __attribute__((packed)) EffectDimensions {
        Leszek Swirski . unresolved

        I'm not happy about these "packed" definitions leaking outside of AIX-define guarded code, but I can't think of an alternative which stills allows you to proceed with this CL. Please file a bug on Clang to make this configurable at a more granular level than `__attribute__((packed))`

        Abdirahim

        OK I will open a bug report with Clang to see if what the options are to make this configurable.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Korinne Adler
        • Leszek Swirski
        Gerrit-Attention: Leszek Swirski <les...@chromium.org>
        Gerrit-Comment-Date: Tue, 16 Dec 2025 00:02:08 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Leszek Swirski <les...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Abdirahim (Gerrit)

        unread,
        10:03 AM (1 hour ago) 10:03 AM
        to Leszek Swirski, Toon Verwaest, Mark Seaborn, Michael Achenbach, Milad Farazmand, Matthias Liedtke, Korinne Adler, Michaël Zasso, AyeAye, Clemens Backes, Mark Mentovai, dmercadi...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
        Attention needed from Korinne Adler, Leszek Swirski, Mark Seaborn, Matthias Liedtke and Milad Farazmand

        Abdirahim added 1 comment

        File src/compiler/turboshaft/operations.h
        Line 529, Patchset 2 (Latest):struct __attribute__((packed)) EffectDimensions {
        Leszek Swirski . resolved

        I'm not happy about these "packed" definitions leaking outside of AIX-define guarded code, but I can't think of an alternative which stills allows you to proceed with this CL. Please file a bug on Clang to make this configurable at a more granular level than `__attribute__((packed))`

        Abdirahim

        OK I will open a bug report with Clang to see if what the options are to make this configurable.

        Abdirahim

        Acknowledged

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Korinne Adler
        • Leszek Swirski
        • Mark Seaborn
        • Matthias Liedtke
        • Milad Farazmand
        Submit Requirements:
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Gerrit-Comment-Date: Tue, 16 Dec 2025 15:03:41 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Abdirahim <abdirah...@ibm.com>
          Comment-In-Reply-To: Leszek Swirski <les...@chromium.org>
          satisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages