Control: tags 995393 patch

Frédéric Bonnard wrote...

>  #ifdef HAVE_OPENAT
> +#if defined(__powerpc__) && defined(__powerpc64__) && __BYTE_ORDER__ == 
> __ORDER_LITTLE_ENDIAN__
> +static int openat(int dir_fd, const char *pathname, int flags, ...)
> +#else
>  int openat(int dir_fd, const char *pathname, int flags, ...)
> +#endif

Well, that makes openat a private function - the idea however is to
provide a publicly visible function. Also, if I read the objdump output
correctly, the compiler will happily inline the function then as there
is just one usage.

> Hoping you'll get more ideas on this

After digging into this for quite a few hours, this really smells like a
bug in the optimizer but I'm not keen on spending a lot of time on a
reproducer and taking it to gcc upstream.

As a workaround I propose a tactical __attribute__ to locally disable
optimization as this issue has been blocking eatmydata for way too long,
and performance loss should be neglectable.

Status: Works on the porterbox.

Cheers,

    Christoph

 #ifdef HAVE_OPENAT
-int openat(int dir_fd, const char *pathname, int flags, ...)
+int
+#if HAVE_OPENAT && defined(__powerpc__) && defined(__powerpc64__) && 
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+__attribute__((optimize("O0")))
+#endif
+openat(int dir_fd, const char *pathname, int flags, ...)

Attachment: signature.asc
Description: PGP signature

Reply via email to