Skip to content

Conversation

@rascani
Copy link
Contributor

@rascani rascani commented Jan 15, 2026

Summary

Use if constexpr to prevent GCC from compiling the 64-bit memory offset shift on 32-bit systems where size_t is 32 bits. Also add validation that rejects models requiring >32-bit offsets on 32-bit systems.

/home/rja/executorch/runtime/executor/tensor_parser_exec_aten.cpp: In
function 'executorch::runtime::Result<void*>
executorch::runtime::deserialization::{anonymous}::getMemPlannedPtr(const
executorch_flatbuffer::AllocationDetails*, size_t,
executorch::runtime::HierarchicalAllocator*)':
/home/rja/executorch/runtime/executor/tensor_parser_exec_aten.cpp:66:62:
warning: left shift count >= width of type [-Wshift-count-overflow]
   66 |     memory_offset |= static_cast<size_t>(memory_offset_high) << 32;
      |
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

Test lan

examples/arm/setup.sh --i-agree-to-the-contained-eula
source examples/arm/arm-scratch/setup_path.sh
backends/cortex_m/test/build_test_runner.sh

Use if constexpr to prevent GCC from compiling the 64-bit memory
offset shift on 32-bit systems where size_t is 32 bits. Also add
validation that rejects models requiring >32-bit offsets on 32-bit
systems.

```
/home/rja/executorch/runtime/executor/tensor_parser_exec_aten.cpp: In
function 'executorch::runtime::Result<void*>
executorch::runtime::deserialization::{anonymous}::getMemPlannedPtr(const
executorch_flatbuffer::AllocationDetails*, size_t,
executorch::runtime::HierarchicalAllocator*)':
/home/rja/executorch/runtime/executor/tensor_parser_exec_aten.cpp:66:62:
warning: left shift count >= width of type [-Wshift-count-overflow]
   66 |     memory_offset |= static_cast<size_t>(memory_offset_high) <<
   32;
         |
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
```

```
examples/arm/setup.sh --i-agree-to-the-contained-eula
source examples/arm/arm-scratch/setup_path.sh
backends/cortex_m/test/build_test_runner.sh
```
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 15, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16610

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 6fe7840 with merge base 9cbe754 (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 15, 2026
@rascani rascani added ciflow/trunk release notes: none Do not include this in the release notes and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jan 15, 2026
@rascani rascani marked this pull request as ready for review January 15, 2026 00:28
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 15, 2026
@rascani rascani merged commit 13e7377 into pytorch:main Jan 15, 2026
307 of 311 checks passed
@rascani rascani deleted the tensor_parser_compiler_warning branch January 15, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants