diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-05-19 11:38:40 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2024-05-19 11:39:33 +0200 |
commit | 3db8dd4139a7a5ce941684f1fc05ee0652e35544 (patch) | |
tree | 4128dabfc8e13d2b144ba9bc3da3b5d19759fac8 | |
parent | 1676ef6e91b902f592270e4bcf10b4fc342e200d (diff) | |
download | gcc-3db8dd4139a7a5ce941684f1fc05ee0652e35544.zip gcc-3db8dd4139a7a5ce941684f1fc05ee0652e35544.tar.gz gcc-3db8dd4139a7a5ce941684f1fc05ee0652e35544.tar.bz2 |
Fix oversight in latest change to can_mult_highpart_p
gcc/
* optabs-query.cc (can_mult_highpart_p): Test for the existence of
a wider mode instead of requiring it.
-rw-r--r-- | gcc/optabs-query.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/optabs-query.cc b/gcc/optabs-query.cc index de145be..5149de5 100644 --- a/gcc/optabs-query.cc +++ b/gcc/optabs-query.cc @@ -510,17 +510,16 @@ int can_mult_highpart_p (machine_mode mode, bool uns_p) { optab op; - scalar_int_mode int_mode; + scalar_int_mode int_mode, wider_mode; op = uns_p ? umul_highpart_optab : smul_highpart_optab; if (optab_handler (op, mode) != CODE_FOR_nothing) return 1; /* If the mode is integral, synth from widening or larger operations. */ - if (is_a <scalar_int_mode> (mode, &int_mode)) + if (is_a <scalar_int_mode> (mode, &int_mode) + && GET_MODE_WIDER_MODE (int_mode).exists (&wider_mode)) { - scalar_int_mode wider_mode = GET_MODE_WIDER_MODE (int_mode).require (); - op = uns_p ? umul_widen_optab : smul_widen_optab; if (convert_optab_handler (op, wider_mode, mode) != CODE_FOR_nothing) return 2; |