aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-09-20 09:45:42 +0200
committerJakub Jelinek <jakub@redhat.com>2023-09-20 09:45:42 +0200
commit47ecac52bd4cae84dc786731c655c3bfe1ade377 (patch)
treee33dcd0f3f031e22d7568742b9e9727fd64153c3 /gcc/expr.cc
parent264ff8182580c57f77c6bc60381cfb2c3842b46c (diff)
downloadgcc-47ecac52bd4cae84dc786731c655c3bfe1ade377.zip
gcc-47ecac52bd4cae84dc786731c655c3bfe1ade377.tar.gz
gcc-47ecac52bd4cae84dc786731c655c3bfe1ade377.tar.bz2
middle-end: use MAX_FIXED_MODE_SIZE instead of precidion of TImode/DImode
On Tue, Sep 19, 2023 at 05:50:59PM +0100, Richard Sandiford wrote: > How about using MAX_FIXED_MODE_SIZE for things like this? Seems like a good idea. The following patch does that. 2023-09-20 Jakub Jelinek <jakub@redhat.com> * match.pd ((x << c) >> c): Use MAX_FIXED_MODE_SIZE instead of GET_MODE_PRECISION of TImode or DImode depending on whether TImode is supported scalar mode. * gimple-lower-bitint.cc (bitint_precision_kind): Likewise. * expr.cc (expand_expr_real_1): Likewise. * tree-ssa-sccvn.cc (eliminate_dom_walker::eliminate_stmt): Likewise. * ubsan.cc (ubsan_encode_value, ubsan_type_descriptor): Likewise.
Diffstat (limited to 'gcc/expr.cc')
-rw-r--r--gcc/expr.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/gcc/expr.cc b/gcc/expr.cc
index d5b6494..308ddc0 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -11044,17 +11044,11 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
scalar_int_mode limb_mode
= as_a <scalar_int_mode> (info.limb_mode);
unsigned int limb_prec = GET_MODE_PRECISION (limb_mode);
- if (prec > limb_prec)
+ if (prec > limb_prec && prec > MAX_FIXED_MODE_SIZE)
{
- scalar_int_mode arith_mode
- = (targetm.scalar_mode_supported_p (TImode)
- ? TImode : DImode);
- if (prec > GET_MODE_PRECISION (arith_mode))
- {
- /* Emit large/huge _BitInt INTEGER_CSTs into memory. */
- exp = tree_output_constant_def (exp);
- return expand_expr (exp, target, VOIDmode, modifier);
- }
+ /* Emit large/huge _BitInt INTEGER_CSTs into memory. */
+ exp = tree_output_constant_def (exp);
+ return expand_expr (exp, target, VOIDmode, modifier);
}
}