diff options
author | Kewen Lin <linkw@linux.ibm.com> | 2021-10-26 04:09:38 -0500 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2021-10-26 04:10:00 -0500 |
commit | 54e4e1769e44b925c35c0ffc11723027ff855bd7 (patch) | |
tree | 813ab9de27f972e406e7ff7f730f17013378bffa /gcc | |
parent | ccbd6c37c4f6e12a3fbb22314a09db897a0aa8b9 (diff) | |
download | gcc-54e4e1769e44b925c35c0ffc11723027ff855bd7.zip gcc-54e4e1769e44b925c35c0ffc11723027ff855bd7.tar.gz gcc-54e4e1769e44b925c35c0ffc11723027ff855bd7.tar.bz2 |
forwprop: Remove incorrect assertion [PR102897]
As PR102897 shows, there is one incorrect assertion in function
simplify_permutation, which is based on the wrong assumption that
all cases with op2_type == tgt_type are handled previously, the
proposed fix is to remove the assertion.
gcc/ChangeLog:
PR tree-optimization/102897
* tree-ssa-forwprop.c (simplify_permutation): Remove a wrong assertion.
gcc/testsuite/ChangeLog:
* gcc.dg/pr102897.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr102897.c | 16 | ||||
-rw-r--r-- | gcc/tree-ssa-forwprop.c | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/pr102897.c b/gcc/testsuite/gcc.dg/pr102897.c new file mode 100644 index 0000000..bb14dcc --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr102897.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* Specify C99 to avoid the warning/error on compound literals. */ +/* { dg-options "-O1 -std=c99" } */ + +/* Verify that there is no ICE. */ + +typedef __attribute__((vector_size(8))) signed char int8x8_t; +typedef __attribute__((vector_size(8))) unsigned char uint8x8_t; + +int8x8_t fn1 (int8x8_t val20, char tmp) +{ + uint8x8_t __trans_tmp_3; + __trans_tmp_3 = (uint8x8_t){tmp}; + int8x8_t __a = (int8x8_t) __trans_tmp_3; + return __builtin_shuffle (__a, val20, (uint8x8_t){0}); +} diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 5b30d4c..a830bab 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -2267,8 +2267,6 @@ simplify_permutation (gimple_stmt_iterator *gsi) if (!VECTOR_TYPE_P (tgt_type)) return 0; tree op2_type = TREE_TYPE (op2); - /* Should have folded this before. */ - gcc_assert (op2_type != tgt_type); /* Figure out the shrunk factor. */ poly_uint64 tgt_units = TYPE_VECTOR_SUBPARTS (tgt_type); |