https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96354
--- Comment #24 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:49643954ffa71ddeec8e979e05f145ea688027f9 commit r10-8569-g49643954ffa71ddeec8e979e05f145ea688027f9 Author: Jakub Jelinek <ja...@redhat.com> Date: Tue Aug 4 11:31:44 2020 +0200 gimple-fold: Fix ICE in maybe_canonicalize_mem_ref_addr on debug stmt [PR96354] In debug stmts, we are less strict about what is and what is not accepted there, so this patch just punts on optimization of a debug stmt rather than ICEing. 2020-08-04 Jakub Jelinek <ja...@redhat.com> PR debug/96354 * gimple-fold.c (maybe_canonicalize_mem_ref_addr): Add IS_DEBUG argument. Return false instead of gcc_unreachable if it is true and get_addr_base_and_unit_offset returns NULL. (fold_stmt_1) <case GIMPLE_DEBUG>: Adjust caller. * g++.dg/opt/pr96354.C: New test. (cherry picked from commit fabe0ede9db9fa95832b2329d3d6156711905e20)