ac: fix build error in si_shader

Submitted by Mauro Rossi on Jan. 12, 2018, 2:47 p.m.

Details

Message ID 20180112144734.8426-1-issor.oruam@gmail.com
State New
Headers show
Series "ac: fix build error in si_shader" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Mauro Rossi Jan. 12, 2018, 2:47 p.m.
assert() is replaced by unreachable(), to avoid following building error:

external/mesa/src/gallium/drivers/radeonsi/si_shader.c:1967:1:
error: control may reach end of non-void function [-Werror,-Wreturn-type]
}
^
1 error generated.

Fixes: c797cd6 ("ac: add load_patch_vertices_in() to the abi")
---
 src/gallium/drivers/radeonsi/si_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index dd635ae203..8439d09ffc 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1963,7 +1963,7 @@  static LLVMValueRef si_load_patch_vertices_in(struct ac_shader_abi *abi)
 	else if (ctx->type == PIPE_SHADER_TESS_EVAL)
 		return get_num_tcs_out_vertices(ctx);
 	else
-		assert(!"invalid shader stage for TGSI_SEMANTIC_VERTICESIN");
+		unreachable(!"invalid shader stage for TGSI_SEMANTIC_VERTICESIN");
 }
 
 void si_load_system_value(struct si_shader_context *ctx,

Comments

On Fri, Jan 12, 2018 at 3:47 PM, Mauro Rossi <issor.oruam@gmail.com> wrote:
> assert() is replaced by unreachable(), to avoid following building error:
>
> external/mesa/src/gallium/drivers/radeonsi/si_shader.c:1967:1:
> error: control may reach end of non-void function [-Werror,-Wreturn-type]
> }
> ^
> 1 error generated.
>
> Fixes: c797cd6 ("ac: add load_patch_vertices_in() to the abi")
> ---
>  src/gallium/drivers/radeonsi/si_shader.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index dd635ae203..8439d09ffc 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -1963,7 +1963,7 @@ static LLVMValueRef si_load_patch_vertices_in(struct ac_shader_abi *abi)
>         else if (ctx->type == PIPE_SHADER_TESS_EVAL)
>                 return get_num_tcs_out_vertices(ctx);
>         else
> -               assert(!"invalid shader stage for TGSI_SEMANTIC_VERTICESIN");
> +               unreachable(!"invalid shader stage for TGSI_SEMANTIC_VERTICESIN");

You don't need the negation anymore with unreachable. With that fixed,

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>

>  }
>
>  void si_load_system_value(struct si_shader_context *ctx,
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Pushed. Thanks!

On 13/01/18 01:47, Mauro Rossi wrote:
> assert() is replaced by unreachable(), to avoid following building error:
> 
> external/mesa/src/gallium/drivers/radeonsi/si_shader.c:1967:1:
> error: control may reach end of non-void function [-Werror,-Wreturn-type]
> }
> ^
> 1 error generated.
> 
> Fixes: c797cd6 ("ac: add load_patch_vertices_in() to the abi")
> ---
>   src/gallium/drivers/radeonsi/si_shader.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index dd635ae203..8439d09ffc 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -1963,7 +1963,7 @@ static LLVMValueRef si_load_patch_vertices_in(struct ac_shader_abi *abi)
>   	else if (ctx->type == PIPE_SHADER_TESS_EVAL)
>   		return get_num_tcs_out_vertices(ctx);
>   	else
> -		assert(!"invalid shader stage for TGSI_SEMANTIC_VERTICESIN");
> +		unreachable(!"invalid shader stage for TGSI_SEMANTIC_VERTICESIN");
>   }
>   
>   void si_load_system_value(struct si_shader_context *ctx,
>