aboutsummaryrefslogtreecommitdiff
path: root/4.6.0
diff options
context:
space:
mode:
authorRyan Hill <rhill@gentoo.org>2011-04-13 01:06:26 +0000
committerRyan Hill <rhill@gentoo.org>2011-04-13 01:06:26 +0000
commit5ba60ac2c3854bc3b2aa405b76a77efd7afaf149 (patch)
tree603932e0af0bbacb71e317ec4788909158ee54c7 /4.6.0
parentMake preprocessor spec rules work again. Go back to using spec rules for _FO... (diff)
downloadgcc-patches-5ba60ac2c3854bc3b2aa405b76a77efd7afaf149.tar.gz
gcc-patches-5ba60ac2c3854bc3b2aa405b76a77efd7afaf149.tar.bz2
gcc-patches-5ba60ac2c3854bc3b2aa405b76a77efd7afaf149.zip
Add patch for PR48377.
Diffstat (limited to '4.6.0')
-rw-r--r--4.6.0/gentoo/76_all_pr48377_4.6.1_O3-wrong-code.patch52
-rw-r--r--4.6.0/gentoo/README.history1
2 files changed, 53 insertions, 0 deletions
diff --git a/4.6.0/gentoo/76_all_pr48377_4.6.1_O3-wrong-code.patch b/4.6.0/gentoo/76_all_pr48377_4.6.1_O3-wrong-code.patch
new file mode 100644
index 0000000..dc8cf8d
--- /dev/null
+++ b/4.6.0/gentoo/76_all_pr48377_4.6.1_O3-wrong-code.patch
@@ -0,0 +1,52 @@
+Wrong alignment with vectorization.
+
+http://gcc.gnu.org/PR48377
+
+
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/vect/pr48377.c
+@@ -0,0 +1,25 @@
++/* PR tree-optimization/48377 */
++/* { dg-do run } */
++
++typedef unsigned int U __attribute__((__aligned__ (1), __may_alias__));
++
++__attribute__((noinline, noclone)) unsigned int
++foo (const char *s, int len)
++{
++ const U *p = (const U *) s;
++ unsigned int f = len / sizeof (unsigned int), hash = len, i;
++
++ for (i = 0; i < f; ++i)
++ hash += *p++;
++ return hash;
++}
++
++char buf[64] __attribute__((aligned (32)));
++
++int
++main (void)
++{
++ return foo (buf + 1, 26) != 26;
++}
++
++/* { dg-final { cleanup-tree-dump "vect" } } */
+--- a/gcc/tree-vect-data-refs.c
++++ b/gcc/tree-vect-data-refs.c
+@@ -1,5 +1,5 @@
+ /* Data References Analysis and Manipulation Utilities for Vectorization.
+- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
++ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ Free Software Foundation, Inc.
+ Contributed by Dorit Naishlos <dorit@il.ibm.com>
+ and Ira Rosen <irar@il.ibm.com>
+@@ -1143,6 +1143,9 @@ vector_alignment_reachable_p (struct data_reference *dr)
+ if (ba)
+ is_packed = contains_packed_reference (ba);
+
++ if (compare_tree_int (TYPE_SIZE (type), TYPE_ALIGN (type)) > 0)
++ is_packed = true;
++
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "Unknown misalignment, is_packed = %d",is_packed);
+ if (targetm.vectorize.vector_alignment_reachable (type, is_packed))
diff --git a/4.6.0/gentoo/README.history b/4.6.0/gentoo/README.history
index 73a194b..67c4973 100644
--- a/4.6.0/gentoo/README.history
+++ b/4.6.0/gentoo/README.history
@@ -2,6 +2,7 @@
+ 01_all_joined-cpp-defs.patch
U 10_all_default-fortify-source.patch
+ 75_all_pr48335-4.6.1-ICE.patch
+ + 76_all_pr48377_4.6.1_O3-wrong-code.patch
1.1 2011-04-03
U 10_all_default-fortify-source.patch