Red color cast on all raw files when compiled with gcc-10.1.0

Issue #82 resolved
Daniel Catalina created an issue

I have a strange issue with the Windows builds I create myself following the instructions from Rawpedia: https://rawpedia.rawtherapee.com/Windows#Clone_and_build_RawTherapee

Basically, after I open a RAW file (does not matter from wich camera) it is shown having a red color cast that does not go away no matter what I do. Even using the ‘neutral’ processing profile on an image is causing this.

I’ve attached the AboutThisBuild.txt and a screenshot.

This does not happen with the builds from: https://keybase.pub/gaaned92/ART-W64NightlyBuilds/ (I tried with ART_master_1.3-22-g971578cc1_W64_Skylake_200510).

The one major difference between the build that works fine and the one that does not seems to be the gcc version:

  • with Compiler: gcc 9.3.0 all is good
  • with Compiler: gcc 10.1.0 the behavior described above can be observed.

I will try to see if I can also use gcc-9 now that I updated MSYS to check if this is really the problem.

Comments (24)

  1. Daniel Catalina reporter

    It is definitely something caused by the MSYS2 update as I am experiencing the same with rawtherapee:

    • build done on Sat, 09 May 2020 10:11:35 with gcc-9.3.0 is fine
    • build done today with gcc-10.1.0 is not OK, as soon as a picture is opened and a profile applied (no matter if it is the default or neutral) the picture gets a red cast that does not go away.

    @agriggio @Gaaned92 did you already updated MSYS2 to gcc-10 and get similar problems?

  2. Gaaned92

    I just did the GCC upgrade to 10.1 and surely it is broken. So I quickly went back to 9.3.

    I don’t know what to do to track the bug.

    Due to problems, I also keep cmake 3.15.6-1 and libjpeg-turbo 1.5.3-1

  3. Daniel Catalina reporter

    Thank you for the feedback. I will have a look at the release notes for gcc to see if I can spot something that changed there and could influence this.

    In the meanwhile, maybe a hint on art wiki/rawpedia will be good to not update to gcc-10.1 until we figure out what the problem is…

  4. Daniel Catalina reporter

    From the link @Gaaned92 posted above:

    Bisecting showed that it's caused by -ftree-loop-vectorize. Imho it's a bug in gcc 10. I reverted to gcc 9.3...

  5. Daniel Catalina reporter

    Just a summary of the investigations done in rawtherapee thread:

    • it is now confirmed that -fno-tree-loop-vectorize is the culprit
    • not yet sure if this is a bug in rawtherapee code, or a place where the code does not conform the specs somehow, or a gcc-10.1.0 bug

    I’ve also compiled darktable with gcc-10.1.0 and it does not have this problem. I did not checked until now if it uses the offending optimization option yet…

  6. Sebastien Guyader

    How can one disable the -fno-tree-loop-vectorize flag? Would it impair performance significantly?

    I downgraded GCC to the previous (9.6 I think) to be able to build and use ART, but then I encountered problems some troubles on my system for some kernel modules that can’t build with anymore with the older GCC.

  7. agriggio repo owner

    just add -fno-tree-loop-vectorize to CMAKE_CXX_FLAGS in CMakeCache.txt

    I doubt you will notice any performance problem in normal use, most critical loops are already hand-vectorized with explicit SSE instructions (thanks mostly to ingo 🙂

  8. agriggio repo owner

    I’ve just added some detection code to the build system, so that -fno-tree-loop-vectorize is automatically used for gcc >= 10.1. Can you please test whether it works? Thanks!

  9. Sebastien Guyader

    @agriggio I tried your last cmake change, and it works: the GCC version is correctly detected, and the correct flag added.

  10. agriggio repo owner

    doesn’t look like a fix to me, but just some confirmation that this is likely a compiler bug. Better play safe and keep the optimization off

  11. Daniel Catalina reporter

    You are of course right. I was just to fast and hopeful that the problem is now fixed 🙂

  12. Daniel Catalina reporter

    Looks like it is already fixed yesterday. However msys is not yet updated so I cannot test the fix.

  13. Daniel Catalina reporter

    @agriggio Finally MSYS updated the gcc version and I confirm that with gcc-10.2.0 the problem is fixed. I guess we can change the check in cmake to only account and disable the optimization for gcc-10.1.x

  14. Log in to comment