aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-07-11 13:25:26 +0100
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:17:21 -0300
commitfd7e5cf4b8818fa2fbb460817d9ae691b01d94a3 (patch)
tree125768900192e94a44671b0a772ecdbb3ba9fd0f /gcc/fortran/interface.c
parent3c7b6756e8c647212bc82c7456b0328d2343ce45 (diff)
downloadgcc-fd7e5cf4b8818fa2fbb460817d9ae691b01d94a3.zip
gcc-fd7e5cf4b8818fa2fbb460817d9ae691b01d94a3.tar.gz
gcc-fd7e5cf4b8818fa2fbb460817d9ae691b01d94a3.tar.bz2
value-range: Fix handling of POLY_INT_CST anti-ranges [PR96146]
The range infrastructure has code to decompose POLY_INT_CST ranges to worst-case integer bounds. However, it had the fundamental flaw (obvious in hindsight) that it applied to anti-ranges too, meaning that a range 2+2X would end up with a range of ~[2, +INF], i.e. [-INF, 1]. This patch decays to varying in that case instead. I'm still a bit uneasy about this. ISTM that in terms of generality: SSA_NAME => POLY_INT_CST => INTEGER_CST => ADDR_EXPR I.e. an SSA_NAME could store a POLY_INT_CST and a POLY_INT_CST could store an INTEGER_CST (before canonicalisation). POLY_INT_CST is also “as constant as” ADDR_EXPR (well, OK, only some ADDR_EXPRs are run-time rather than link-time constants, whereas all POLY_INT_CSTs are, but still). So it seems like we should at least be able to treat POLY_INT_CST as symbolic. On the other hand, I don't have any examples in which that would be useful. gcc/ PR tree-optimization/96146 * value-range.cc (value_range::set): Only decompose POLY_INT_CST bounds to integers for VR_RANGE. Decay to VR_VARYING for anti-ranges involving POLY_INT_CSTs. gcc/testsuite/ PR tree-optimization/96146 * gcc.target/aarch64/sve/acle/general/pr96146.c: New test.
Diffstat (limited to 'gcc/fortran/interface.c')
0 files changed, 0 insertions, 0 deletions