On 11/24/2016 05:59 AM, Martin Liška wrote:
On 11/24/2016 09:29 AM, Richard Biener wrote:
Please guard with ! TDF_GIMPLE, otherwise the output will not be parseable
with the GIMPLE FE.
RIchard.
Done and verified that and it provides equal dumps for -fdump*-gimple.
Installed as r242837.
Hi Martin,
I'm trying to understand how to interpret the probabilities (to
make sure one of my tests, builtin-sprintf-2.c, is testing what
it's supposed to be testing).
With this example:
char d2[2];
void f (void)
{
if (2 != __builtin_sprintf (d2, "%i", 12))
__builtin_abort ();
}
the probability of the branch to abort is 0%:
f1 ()
{
int _1;
<bb 2> [100.0%]:
_1 = __builtin_sprintf (&d, "%i", 12);
if (_1 != 2)
goto <bb 3>; [0.0%]
else
goto <bb 4>; [100.0%]
<bb 3> [0.0%]:
__builtin_abort ();
<bb 4> [100.0%]:
return;
}
Yet the call to abort is in the assembly so I would expect its
probability to be more than zero. So my question is: it it safe
to be testing for calls to abort in the optimized dump as a way
of verifying that the call has not been eliminated from the program
regardless of their probabilities?
For reference, the directive the test uses since this change was
committed looks like this:
{ dg-final { scan-tree-dump-times "> \\\[\[0-9.\]+%\\\]:\n
*__builtin_abort" 114 "optimized" }
If I'm reading the heavily escaped regex right it matches any
percentage, even 0.0% (and the test passes).
Thanks
Martin