aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-11-07 20:57:01 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-11-07 20:57:01 +0000
commit382ad5ce1bb6ce92c276adc9a35c619c0a070aca (patch)
tree4c18edfc1ad7fd6c4247d8bfff634a731d255b4c
parent64df297158621407b9a2204b661584c9a4d526e6 (diff)
downloadgcc-382ad5ce1bb6ce92c276adc9a35c619c0a070aca.zip
gcc-382ad5ce1bb6ce92c276adc9a35c619c0a070aca.tar.gz
gcc-382ad5ce1bb6ce92c276adc9a35c619c0a070aca.tar.bz2
re PR tree-optimization/63605 (wrong code at -O3 on x86_64-linux-gnu)
2014-11-07 Richard Biener <rguenther@suse.de> PR tree-optimization/63605 * fold-const.c (fold_binary_loc): Properly use element_precision for types that may not be scalar. * gcc.dg/vect/pr63605.c: New testcase. From-SVN: r217238
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/fold-const.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr63605.c22
4 files changed, 34 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eb5d793..966c0b4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-07 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/63605
+ * fold-const.c (fold_binary_loc): Properly use element_precision
+ for types that may not be scalar.
+
2014-11-07 Evgeny Stupachenko <evstupac@gmail.com>
PR target/63534
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index cff9c10..c712213 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -12817,7 +12817,7 @@ fold_binary_loc (location_t loc,
tree arg00 = TREE_OPERAND (arg0, 0);
tree arg01 = TREE_OPERAND (arg0, 1);
tree itype = TREE_TYPE (arg00);
- if (wi::eq_p (arg01, TYPE_PRECISION (itype) - 1))
+ if (wi::eq_p (arg01, element_precision (itype) - 1))
{
if (TYPE_UNSIGNED (itype))
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 52ff7ef..ba9df2c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-07 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/63605
+ * gcc.dg/vect/pr63605.c: New testcase.
+
2014-11-07 Jeff Law <law@redhat.com>
* g++.dg/pr61289-2.C: Renamed from pr61289-2.c.
diff --git a/gcc/testsuite/gcc.dg/vect/pr63605.c b/gcc/testsuite/gcc.dg/vect/pr63605.c
new file mode 100644
index 0000000..5096c72
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr63605.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+
+int a, b[8] = { 2, 0, 0, 0, 0, 0, 0, 0 }, c[8];
+
+int
+main ()
+{
+ int d;
+ check_vect ();
+ for (; a < 8; a++)
+ {
+ d = b[a] >> 1;
+ c[a] = d != 0;
+ }
+ if (c[0] != 1)
+ abort ();
+ return 0;
+}