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

            Bug ID: 93811
           Summary: __builtin___clear_cache() is a noop on powerpc (which
                    is incorrect)
           Product: gcc
           Version: 7.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anton at mips dot complang.tuwien.ac.at
  Target Milestone: ---
              Host: powerpc64-unknown-linux-gnu
            Target: powerpc64-unknown-linux-gnu
             Build: powerpc64-unknown-linux-gnu

Created attachment 47869
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47869&action=edit
source code for demonstrating the bug

A call to __builtin___clear_cache() results in no code being generated.  This
can lead to stale I-cache contents on at least the PPC970 and the PPC7447A (I
have seen breakage from this bug on these CPUs).  This bug is present in at
least gcc-4.3.2, gcc-5.5.0, and gcc-7.5.0.  Given that it has not been fixed
for such a long time, it probably is still present in gcc-9 (which I could not
test for other reasons).

You can find a working implementation of a similar function at
<http://git.savannah.gnu.org/cgit/gforth.git/tree/arch/power/_sync_cache_range.c>

Reply via email to