]> git.ipfire.org Git - people/ms/gcc.git/commit
gimple-fold: Fix ICE in maybe_canonicalize_mem_ref_addr on debug stmt [PR96354]
authorJakub Jelinek <jakub@redhat.com>
Tue, 4 Aug 2020 09:31:44 +0000 (11:31 +0200)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 18:07:30 +0000 (15:07 -0300)
commitff5adb514c98dcac7cecbf2ea3f79e912838f931
tree7ae6ded3a2bb748de09f6673f378b476498ec339
parent31e87475935488da07c6958bd902d95abb53bc18
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  <jakub@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.
gcc/gimple-fold.c
gcc/testsuite/g++.dg/opt/pr96354.C [new file with mode: 0644]