Commit 1d2b7cdf authored by carrot's avatar carrot

PR tree-optimization/63530

	tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Set
	pointer alignment according to DR_MISALIGNMENT.
	gcc.dg/vect/pr63530.c: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216770 138bc75d-0d04-0410-961f-82ee72b054a4
parent aeb91d73
2014-10-27 Guozhi Wei <carrot@google.com>
PR tree-optimization/63530
tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Set
pointer alignment according to DR_MISALIGNMENT.
2014-10-25 Yury Gribov <y.gribov@samsung.com>
PR sanitizer/63638
......
2014-10-27 Guozhi Wei <carrot@google.com>
PR tree-optimization/63530
gcc.dg/vect/pr63530.c: New test.
2014-10-27 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/entry_queues2.adb: New test.
......
/* { dg-options "-O2 -ftree-vectorize -funroll-loops --param \"max-completely-peeled-insns=400\"" } */
/* PR tree-optimization/63530 */
/* On armv7 hardware, following options cause run time failure */
/* -march=armv7-a -mfloat-abi=hard -mfpu=neon -marm -O2 -ftree-vectorize */
/* -funroll-loops --param "max-completely-peeled-insns=400" */
#include <stdlib.h>
typedef struct {
unsigned char map[256];
int i;
} A, *AP;
AP __attribute__ ((noinline))
foo (int n)
{
AP b = (AP)calloc (1, sizeof (A));
int i;
for (i = n; i < 256; i++)
b->map[i] = i;
return b;
}
int
main()
{
AP p = foo(3);
return p->map[30] - p->map[20] - p->map[10];
}
......@@ -3941,8 +3941,12 @@ vect_create_addr_base_for_vector_ref (gimple stmt,
&& TREE_CODE (addr_base) == SSA_NAME)
{
duplicate_ssa_name_ptr_info (addr_base, DR_PTR_INFO (dr));
if (offset)
unsigned int align = TYPE_ALIGN_UNIT (STMT_VINFO_VECTYPE (stmt_info));
int misalign = DR_MISALIGNMENT (dr);
if (offset || byte_offset || (misalign == -1))
mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (addr_base));
else
set_ptr_info_alignment (SSA_NAME_PTR_INFO (addr_base), align, misalign);
}
if (dump_enabled_p ())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment