Hi,

On 22.12.2017 11:42, Eero Tamminen wrote:
On 21.12.2017 22:19, Mark Janes wrote:
This patch doesn't apply to master as formatted.

It was against master.  Could you try the attached patch instead?

Argh, I meant the patch attached to this mail.  Sorry again.


        - Eero

I assume I had screwed something when I inlined it to my earlier mail. :-/


I've reverted the bisected commit, since it disables testing on master.

My fix is rather obvious, just moving few lines, to make sure loop is incremented every round, like it was before the bad commit.


     - Eero

Eero Tamminen <eero.t.tammi...@intel.com> writes:

Fixes: 9702fac68e (spirv: consider bitsize when handling OpSwitch cases)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104359
---
   src/compiler/spirv/vtn_cfg.c | 14 +++++++-------
   1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 9c4cbe2..3d5de37 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -549,19 +549,19 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct
list_head *cf_list,
               struct vtn_block *case_block =
                  vtn_value(b, *w, vtn_value_type_block)->block;

-            if (case_block == break_block)
-               continue;
-
-            vtn_assert(case_block->switch_case);
-
-            vtn_order_case(swtch, case_block->switch_case);
-
               if (bitsize <= 32) {
                  w += 2;
               } else {
                  assert(bitsize == 64);
                  w += 3;
               }
+
+            if (case_block == break_block)
+               continue;
+
+            vtn_assert(case_block->switch_case);
+
+            vtn_order_case(swtch, case_block->switch_case);
            }

            enum vtn_branch_type branch_type =
--
2.7.4
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev



_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


>From b4094813c55eddcb14bae712bf33d9d3ab8910d1 Mon Sep 17 00:00:00 2001
From: Eero Tamminen <eero.t.tammi...@intel.com>
Date: Thu, 21 Dec 2017 15:30:16 +0200
Subject: [PATCH] spirv: avoid infinite loop / freeze in vtn_cfg_walk_blocks()

Fixes: 9702fac68e (spirv: consider bitsize when handling OpSwitch cases)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104359
---
 src/compiler/spirv/vtn_cfg.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 9c4cbe2..3d5de37 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -549,19 +549,19 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct list_head *cf_list,
             struct vtn_block *case_block =
                vtn_value(b, *w, vtn_value_type_block)->block;
 
-            if (case_block == break_block)
-               continue;
-
-            vtn_assert(case_block->switch_case);
-
-            vtn_order_case(swtch, case_block->switch_case);
-
             if (bitsize <= 32) {
                w += 2;
             } else {
                assert(bitsize == 64);
                w += 3;
             }
+
+            if (case_block == break_block)
+               continue;
+
+            vtn_assert(case_block->switch_case);
+
+            vtn_order_case(swtch, case_block->switch_case);
          }
 
          enum vtn_branch_type branch_type =
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to