objsz: Don't call replace_uses_by on SSA_NAME_OCCURS_IN_ABNORMAL_PHI [PR94423]
authorJakub Jelinek <jakub@redhat.com>
Wed, 1 Apr 2020 07:44:59 +0000 (09:44 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 1 Apr 2020 07:44:59 +0000 (09:44 +0200)
commit9ecb3ecc8cc0497a2cc815589c59547fd5af8512
treef812bce258a1e5f17c309aed2178ca29fe9fe964
parent142d68f50b48309f48e34fc1d9d6dbbeecfde684
objsz: Don't call replace_uses_by on SSA_NAME_OCCURS_IN_ABNORMAL_PHI [PR94423]

The following testcase ICEs because the objsz pass calls replace_uses_by
on SSA_NAME_OCCURS_IN_ABNORMAL_PHI SSA_NAME.  The following patch instead
of that calls replace_call_with_value, which will turn it into
  xyz_123(ab) = 234;

2020-04-01  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/94423
* tree-object-size.c (pass_object_sizes::execute): Don't call
replace_uses_by for SSA_NAME_OCCURS_IN_ABNORMAL_PHI lhs, instead
call replace_call_with_value.

* gcc.dg/ubsan/pr94423.c: New test.
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ubsan/pr94423.c [new file with mode: 0644]
gcc/tree-object-size.c