[gcc r11-9564] i386: Skip decimal float vector modes in type_natural_mode [PR79754]

Uros Bizjak uros@gcc.gnu.org
Sun Feb 13 09:18:18 GMT 2022


https://gcc.gnu.org/g:e89144e8a3984608da2d31f18776df51d9e0f352

commit r11-9564-ge89144e8a3984608da2d31f18776df51d9e0f352
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Sat Feb 12 10:53:49 2022 +0100

    i386: Skip decimal float vector modes in type_natural_mode [PR79754]
    
    2022-02-12  Uroš Bizjak  <ubizjak@gmail.com>
    
    gcc/ChangeLog:
    
            PR target/79754
            * config/i386/i386.c (type_natural_mode):
            Skip decimal float vector modes.
    
    gcc/testsuite/ChangeLog:
    
            PR target/79754
            * gcc.target/i386/pr79754.c: New test.
    
    (cherry picked from commit edadc7e0510b703d9727cf5ff68d55d84bb95def)

Diff:
---
 gcc/config/i386/i386.c                  | 6 +++++-
 gcc/testsuite/gcc.target/i386/pr79754.c | 7 +++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index bf471735d58..ecb78087502 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1872,10 +1872,14 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum,
 	{
 	  machine_mode innermode = TYPE_MODE (TREE_TYPE (type));
 
-	  /* There are no XFmode vector modes.  */
+	  /* There are no XFmode vector modes ...  */
 	  if (innermode == XFmode)
 	    return mode;
 
+	  /* ... and no decimal float vector modes.  */
+	  if (DECIMAL_FLOAT_MODE_P (innermode))
+	    return mode;
+
 	  if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE)
 	    mode = MIN_MODE_VECTOR_FLOAT;
 	  else
diff --git a/gcc/testsuite/gcc.target/i386/pr79754.c b/gcc/testsuite/gcc.target/i386/pr79754.c
new file mode 100644
index 00000000000..27845c9d5b9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr79754.c
@@ -0,0 +1,7 @@
+/* PR target/79754 */
+/* { dg-do compile } */
+/* { dg-options "-Wno-psabi" } */
+
+typedef _Decimal32 V __attribute__ ((vector_size(16)));
+
+V fn1 (V a) { return a; }


More information about the Gcc-cvs mailing list