[PATCH] Cleanup range of address calculations.

Andrew MacLeod amacleod@redhat.com
Fri Nov 13 14:37:14 GMT 2020

There were some slight differences between when ranger would get 
non-zero for &expr and what EVRP was getting.

Ive extracted the bits from vrp_stmt_computes_nonzero required and now 
the 2 versions should be aligned. Ive also renamed the function from the 
previously cryptic range_of_non_trivial_assignment () to simply 
range_of_address ().

I also discovered we were not tracking integral constants, like 0, (AKA 
NULL) for pointers, so I added the constant handler in the pointer table.

I modified a test from 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78655 which shows some 
cases which track non-zero and zero and verified we remove bits when we 
can. Disabled all the previous passes so that EVRp actually sees the 
code and can make decisions.

bootstrapped on x86_64-pc-linux-gnu, no regressions. Pushed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: addr.diff
Type: text/x-patch
Size: 7001 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201113/da7dd63d/attachment.bin>

More information about the Gcc-patches mailing list