diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2016-08-04 13:20:57 +0000 |
---|---|---|
committer | Bernd Edlinger <edlinger@gcc.gnu.org> | 2016-08-04 13:20:57 +0000 |
commit | 086ad22e0e7bbff4329d0dcbdc1b4be04ba4a868 (patch) | |
tree | c1189eb5f7c1e72590aee39e3b908fd9838a97a5 /gcc | |
parent | 9a8e528cf1e5aa1a7e7fa09716a3b5b87b56dc93 (diff) | |
download | gcc-086ad22e0e7bbff4329d0dcbdc1b4be04ba4a868.zip gcc-086ad22e0e7bbff4329d0dcbdc1b4be04ba4a868.tar.gz gcc-086ad22e0e7bbff4329d0dcbdc1b4be04ba4a868.tar.bz2 |
re PR target/70903 (wrong code with bfi @ aarch64 with -Os)
2016-08-04 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR rtl-optimization/70903
* cse.c (cse_insn): If DEST is a paradoxical SUBREG, don't record DEST.
testsuite:
2016-08-04 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR rtl-optimization/70903
* gcc.c-torture/execute/pr70903.c: New test.
From-SVN: r239122
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cse.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr70903.c | 38 |
4 files changed, 54 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d9d8c1..6c41321 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-08-04 Bernd Edlinger <bernd.edlinger@hotmail.de> + + PR rtl-optimization/70903 + * cse.c (cse_insn): If DEST is a paradoxical SUBREG, don't record DEST. + 2016-08-04 Kugan Vivekanandarajah <kuganv@linaro.org> * tree-inline.c (remap_ssa_name): Check for POINTER_TYPE_P before @@ -5898,15 +5898,7 @@ cse_insn (rtx_insn *insn) || GET_MODE (dest) == BLKmode /* If we didn't put a REG_EQUAL value or a source into the hash table, there is no point is recording DEST. */ - || sets[i].src_elt == 0 - /* If DEST is a paradoxical SUBREG and SRC is a ZERO_EXTEND - or SIGN_EXTEND, don't record DEST since it can cause - some tracking to be wrong. - - ??? Think about this more later. */ - || (paradoxical_subreg_p (dest) - && (GET_CODE (sets[i].src) == SIGN_EXTEND - || GET_CODE (sets[i].src) == ZERO_EXTEND))) + || sets[i].src_elt == 0) continue; /* STRICT_LOW_PART isn't part of the value BEING set, @@ -5925,6 +5917,11 @@ cse_insn (rtx_insn *insn) sets[i].dest_hash = HASH (dest, GET_MODE (dest)); } + /* If DEST is a paradoxical SUBREG, don't record DEST since the bits + outside the mode of GET_MODE (SUBREG_REG (dest)) are undefined. */ + if (paradoxical_subreg_p (dest)) + continue; + elt = insert (dest, sets[i].src_elt, sets[i].dest_hash, GET_MODE (dest)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b5ccb9a..0b2a7f2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-08-04 Bernd Edlinger <bernd.edlinger@hotmail.de> + + PR rtl-optimization/70903 + * gcc.c-torture/execute/pr70903.c: New test. + 2016-08-04 Martin Liska <mliska@suse.cz> * gcc.dg/params/params.exp: Replace file exists with diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70903.c b/gcc/testsuite/gcc.c-torture/execute/pr70903.c new file mode 100644 index 0000000..6ffd0aa --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr70903.c @@ -0,0 +1,38 @@ +typedef unsigned char V8 __attribute__ ((vector_size (32))); +typedef unsigned int V32 __attribute__ ((vector_size (32))); +typedef unsigned long long V64 __attribute__ ((vector_size (32))); + +static V32 __attribute__ ((noinline, noclone)) +foo (V64 x) +{ + V64 y = (V64)(V8){((V8)(V64){65535, x[0]})[1]}; + return (V32){y[0], 255}; +} + +int main () +{ + V32 x = foo ((V64){}); +// __builtin_printf ("%08x %08x %08x %08x %08x %08x %08x %08x\n", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]); + if (x[1] != 255) + __builtin_abort(); + return 0; +} +typedef unsigned char V8 __attribute__ ((vector_size (32))); +typedef unsigned int V32 __attribute__ ((vector_size (32))); +typedef unsigned long long V64 __attribute__ ((vector_size (32))); + +static V32 __attribute__ ((noinline, noclone)) +foo (V64 x) +{ + V64 y = (V64)(V8){((V8)(V64){65535, x[0]})[1]}; + return (V32){y[0], 255}; +} + +int main () +{ + V32 x = foo ((V64){}); +// __builtin_printf ("%08x %08x %08x %08x %08x %08x %08x %08x\n", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]); + if (x[1] != 255) + __builtin_abort(); + return 0; +} |