On 10/19/2017 10:49 AM, Bin.Cheng wrote:
On Thu, Oct 19, 2017 at 9:31 AM, Tom de Vries <tom_devr...@mentor.com> wrote:
On 10/09/2017 03:34 PM, Richard Biener wrote:

On Thu, Oct 5, 2017 at 3:16 PM, Bin Cheng <bin.ch...@arm.com> wrote:

Hi,
Function generate_loops_for_partition chooses arbitrary path when
removing exit
condition not in partition.  This is fine for now because it's impossible
to have
loop exit condition in case of innermost distribution.  After extending
to loop
nest distribution, we must choose exit edge/path for inner loop's exit
condition,
otherwise an infinite empty loop will be generated.  Test case added.

Bootstrap and test in patch set on x86_64 and AArch64, is it OK?


Ok.

Richard.

Thanks,
bin
2017-10-04  Bin Cheng  <bin.ch...@arm.com>

          * tree-loop-distribution.c (generate_loops_for_partition):
Remove
          inner loop's exit stmt by making it always exit the loop,
otherwise
          we would generate an infinite empty loop.

gcc/testsuite/ChangeLog
2017-10-04  Bin Cheng  <bin.ch...@arm.com>

          * gcc.dg/tree-ssa/ldist-27.c: New test.


Hi,

I've committed patch below to specify the stack size requirements of this
test-case (fixing the test failure for nvptx).
Hi,
Maybe we can simply make the structure a global variable?


Works for me.

Committed as attached.

Thanks,
- Tom
Reduce stack size in gcc.dg/tree-ssa/ldist-27.c

2017-10-20  Tom de Vries  <t...@codesourcery.com>

	* gcc.dg/tree-ssa/ldist-27.c: Remove dg-require-stack-size.
	(main): Move s ...
	(s): ... here.

---
 gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c
index cd9696e..b1fd024 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c
@@ -1,6 +1,5 @@
 /* { dg-do run } */
 /* { dg-options "-O3 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
-/* { dg-require-stack-size "(300 + 200 + 300 * 200) * 8" } */
 
 #define M (300)
 #define N (200)
@@ -12,7 +11,8 @@ struct st
   double c[M][N];
 };
 
-int __attribute__ ((noinline)) foo (struct st *s)
+int __attribute__ ((noinline))
+foo (struct st *s)
 {
   int i, j;
   for (i = 0; i != M;)
@@ -30,9 +30,11 @@ L2:
   return 0;
 }
 
-int main (void)
+struct st s;
+
+int
+main (void)
 {
-  struct st s;
   return foo (&s);
 }
 

Reply via email to