On 5/24/19 12:27 AM, Eric Botcazou wrote:

There are a couple of testcases in the testsuite that, I believe, require a
minimal form of support for symbolic ranges: gcc.dg/tree-ssa/vrp94.c and
gnat.dg/opt40.adb.  They deal with the following pattern in C:

   if (x >= y)
     return 1;

   z = y - x;
   if (z <= 0)
     abort ();

   return z;

where we want to eliminate the abort.  Of course the C version doesn't really
make sense on its own, but it's the translation of the Ada version where the

   if (z <= 0)
     abort ();

is generated by the compiler (it's a range check in Ada parlance).

I bet compiling anything Fortran-y with array bound checking on (-fbounds-check) would generate ginormous numbers of opportunities for symbolic range checking ...

--
Toon Moene - e-mail: t...@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news

Reply via email to