Open xiangzhai opened 6 years ago
Hi fellows,
As PR83026 mentioned: Testcase:
$ cat c.c void g (const char *a, const char *b) { if (__builtin_strlen (a) == __builtin_strlen (b)) return; if (!__builtin_strcmp (a, b)) __builtin_abort (); }
GCC 5.5 and 8.x failed to fold:
if (!__builtin_strcmp (a, b)) __builtin_abort ();
might be optimized to:
<bb 4> [count: 0]: __builtin_abort ();
Without:
<bb 3> [local count: 7903]: _3 = __builtin_strcmp (a_5(D), b_6(D)); if (_3 == 0) goto <bb 4>; [0.04%] else goto <bb 5>; [99.96%]
Qing Zhao is on it :+1:
Regards, Leslie Zhai
Hi fellows,
As PR83026 mentioned: Testcase:
GCC 5.5 and 8.x failed to fold:
might be optimized to:
Without:
Qing Zhao is on it :+1:
Regards, Leslie Zhai