Re: [Mesa-dev] [PATCH] nir: Fix anonymous union initialization with older GCC.

2019-03-22 Thread Caio Marcelo de Oliveira Filho
On Fri, Mar 22, 2019 at 03:04:28AM +, Vinson Lee wrote:
> Fix this build error with GCC 4.4.7.
> 
>   CC nir/nir_opt_copy_prop_vars.lo
> nir/nir_opt_copy_prop_vars.c: In function ‘load_element_from_ssa_entry_value’:
> nir/nir_opt_copy_prop_vars.c:454: error: unknown field ‘ssa’ specified in 
> initializer
> nir/nir_opt_copy_prop_vars.c:455: error: unknown field ‘def’ specified in 
> initializer
> nir/nir_opt_copy_prop_vars.c:456: error: unknown field ‘component’ specified 
> in initializer
> nir/nir_opt_copy_prop_vars.c:456: error: extra brace group at end of 
> initializer
> nir/nir_opt_copy_prop_vars.c:456: error: (near initialization for 
> ‘(anonymous).’)
> nir/nir_opt_copy_prop_vars.c:456: warning: excess elements in union 
> initializer
> nir/nir_opt_copy_prop_vars.c:456: warning: (near initialization for 
> ‘(anonymous).’)
> 
> Fixes: 96c32d77763c ("nir/copy_prop_vars: handle load/store of vector 
> elements")
> Signed-off-by: Vinson Lee 
> ---
>  src/compiler/nir/nir_opt_copy_prop_vars.c |   10 ++
>  1 files changed, 6 insertions(+), 4 deletions(-)

This patch is 

Reviewed-by: Caio Marcelo de Oliveira Filho 


Please add the Bugzilla reference too

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109810


Thanks,
Caio



> diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c 
> b/src/compiler/nir/nir_opt_copy_prop_vars.c
> index 19003cc..94bc8af 100644
> --- a/src/compiler/nir/nir_opt_copy_prop_vars.c
> +++ b/src/compiler/nir/nir_opt_copy_prop_vars.c
> @@ -451,10 +451,12 @@ load_element_from_ssa_entry_value(struct 
> copy_prop_var_state *state,
>  
> *value = (struct value) {
>.is_ssa = true,
> -  .ssa = {
> - .def = { def },
> - .component = { 0 },
> -  },
> +  {
> + .ssa = {
> +   .def = { def },
> +   .component = { 0 },
> + },
> +  }
> };
>  
> return true;
> -- 
> 1.7.1
> 


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

Re: [Mesa-dev] [PATCH] nir: Fix anonymous union initialization with older GCC.

2019-03-22 Thread Andres Gomez
This is:

Reviewed-by: Andres Gomez 

On Fri, 2019-03-22 at 03:04 +, Vinson Lee wrote:
> Fix this build error with GCC 4.4.7.
> 
>   CC nir/nir_opt_copy_prop_vars.lo
> nir/nir_opt_copy_prop_vars.c: In function ‘load_element_from_ssa_entry_value’:
> nir/nir_opt_copy_prop_vars.c:454: error: unknown field ‘ssa’ specified in 
> initializer
> nir/nir_opt_copy_prop_vars.c:455: error: unknown field ‘def’ specified in 
> initializer
> nir/nir_opt_copy_prop_vars.c:456: error: unknown field ‘component’ specified 
> in initializer
> nir/nir_opt_copy_prop_vars.c:456: error: extra brace group at end of 
> initializer
> nir/nir_opt_copy_prop_vars.c:456: error: (near initialization for 
> ‘(anonymous).’)
> nir/nir_opt_copy_prop_vars.c:456: warning: excess elements in union 
> initializer
> nir/nir_opt_copy_prop_vars.c:456: warning: (near initialization for 
> ‘(anonymous).’)
> 
> Fixes: 96c32d77763c ("nir/copy_prop_vars: handle load/store of vector 
> elements")
> Signed-off-by: Vinson Lee 
> ---
>  src/compiler/nir/nir_opt_copy_prop_vars.c |   10 ++
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c 
> b/src/compiler/nir/nir_opt_copy_prop_vars.c
> index 19003cc..94bc8af 100644
> --- a/src/compiler/nir/nir_opt_copy_prop_vars.c
> +++ b/src/compiler/nir/nir_opt_copy_prop_vars.c
> @@ -451,10 +451,12 @@ load_element_from_ssa_entry_value(struct 
> copy_prop_var_state *state,
>  
> *value = (struct value) {
>.is_ssa = true,
> -  .ssa = {
> - .def = { def },
> - .component = { 0 },
> -  },
> +  {
> + .ssa = {
> +   .def = { def },
> +   .component = { 0 },
> + },
> +  }
> };
>  
> return true;
-- 
Br,

Andres

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

Re: [Mesa-dev] [PATCH] nir: Fix anonymous union initialization with older GCC.

2017-01-09 Thread Jason Ekstrand
Assuming it still builds on newer GCC,

Acked-by: Jason Ekstrand 

On Sun, Jan 8, 2017 at 9:26 AM, Vinson Lee  wrote:

> Fix this build error with GCC 4.4.7.
>
>   CC nir/nir_opt_copy_prop_vars.lo
> nir/nir_opt_copy_prop_vars.c: In function ‘copy_prop_vars_block’:
> nir/nir_opt_copy_prop_vars.c:765: error: unknown field ‘deref’ specified
> in initializer
> nir/nir_opt_copy_prop_vars.c:765: warning: missing braces around
> initializer
> nir/nir_opt_copy_prop_vars.c:765: warning: (near initialization for
> ‘(anonymous).’)
> nir/nir_opt_copy_prop_vars.c:765: warning: initialization from
> incompatible pointer type
>
> Fixes: 62332d139c8f ("nir: Add a local variable-based copy propagation
> pass")
> Signed-off-by: Vinson Lee 
> ---
>  src/compiler/nir/nir_opt_copy_prop_vars.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c
> b/src/compiler/nir/nir_opt_copy_prop_vars.c
> index 8c24cd7..7f17469 100644
> --- a/src/compiler/nir/nir_opt_copy_prop_vars.c
> +++ b/src/compiler/nir/nir_opt_copy_prop_vars.c
> @@ -762,7 +762,7 @@ copy_prop_vars_block(struct copy_prop_var_state *state,
>   } else {
>  value = (struct value) {
> .is_ssa = false,
> -   .deref = src,
> +   { .deref = src },
>  };
>   }
>
> --
> 1.7.1
>
> ___
> 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