diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr82816.c | 12 | ||||
-rw-r--r-- | gcc/tree-ssa-math-opts.c | 6 |
4 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6ba0a80..4ff37f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-11-06 Richard Sandiford <richard.sandiford@linaro.org> + Alan Hayward <alan.hayward@arm.com> + David Sherwood <david.sherwood@arm.com> + + PR tree-optimization/82816 + * tree-ssa-math-opts.c (convert_mult_to_widen): Return false + if the modes of the two types are the same. + (convert_plusminus_to_widen): Likewise. + 2017-11-06 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * config/rs6000/altivec.md (*p9_vadu<mode>3) Rename to diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dde8a35..d098cfc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-11-06 Richard Sandiford <richard.sandiford@linaro.org> + Alan Hayward <alan.hayward@arm.com> + David Sherwood <david.sherwood@arm.com> + + * gcc.c-torture/compile/pr82816.c: New test. + 2017-11-06 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.target/powerpc/sad-vectorize-1.c: New file. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr82816.c b/gcc/testsuite/gcc.c-torture/compile/pr82816.c new file mode 100644 index 0000000..8e9bd00 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr82816.c @@ -0,0 +1,12 @@ +struct A +{ + int b:3; +} d, e; + +int c; + +void f () +{ + char g = d.b * e.b; + c = g; +} diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 493f4e2..5986ac1 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -3259,6 +3259,9 @@ convert_mult_to_widen (gimple *stmt, gimple_stmt_iterator *gsi) to_mode = SCALAR_INT_TYPE_MODE (type); from_mode = SCALAR_INT_TYPE_MODE (type1); + if (to_mode == from_mode) + return false; + from_unsigned1 = TYPE_UNSIGNED (type1); from_unsigned2 = TYPE_UNSIGNED (type2); @@ -3449,6 +3452,9 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple *stmt, to_mode = SCALAR_TYPE_MODE (type); from_mode = SCALAR_TYPE_MODE (type1); + if (to_mode == from_mode) + return false; + from_unsigned1 = TYPE_UNSIGNED (type1); from_unsigned2 = TYPE_UNSIGNED (type2); optype = type1; |