[Mesa-stable] [PATCH] glsl: change ast_type_qualifier bitset size to work around GCC 5.4 bug

Juan A. Suarez Romero jasuarez at igalia.com
Wed May 9 09:25:32 UTC 2018


On Tue, 2018-05-08 at 08:43 -0600, Brian Paul wrote:
> Change the size of the bitset from 128 bits to 96.  This works around an
> apparent GCC 5.4 bug in which bad SSE code is generated, leading to a
> crash in ast_type_qualifier::validate_in_qualifier() (ast_type.cpp:654).
> 
> This can be repro'd with the Piglit test tests/spec/glsl-1.50/execution/
> varying-struct-basic-gs-fs.shader_test
> 


The bitset_t field was introduced in commit ba79a90fb52 ("glsl: Switch
ast_type_qualifier to a 128-bit bitset."), which is not part of the current 18.0
 release.

So two options here: enqueue this commit and ba79a90fb52 for next 18.0 releases,
or just reject this commit for 18.0, as it doesn't make sense without the other
one.


For now, I'll reject it. But if you think this and ba79a90fb52 should be
included, don't hesitate to tell me.

Thanks,


	J.A.

> Bugzilla:https://bugs.freedesktop.org/show_bug.cgi?id=105497
> Cc: mesa-stable at lists.freedesktop.org
> ---
>  src/compiler/glsl/ast.h | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h
> index a1ec0d5..9b88ff5 100644
> --- a/src/compiler/glsl/ast.h
> +++ b/src/compiler/glsl/ast.h
> @@ -474,7 +474,13 @@ enum {
>  
>  struct ast_type_qualifier {
>     DECLARE_RALLOC_CXX_OPERATORS(ast_type_qualifier);
> -   DECLARE_BITSET_T(bitset_t, 128);
> +   /* Note: this bitset needs to have at least as many bits as the 'q'
> +    * struct has flags, below.  Previously, the size was 128 instead of 96.
> +    * But an apparent bug in GCC 5.4.0 causes bad SSE code generation
> +    * elsewhere, leading to a crash.  96 bits works around the issue.
> +    * See https://bugs.freedesktop.org/show_bug.cgi?id=105497
> +    */
> +   DECLARE_BITSET_T(bitset_t, 96);
>  
>     union flags {
>        struct {


More information about the mesa-stable mailing list