aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-lower-bitint.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2024-02-02 11:27:37 +0100
committerJakub Jelinek <jakub@redhat.com>2024-02-02 11:30:05 +0100
commit49e75666c592d23dfa17f062974e660edd01d5fb (patch)
treef3683b8ab1e7184fc501f6e9e0a1918414ee6291 /gcc/gimple-lower-bitint.cc
parent5b069117e261ae0b438aee0cdff8707827810adf (diff)
downloadgcc-49e75666c592d23dfa17f062974e660edd01d5fb.zip
gcc-49e75666c592d23dfa17f062974e660edd01d5fb.tar.gz
gcc-49e75666c592d23dfa17f062974e660edd01d5fb.tar.bz2
lower-bitint: Handle uninitialized large/huge SSA_NAMEs as inline asm inputs [PR113699]
Similar problem to calls with uninitialized large/huge _BitInt SSA_NAME arguments, var_to_partition will not work for those, but unlike calls where we just create a new uninitialized SSA_NAME here we need to change the inline asm input to be an uninitialized VAR_DECL. 2024-02-02 Jakub Jelinek <jakub@redhat.com> PR middle-end/113699 * gimple-lower-bitint.cc (bitint_large_huge::lower_asm): Handle uninitialized large/huge _BitInt SSA_NAME inputs. * gcc.dg/bitint-81.c: New test.
Diffstat (limited to 'gcc/gimple-lower-bitint.cc')
-rw-r--r--gcc/gimple-lower-bitint.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/gimple-lower-bitint.cc b/gcc/gimple-lower-bitint.cc
index a3802c6..7588150 100644
--- a/gcc/gimple-lower-bitint.cc
+++ b/gcc/gimple-lower-bitint.cc
@@ -5200,9 +5200,18 @@ bitint_large_huge::lower_asm (gimple *stmt)
&& TREE_CODE (TREE_TYPE (s)) == BITINT_TYPE
&& bitint_precision_kind (TREE_TYPE (s)) >= bitint_prec_large)
{
- int part = var_to_partition (m_map, s);
- gcc_assert (m_vars[part] != NULL_TREE);
- TREE_VALUE (t) = m_vars[part];
+ if (SSA_NAME_IS_DEFAULT_DEF (s)
+ && (!SSA_NAME_VAR (s) || VAR_P (SSA_NAME_VAR (s))))
+ {
+ TREE_VALUE (t) = create_tmp_var (TREE_TYPE (s), "bitint");
+ mark_addressable (TREE_VALUE (t));
+ }
+ else
+ {
+ int part = var_to_partition (m_map, s);
+ gcc_assert (m_vars[part] != NULL_TREE);
+ TREE_VALUE (t) = m_vars[part];
+ }
}
}
update_stmt (stmt);