]> git.ipfire.org Git - thirdparty/gcc.git/commit
expand: Fix up ICE on VCE from _Complex types to _BitInt [PR117458]
authorJakub Jelinek <jakub@redhat.com>
Tue, 19 Nov 2024 09:26:44 +0000 (10:26 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 9 Jan 2025 08:50:04 +0000 (09:50 +0100)
commit98eabdaddc660906f59b8b3db53703588f72f39f
tree9474e38a6d952a53ddc3b66b557a2d1762ba3398
parente3b2c176d3e9f721185532a4a393814316172410
expand: Fix up ICE on VCE from _Complex types to _BitInt [PR117458]

extract_bit_field can't handle extraction of non-mode precision
from complex mode operands which don't live in memory, e.g. gen_lowpart
crashes on those.
The following patch in that case defers the extract_bit_field call
until op0 is forced into memory.

2024-11-19  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/117458
* expr.cc (expand_expr_real_1) <case VIEW_CONVERT_EXPR>: Don't
call extract_bit_field if op0 has complex mode and isn't a MEM,
instead first force op0 into memory and then call extract_bit_field.

* gcc.dg/bitint-116.c: New test.

(cherry picked from commit 694613a7f9adfa9c87e733adc63839c8801f2b5c)
gcc/expr.cc
gcc/testsuite/gcc.dg/bitint-116.c [new file with mode: 0644]