Hi,

On 08.05.2018 06:45, Matt Turner wrote:
On Mon, May 7, 2018 at 8:02 PM, Brian Paul <[email protected]> wrote:

I don't know when this started happening (I'll try bisecting tomorrow) but
we're seeing a crash in ast_type_qualifier::validate_in_qualifier() in -O3
builds with gcc 5.4.0 on Ubuntu 16.04.

Specifically, at ast_type.cpp:654:

    if ((this->flags.i & ~valid_in_mask.flags.i) != 0) {

It seems to be the ~ operator/function which is implemented with an SSE pxor
instruction.

I found that this patch avoids the issue:

diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h
index a1ec0d5..2e518ce 100644
--- a/src/compiler/glsl/ast.h
+++ b/src/compiler/glsl/ast.h
@@ -474,7 +474,7 @@ enum {

  struct ast_type_qualifier {
     DECLARE_RALLOC_CXX_OPERATORS(ast_type_qualifier);
-   DECLARE_BITSET_T(bitset_t, 128);
+   DECLARE_BITSET_T(bitset_t, 96);

     union flags {
        struct {

This probably prevents use of xmm instructions, but I haven't inspected the
code.

Is anyone else seeing this?

Yes, it's https://bugs.freedesktop.org/show_bug.cgi?id=105497

I was surprised that we decided it's not worth working around.

By making above part perform worse for everybody using -O3, or by
disabling vectorization optimization (enabled by -O3) just for
the buggy GCC version?

(If that GCC version gets it wrong in this place, it may get it
wrong also elsewhere, so better turn that particular -O3 optimization
off completely.)

Is there an upstream GCC bug report about that, which would tell
which GCC versions are affected?


        - Eero
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to