https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83252

            Bug ID: 83252
           Summary: Wrong code with "-march=skylake-avx512 -O3"
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: babokin at gmail dot com
  Target Milestone: ---

Created attachment 42775
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42775&action=edit
reproducer

gcc trunk rev255248, x86_64.

Attached test case produces wrong code:
> g++ -O0 f.cpp -o out
> g++ -march=skylake-avx512 -O3 f.cpp -o out3
> ./out
88480289
> ./out3
88480288

I was not able to reduce it further. At this point the test case doesn't
contain undefined behavior (at least address and undefined behavior sanitizers
think so). Original test case didn't have undefined behavior guaranteed by the
way it was generated, but while reduction it could be possibly introduced, but
to my judgement it's a valid test case without UB.

Note that to reproduce it's essential to compile with "-march=skylake-avx512
-O3".

Sadly, gcc doesn't provide any bug pointing functionality, which would help
understanding the root cause of the bug without digging into compiler
internals. icc and clang have triaging flags (see
https://llvm.org/docs/OptBisect.html for clang implementation of this
mechanism). It would be very helpful to have similar functionality in gcc. If
I'm missing something, I would appreciate pointers to documents describing how
to triage this kind of bugs in gcc.

Reply via email to