diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc b/gcc/config/aarch64/aarch64-sve-builtins-base.cc index 9b63ea76ecd..4223125cd5e 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-base.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins-base.cc @@ -2295,17 +2295,6 @@ public: CONSTEXPR svundef_impl (unsigned int vectors_per_tuple) : quiet (vectors_per_tuple) {} - gimple * - fold (gimple_folder &f) const OVERRIDE - { - /* Don't fold svundef at the gimple level. There's no exact - correspondence for SSA_NAMEs, and we explicitly don't want - to generate a specific value (like an all-zeros vector). */ - if (vectors_per_tuple () == 1) - return NULL; - return gimple_build_assign (f.lhs, build_clobber (TREE_TYPE (f.lhs))); - } - rtx expand (function_expander &e) const OVERRIDE { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/undef_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/undef_1.c new file mode 100644 index 00000000000..793593b662c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/undef_1.c @@ -0,0 +1,12 @@ +/* { dg-options "-O2 -W -Wall -Werror" } */ + +#include + +svfloat32x2_t +foo (svfloat32_t x, svfloat32_t y) +{ + svfloat32x2_t res = svundef2_f32 (); + res = svset2 (res, 0, x); + res = svset2 (res, 1, y); + return res; +}