https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90969
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 46513 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46513&action=edit gcc10-pr90969.patch Untested fix. If lval, ary is used solely in: if (lval && ary == oldary && index == oldidx) return t; else if (lval) return build4 (ARRAY_REF, TREE_TYPE (t), ary, index, NULL, NULL); and so looking through the VCE is harmful, both because it forces not reusing of t in more cases (when for both 0 and 1 operand cxx_eval_constant_expression didn't simplify anything), but because it strips away the needed VCE.