diff options
author | Jakub Jelinek <jakub@redhat.com> | 2023-03-24 10:38:42 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-03-24 10:38:42 +0100 |
commit | 5450833e4f9993f81ac16cbbcf4e46881a519f85 (patch) | |
tree | a370db1a5a2e18c7f4da2c2e774afaa2e8a910ff /gcc/fortran/trans-decl.cc | |
parent | 0d9e52675c009139a14182d92ddb446ba2feabce (diff) | |
download | gcc-5450833e4f9993f81ac16cbbcf4e46881a519f85.zip gcc-5450833e4f9993f81ac16cbbcf4e46881a519f85.tar.gz gcc-5450833e4f9993f81ac16cbbcf4e46881a519f85.tar.bz2 |
builtins: Fix up ICE in inline_string_cmp [PR109258]
The PR109086 r13-6690 inline_string_cmp change to
if (diff != result)
emit_move_insn (result, diff);
regressed
FAIL: go.test/test/fixedbugs/bug207.go, -O2 -g (internal compiler error: in emit_move_insn, at expr.cc:4224)
The problem is the Go FE doesn't mark __builtin_memcmp as pure (I'll also
send patch for that) and so result is const0_rtx when the call lost its lhs
and the above move ICEs because moving something into const0_rtx is obviously
invalid.
I think it is better not to rely on all FEs having these *cmp functions
pure anD DCE being performed. The following patch just punts from the
inline expansion in that case, so we just emit normal library call.
2023-03-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/109258
* builtins.cc (inline_expand_builtin_bytecmp): Return NULL_RTX early
if target == const0_rtx.
Diffstat (limited to 'gcc/fortran/trans-decl.cc')
0 files changed, 0 insertions, 0 deletions