diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-01-25 13:45:59 -0800 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-01-25 21:02:19 -0800 |
commit | 0c2583dc2575f3f64e3d09e12c296eb56f01916d (patch) | |
tree | 224e6e941fc89f6035a2253fc20ef92da4ef34d8 /gcc/cp/module.cc | |
parent | f22a7ae8a96f7e5e330b12bd5045424619aa4926 (diff) | |
download | gcc-0c2583dc2575f3f64e3d09e12c296eb56f01916d.zip gcc-0c2583dc2575f3f64e3d09e12c296eb56f01916d.tar.gz gcc-0c2583dc2575f3f64e3d09e12c296eb56f01916d.tar.bz2 |
aarch64: Fix/avoid undefinedness in aarch64_classify_index [PR100212]
The problem here is we don't check the return value of exact_log2
and always use that result as shifter. This fixes the issue by avoiding
the shift if the value was `-1` (which means the value was not exact a power of 2);
in this case we could either check if the values was equal to -1 or not equal to because
we then assign -1 to shift if the constant value was not equal. I chose `!=` as
it seemed to be more obvious of what the code is doing.
Committed as obvious after a build/test for aarch64-linux-gnu.
gcc/ChangeLog:
PR target/100212
* config/aarch64/aarch64.cc (aarch64_classify_index): Avoid
undefined shift after the call to exact_log2.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/cp/module.cc')
0 files changed, 0 insertions, 0 deletions