diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-03 15:22:52 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-03 15:22:52 +0000 |
commit | 9c6813437611a877eaffc255a0a1a2cbffa6466d (patch) | |
tree | 530ff0e9aa28fe9f1bedfed3b5c589af8c6e76db | |
parent | 277ff3406d533990e98cf1c2075b9dc9db6fa48a (diff) | |
download | gcc-9c6813437611a877eaffc255a0a1a2cbffa6466d.zip gcc-9c6813437611a877eaffc255a0a1a2cbffa6466d.tar.gz gcc-9c6813437611a877eaffc255a0a1a2cbffa6466d.tar.bz2 |
aarch64: Don't fold svundef* at the gimple level
As the testcase shows, folding svundef*() at the gimple level
has the unfortunate side-effect of introducing -Wuninitialized
or -Wmaybe-uninitialized warnings. We don't have a testcase
that relies on the fold, so the easiest fix seems to be to
remove it.
gcc/
* config/aarch64/aarch64-sve-builtins-base.cc (svundef_impl::fold):
Delete.
gcc/testsuite/
* gcc.target/aarch64/sve/acle/general/undef_1.c: New test.
-rw-r--r-- | gcc/config/aarch64/aarch64-sve-builtins-base.cc | 11 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/sve/acle/general/undef_1.c | 12 |
2 files changed, 12 insertions, 11 deletions
diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc b/gcc/config/aarch64/aarch64-sve-builtins-base.cc index 9b63ea7..4223125 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<multi_vector_function> (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 0000000..793593b --- /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 <arm_sve.h> + +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; +} |