diff options
| author | Ira Rosen <irar@il.ibm.com> | 2009-05-28 09:02:53 +0000 | 
|---|---|---|
| committer | Ira Rosen <irar@gcc.gnu.org> | 2009-05-28 09:02:53 +0000 | 
| commit | 24adb18fce3b0263d959b11f52baeaa54dcdb8e9 (patch) | |
| tree | a99db9e2ac7ceb41f1fe537971ad4d7160246508 /gcc | |
| parent | 2c5bfdf70b616ace5c3f5322299ccc9729e08384 (diff) | |
| download | gcc-24adb18fce3b0263d959b11f52baeaa54dcdb8e9.zip gcc-24adb18fce3b0263d959b11f52baeaa54dcdb8e9.tar.gz gcc-24adb18fce3b0263d959b11f52baeaa54dcdb8e9.tar.bz2  | |
re PR tree-optimization/40254 (SPEC2006 403.gcc miscompares)
	PR tree-optimization/40254
	* tree-data-ref.c (dr_analyze_innermost): Take POFFSET into account
	in analysis of basic blocks.
From-SVN: r147945
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr40254.c | 39 | ||||
| -rw-r--r-- | gcc/tree-data-ref.c | 21 | 
4 files changed, 65 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 19324c7..b0c8803 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-05-28  Ira Rosen  <irar@il.ibm.com> + +	PR tree-optimization/40254 +	* tree-data-ref.c (dr_analyze_innermost): Take POFFSET into account +	in analysis of basic blocks. +  2009-05-28  Adam Nemet  <anemet@caviumnetworks.com>  	PR middle-end/33699 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 54fa22c..ff73c36 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-05-28  Ira Rosen  <irar@il.ibm.com> + +	PR tree-optimization/40254 +	* gcc.dg/vect/pr40254.c: New test. +  2009-05-28  Adam Nemet  <anemet@caviumnetworks.com>  	PR middle-end/33699 diff --git a/gcc/testsuite/gcc.dg/vect/pr40254.c b/gcc/testsuite/gcc.dg/vect/pr40254.c new file mode 100644 index 0000000..b890a449 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr40254.c @@ -0,0 +1,39 @@ +#include <stdlib.h> +#include <stdarg.h> +#include "tree-vect.h" + +struct s +{ +  int *x; +  int x1; +  int x2; +  int x3; +  int *y; +}; + +struct s arr[64] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); + +__attribute__ ((noinline)) void +foo (int i, int *in_x, int *in_y) +{ +  arr[i].x = in_x; +  arr[i].y = in_y; +} + +int +main (void) +{ +  int a, b; + +  check_vect (); + +  foo (5, &a, &b); + +  if (arr[5].x != &a || arr[5].y != &b) +    abort (); + +  return 0; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index dc79e8a..2181f46 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -718,17 +718,26 @@ dr_analyze_innermost (struct data_reference *dr)        base_iv.no_overflow = true;      } -  if (!poffset || !in_loop) +  if (!poffset)      {        offset_iv.base = ssize_int (0);        offset_iv.step = ssize_int (0);      } -  else if (!simple_iv (loop, loop_containing_stmt (stmt), -		       poffset, &offset_iv, false)) +  else      { -      if (dump_file && (dump_flags & TDF_DETAILS)) -	fprintf (dump_file, "failed: evolution of offset is not affine.\n"); -      return false; +      if (!in_loop) +        { +          offset_iv.base = poffset; +          offset_iv.step = ssize_int (0); +        } +      else if (!simple_iv (loop, loop_containing_stmt (stmt), +                           poffset, &offset_iv, false)) +        { +          if (dump_file && (dump_flags & TDF_DETAILS)) +            fprintf (dump_file, "failed: evolution of offset is not" +                                " affine.\n"); +          return false; +        }      }    init = ssize_int (pbitpos / BITS_PER_UNIT);  | 
