Skip to content

[Bug Fix] "Impossible overload" -Sv fix for non-power-of-2 arrays

Summary

This merge request helps fix an issue with the -Sv option that caused operator overloads to not work for array types that aren't a power of 2 in size, when they work fine without the -Sv option. This is done by returning False on is_vector for arrays that aren't a power of 2 in size or smaller than 8 bytes total, since they do not fit in standard vector registers that are almost always a power of 2 in size (e.g. 64-bit, 128-bit etc.).

System

  • Processor architecture: All, but mostly noted under x86_64

What is the current bug behavior?

Array types with a non-power-of-2 size cannot be overloaded under the -Sv option.

What is the behavior after applying this patch?

Array types with a non-power-of-2 size can now be overloaded under the -Sv option.

Additional notes

The new test webtbs/tw3366a.pp evaluates the behaviour of non-power-of-2 array sizes by duplicating an existing test and adding the -Sv option to it.

The new tests webtbs/tw3366b.pp and webtbs/tw3366c.pp extend the tests to 4-component array types. Currently, webtbs/tw3366c.pp fails because it is considered a vector type and there does not seem to yet be proper support for overloading their operators (it's disallowed for some reason). This failed test is being left as-is because it is a simple use case that should not be failing.

Merge request reports