[llvm] r342637 - [ADT] Try again to use the same version of llvm::Optional on all compilers

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 25 05:10:30 PDT 2018


Sorry, it seems even after the follow-ups, GCC still has problems with this.

In Chromium, all our tip-of-tree Linux builders, which build Clang
with GCC 4.8.4, started failing due to this
(https://crbug.com/888061).

I've reverted in r342966.

On Thu, Sep 20, 2018 at 12:02 PM, Benjamin Kramer via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: d0k
> Date: Thu Sep 20 03:02:06 2018
> New Revision: 342637
>
> URL: http://llvm.org/viewvc/llvm-project?rev=342637&view=rev
> Log:
> [ADT] Try again to use the same version of llvm::Optional on all compilers
>
> The miscompile doesn't reproduce for me anymore with GCC 7.3. I'll watch
> the buildbots closely.
>
> Having different versions of Optional is an ABI violation when linking
> GCC- and clang-built code together.
>
> Modified:
>     llvm/trunk/include/llvm/ADT/Optional.h
>
> Modified: llvm/trunk/include/llvm/ADT/Optional.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Optional.h?rev=342637&r1=342636&r2=342637&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/ADT/Optional.h (original)
> +++ llvm/trunk/include/llvm/ADT/Optional.h Thu Sep 20 03:02:06 2018
> @@ -108,7 +108,6 @@ template <typename T, bool IsPodLike> st
>    }
>  };
>
> -#if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this.
>  /// Storage for trivially copyable types only.
>  template <typename T> struct OptionalStorage<T, true> {
>    AlignedCharArrayUnion<T> storage;
> @@ -125,7 +124,6 @@ template <typename T> struct OptionalSto
>
>    void reset() { hasVal = false; }
>  };
> -#endif
>  } // namespace optional_detail
>
>  template <typename T> class Optional {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list