aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-03-09 10:55:49 +0100
committerRichard Biener <rguenther@suse.de>2022-03-09 14:37:02 +0100
commitba3ff5e35144e2afff4ccef4ccbbbbaba9870afb (patch)
treefdf8174d9102c27fa84675b72b93098080525cd1 /gcc/cfgexpand.cc
parent1c7b110e1e44da0c93d0d011f5109c5d09bf4399 (diff)
downloadgcc-ba3ff5e35144e2afff4ccef4ccbbbbaba9870afb.zip
gcc-ba3ff5e35144e2afff4ccef4ccbbbbaba9870afb.tar.gz
gcc-ba3ff5e35144e2afff4ccef4ccbbbbaba9870afb.tar.bz2
middle-end/104786 - ICE with asm and VLA
The following fixes an ICE observed with a MEM_REF allows_mem asm operand referencing a VLA. The following makes sure to not attempt to go the temporary creation way when we cannot. 2022-03-09 Richard Biener <rguenther@suse.de> PR middle-end/104786 * cfgexpand.cc (expand_asm_stmt): Do not generate a copy for VLAs without an upper size bound. * gcc.dg/pr104786.c: New testcase.
Diffstat (limited to 'gcc/cfgexpand.cc')
-rw-r--r--gcc/cfgexpand.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc
index 87536ec..4f99f04 100644
--- a/gcc/cfgexpand.cc
+++ b/gcc/cfgexpand.cc
@@ -3297,7 +3297,9 @@ expand_asm_stmt (gasm *stmt)
&& GET_MODE (DECL_RTL (val)) != TYPE_MODE (type)))
|| ! allows_reg
|| is_inout
- || TREE_ADDRESSABLE (type))
+ || TREE_ADDRESSABLE (type)
+ || (!tree_fits_poly_int64_p (TYPE_SIZE (type))
+ && !known_size_p (max_int_size_in_bytes (type))))
{
op = expand_expr (val, NULL_RTX, VOIDmode,
!allows_reg ? EXPAND_MEMORY : EXPAND_WRITE);