https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90866
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Assignee|marxin at gcc dot gnu.org |unassigned at gcc dot gnu.org --- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- So my patch survives bootstrap and regression tests, can you please Martin take the issue? Patch candidate: diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c index 944650cecd5..a9b1147a2e7 100644 --- a/gcc/tree-ssa-strlen.c +++ b/gcc/tree-ssa-strlen.c @@ -324,7 +324,7 @@ get_stridx (tree exp) off = TREE_OPERAND (ptr, 1); /* Scale the array index by the size of the element type (normally 1 for char). */ - off = fold_build2 (MULT_EXPR, TREE_TYPE (off), off, + off = fold_build2 (MULT_EXPR, TREE_TYPE (eltsize), off, eltsize); ptr = TREE_OPERAND (ptr, 0); }