On 2/16/19 12:12 AM, Jakub Jelinek wrote: > Hi! > > Both the C and C++ standard guarantee that the argc argument to main is > non-negative, the following patch sets (or adjusts) the corresponding > SSA_NAME_RANGE_INFO. While main is just one, with IPA VRP it can also > propagate etc. I had to change one testcase because it started optimizing > it better (the test has been folded away), so no sinking was done. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2019-02-16 Jakub Jelinek <ja...@redhat.com> > > PR tree-optimization/89350 > * gimple-ssa-evrp.c: Include tree-dfa.h and langhooks.h. > (maybe_set_main_argc_range): New function. > (execute_early_vrp): Call it. > > * gcc.dg/tree-ssa/vrp122.c: New test. > * gcc.dg/tree-ssa/ssa-sink-3.c (main): Rename to ... > (bar): ... this. My recollection is this was somewhat controversial WRT standards interpretation. Additionally, it's just not clear how often this will help in the real world and Martin adjusted compute_objsize and the restrict pass to avoid the false positive.
Do we want to continue with this patch independently or not? My inclination would be no. jeff >