diff options
author | Xi Ruoyao <xry111@mengyan1223.wang> | 2021-07-10 17:46:29 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@mengyan1223.wang> | 2021-07-30 15:43:38 +0800 |
commit | 291416d3782e12e983483a3f7b2154a3dbfc9e1f (patch) | |
tree | 5c434a2b48ab252e5f65bcfeb7b1e028aa839353 /gcc/gimple-loop-versioning.cc | |
parent | e41ba804ba5f5ca433e09238d561b1b4c8b10985 (diff) | |
download | gcc-291416d3782e12e983483a3f7b2154a3dbfc9e1f.zip gcc-291416d3782e12e983483a3f7b2154a3dbfc9e1f.tar.gz gcc-291416d3782e12e983483a3f7b2154a3dbfc9e1f.tar.bz2 |
ipa-devirt: check precision mismatch of enum values [PR101396]
We are comparing enum values (in wide_int) to check ODR violation.
However, if we compare two wide_int values with different precision,
we'll trigger an assert, leading to ICE. With enum-base introduced
in C++11, it's easy to sink into this situation.
To fix the issue, we need to explicitly check this kind of mismatch,
and emit a proper warning message if there is such one.
gcc/
PR ipa/101396
* ipa-devirt.c (ipa_odr_read_section): Compare the precision of
enum values, and emit a warning if they mismatch.
gcc/testsuite/
PR ipa/101396
* g++.dg/lto/pr101396_0.C: New test.
* g++.dg/lto/pr101396_1.C: New test.
Diffstat (limited to 'gcc/gimple-loop-versioning.cc')
0 files changed, 0 insertions, 0 deletions