[Bug tree-optimization/86936] strnlen() of a constant not folded due to laddress transformation

2018-08-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86936

--- Comment #3 from Richard Biener  ---
Note to GIMPLE &a[1][i_3(D)] is just address-computation and carries no
semantics so you can't assume that i_3(D) isn't negative and thus ends up
accessing "123".  For the C testcase you of course can, but once we're
in GIMPLE you cannot.

If there's a load like

 _7 = a[1][i_3(D)];

you _can_ assume that i_3(D) fits in the respective array types domain.

[Bug tree-optimization/86936] strnlen() of a constant not folded due to laddress transformation

2018-08-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86936

Martin Sebor  changed:

   What|Removed |Added

Summary|strlen() of a constant not  |strnlen() of a constant not
   |folded due to laddress  |folded due to laddress
   |transformation  |transformation

--- Comment #2 from Martin Sebor  ---
This is about strnlen (strlen is folded early on).