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

            Bug ID: 71614
           Summary: ppc __gcc_qmul is mis-optimized not to be commutative
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: timshen at gcc dot gnu.org
  Target Milestone: ---

Created attachment 38741
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38741&action=edit
reduced c file

The libgcc __gcc_qmul seems to be miscompiled. Suppose the attached file is
a.c, compiling it with -O1 gives:
% ~/sandbox/bin/powerpc64le-linux-gnu-gcc -O1 -static b.c && ./a.out
4059dd231dd95f2a 3cff6dea3a4b2648
4059dd231dd95f2a 3cff6dea3a4b2648

-O2 gives:
% ~/sandbox/bin/powerpc64le-linux-gnu-gcc -O2 -static b.c && ./a.out
4059dd231dd95f2a 3cff6dea3a4b2648
4059dd231dd95f2a 3cff6dea3a4b2646

Reply via email to