diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-11 14:31:59 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-11 16:41:49 +0200 |
commit | 338725652f84793805c55f08a7607c2f45d5512b (patch) | |
tree | 75e4dce1c0a734ae0cf1cf7ba0221c1ff1cc1c84 | |
parent | 09a0affdb0598a54835ac4bb0dd6b54122c12916 (diff) | |
download | gcc-338725652f84793805c55f08a7607c2f45d5512b.zip gcc-338725652f84793805c55f08a7607c2f45d5512b.tar.gz gcc-338725652f84793805c55f08a7607c2f45d5512b.tar.bz2 |
middle-end/102683 - fix .DEFERRED_INIT expansion
This avoids using an integer type for which we don't have an
approprate mode when expanding .DEFERRED_INIT to a non-memory
entity.
2021-10-11 Richard Biener <rguenther@suse.de>
PR middle-end/102683
* internal-fn.c (expand_DEFERRED_INIT): Check for mode
availability before building an integer type for storage
purposes.
-rw-r--r-- | gcc/internal-fn.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c index 6bc2568..b363819 100644 --- a/gcc/internal-fn.c +++ b/gcc/internal-fn.c @@ -3074,7 +3074,9 @@ expand_DEFERRED_INIT (internal_fn, gcall *stmt) tree init; if (tree_fits_uhwi_p (var_size) && (init_type == AUTO_INIT_PATTERN - || !is_gimple_reg_type (var_type))) + || !is_gimple_reg_type (var_type)) + && int_mode_for_size (tree_to_uhwi (var_size) * BITS_PER_UNIT, + 0).exists ()) { unsigned HOST_WIDE_INT total_bytes = tree_to_uhwi (var_size); unsigned char *buf = (unsigned char *) xmalloc (total_bytes); |