* [PATCH] Fix PR77605
@ 2016-09-16 13:28 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2016-09-16 13:28 UTC (permalink / raw)
To: gcc-patches
The following patch fixes PR77605.
Bootstrap and regtest running on x86_64-unknown-linux-gnu.
Richard.
2016-09-16 Richard Biener <rguenther@suse.de>
PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.
* gcc.dg/torture/pr77605.c: New testcase.
Index: gcc/tree-data-ref.c
===================================================================
*** gcc/tree-data-ref.c (revision 240176)
--- gcc/tree-data-ref.c (working copy)
*************** analyze_subscript_affine_affine (tree ch
*** 2686,2698 ****
if (niter > 0)
{
! HOST_WIDE_INT tau2 = MIN (FLOOR_DIV (niter - i0, i1),
! FLOOR_DIV (niter - j0, j1));
HOST_WIDE_INT last_conflict = tau2 - (x1 - i0)/i1;
/* If the overlap occurs outside of the bounds of the
loop, there is no dependence. */
! if (x1 >= niter || y1 >= niter)
{
*overlaps_a = conflict_fn_no_dependence ();
*overlaps_b = conflict_fn_no_dependence ();
--- 2682,2694 ----
if (niter > 0)
{
! HOST_WIDE_INT tau2 = MIN (FLOOR_DIV (niter_a - i0, i1),
! FLOOR_DIV (niter_b - j0, j1));
HOST_WIDE_INT last_conflict = tau2 - (x1 - i0)/i1;
/* If the overlap occurs outside of the bounds of the
loop, there is no dependence. */
! if (x1 >= niter_a || y1 >= niter_b)
{
*overlaps_a = conflict_fn_no_dependence ();
*overlaps_b = conflict_fn_no_dependence ();
Index: gcc/testsuite/gcc.dg/torture/pr77605.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr77605.c (revision 0)
--- gcc/testsuite/gcc.dg/torture/pr77605.c (working copy)
***************
*** 0 ****
--- 1,15 ----
+ /* { dg-do run } */
+
+ int a, b, c[2][8];
+
+ int main ()
+ {
+ for (a = 0; a < 8; a++)
+ for (b = 0; b < 2; b++)
+ c[b][a] = c[b][b + 6] ^ 1;
+
+ if (c[0][7] != 0)
+ __builtin_abort ();
+
+ return 0;
+ }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-16 13:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-16 13:28 [PATCH] Fix PR77605 Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).