https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90662
--- Comment #6 from Martin Sebor ---
Author: msebor
Date: Fri Jun 14 02:07:02 2019
New Revision: 272281
URL: https://gcc.gnu.org/viewcvs?rev=272281&root=gcc&view=rev
Log:
PR tree-optimization/90662 - strlen of a string in a vla plus offset not f
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90662
Martin Sebor changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90662
--- Comment #4 from Martin Sebor ---
Author: msebor
Date: Wed Jun 12 16:33:04 2019
New Revision: 272197
URL: https://gcc.gnu.org/viewcvs?rev=272197&root=gcc&view=rev
Log:
PR tree-optimization/90662 - strlen of a string in a vla plus offset not f
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90662
Martin Sebor changed:
What|Removed |Added
Keywords||patch
Status|UNCONFIRMED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90662
--- Comment #2 from Martin Sebor ---
It doesn't help that the ADDR_EXPR is rendered as &*a.1_9[2] when it should be
&(*a.1_9)[2] because a.1_9 is a pointer to a char[n] array. With the
parenthesization the problem becomes more apparent (to me, a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90662
--- Comment #1 from Martin Sebor ---
The inequality in g() should be != 3, not != 5:
void g (int n)
{
char a[n];
__builtin_strcpy (a, "12345");
if (__builtin_strlen (&a[2]) != 3) // not folded
__builtin_abort ();
}
The