[Mesa-dev] [PATCH mesa] util: use *unsigned* ints for bit operations

Mathias Fröhlich Mathias.Froehlich at gmx.net
Fri Nov 2 07:15:32 UTC 2018


Hi,

On Friday, 2 November 2018 06:22:13 CET Dave Airlie wrote:
> On Tue, 23 Oct 2018 at 10:57, Eric Anholt <eric at anholt.net> wrote:
> >
> > Eric Engestrom <eric.engestrom at intel.com> writes:
> >
> > > Fixes errors thrown by GCC's Undefined Behaviour sanitizer (ubsan) every
> > > time this macro is used.
> 
> This seems to be causing problems for me here on gcc8 (8.0.1 and
> 8.2.1) in Fedora 28.
> 
> ./bin/texelFetch fs usampler2DMS 2
> 
> is failing here with:
> Failed to compile fragment shader: 0:6(1): error: invalid input layout
> qualifier used
> 
> gcc is probably broken, but we might want to revert his from the tree
> and upcoming release until we can figure it out.

I have been experiencing something similar on fedora 28.

The observation is that gcc-8.2.1-3 works correct and gcc-8.2.1-4 does
show this problem. So for myself I have been nailing down the rpm version
of the gcc packet not to update. That helps as first aid but is not exactly nice.

There is now also a reduced source that does not require a full mesa compile
to ease a bug report. The file is attached here. You need -O2 to make it fail.

Before filing a bug report at gcc I wanted to verify that we are not doing anything
wrong like with aliasing for example. Which is the reason the bug is not filed yet.

Now, I don't find time to put more work into that at the weekend and
probably also not next week. So if anybody of you wants accelerate the process,
double checks that we don't do something wrong and hand that over to gcc
I would not mind!

There is also an observation that the new gcc rpm includes the fix for gcc
bug 87137 that actually turns out to be a bitfield layouting problem.
If fedora wants to experiment with a fedora only fix its probably a good
starting point to check if omitting the corresponding patch for bug 87137
does actually help on linux. Well that is pure speculation from my side.

... so far the dump from my side on that problem.

best

Mathias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-bug.cpp
Type: text/x-c++src
Size: 5056 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181102/ae1ce1a1/attachment.cpp>


More information about the mesa-dev mailing list