Bug 44913 - [4.6 Regression] -ftree-vectorize causes FAIL: gcc.dg/pr44838.c execution test
Summary: [4.6 Regression] -ftree-vectorize causes FAIL: gcc.dg/pr44838.c execution test
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P1 normal
Target Milestone: 4.6.0
Assignee: Richard Biener
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2010-07-11 19:39 UTC by Zdenek Sojka
Modified: 2010-10-14 15:55 UTC (History)
3 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-07-23 12:35:43


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2010-07-11 19:39:51 UTC
Command line:
$ gcc -O[123] -ftree-vectorize gcc.dg/pr44838.c && ./a.out

Output:
$ /mnt/svn/gcc-trunk/binary-162056-lto-fortran-checking-yes-rtl-df/bin/gcc -O1 -ftree-vectorize pr44838.i
$ ./a.out 
Aborted

Tested revisions:
r162056 - fail
r161659 - fail
r161170 - OK
Comment 1 H.J. Lu 2010-07-11 23:11:15 UTC
This is caused by revision 161655:

http://gcc.gnu.org/ml/gcc-cvs/2010-07/msg00006.html
Comment 2 Richard Biener 2010-07-23 12:35:43 UTC
Confirmed.  We end up vectorizing

void
foo (int *a, int n)
{
  int *lasta = a + n;
  for (; a != lasta; a++)
    {
      *a *= 2;
      a[1] = a[-1] + a[-2];
    }
}

not seeing the dependence of *a vs a[-1] because via
initialize_data_dependence_relation we ask the alias-oracle whether
*a may alias a[-1] (which it doesn't).  So we end up not computing
a dependence distance.

May we not use the alias-oracle (on the full ref) here?
Comment 3 Richard Biener 2010-10-14 10:38:45 UTC
Mine.
Comment 4 Richard Biener 2010-10-14 15:51:22 UTC
Author: rguenth
Date: Thu Oct 14 15:51:15 2010
New Revision: 165473

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165473
Log:
2010-10-14  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/44913
	* tree-data-ref.c (disjoint_objects_p): Remove.
	(dr_may_alias_p): Simplify.  Only hand the base object to
	the alias-oracle.
	* tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle
	some more trees, bail out instead of asserting.
	(ptr_derefs_may_alias_p): Likewise.  Export.
	(refs_may_alias_p_1): Handle STRING_CSTs.
	* tree-ssa-alias.h (ptr_derefs_may_alias_p): Declare.

	* gcc.dg/torture/pr44913.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr44913.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-data-ref.c
    trunk/gcc/tree-ssa-alias.c
    trunk/gcc/tree-ssa-alias.h
Comment 5 Richard Biener 2010-10-14 15:55:34 UTC
Fixed.