A test case (gcc/testsuite/gcc.dg/graphite/pr18792.c) came up when we removed 
`graphite-scop-detection.c:limit_scops'.
The test case is a scop where entry==exit,

BB5 (*#) -> BB6 (#);
BB6 -> BB5;

In this case BB2 is out of the scop. This is basically an empty (infinite) loop.



2015-06-29  Aditya Kumar  <aditya...@samsung.com>
        Sebastian Pop <s....@samsung.com>

        * graphite-scop-detection.c (build_scops_1): Discard scops for which 
entry==exit


---
 gcc/graphite-scop-detection.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index e8ddecd..f57cc4a 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -810,7 +810,14 @@ build_scops_1 (basic_block current, loop_p outermost_loop,
     {
       open_scop.exit = sinfo.exit;
       gcc_assert (open_scop.exit);
-      scops->safe_push (open_scop);
+      if (open_scop.entry != open_scop.exit)
+    scops->safe_push (open_scop);
+      else
+    {
+      sinfo.difficult = true;
+      sinfo.exits = false;
+      sinfo.exit = NULL;
+    }
     }
 
   result.exit = sinfo.exit;
-- 
2.1.0.243.g30d45f7



----------------------------------------
> Date: Thu, 2 Jul 2015 09:53:25 +0200
> From: tob...@grosser.es
> To: hiradi...@msn.com; seb...@gmail.com
> CC: gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] Discard Scops for which entry==exit
>
> On 06/30/2015 05:47 PM, Aditya K wrote:
>> Hi Tobias,
>> A test case (gcc/testsuite/gcc.dg/graphite/pr18792.c) came up when we 
>> removed `graphite-scop-detection.c:limit_scops'.
>> The test case is a scop where entry==exit,
>>
>> BB5 (*#) -> BB6 (#);
>> BB6 -> BB5;
>>
>> In this case BB2 is out of the scop. This is basically an empty (infinite) 
>> loop with no entr
>
> OK, maybe mention this in the commit message.
>
>
> Best,
> Tobias
>
                                          

Reply via email to