Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-09-02 Thread Jason Merrill via Gcc-patches
On 8/27/20 6:19 AM, Richard Biener wrote: On Thu, 27 Aug 2020, Jakub Jelinek wrote: On Fri, Jul 31, 2020 at 04:28:05PM -0400, Jason Merrill via Gcc-patches wrote: On 7/31/20 6:06 AM, Jakub Jelinek wrote: On Fri, Jul 31, 2020 at 10:54:46AM +0100, Jonathan Wakely wrote: Does the standard requi

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-08-27 Thread Iain Buclaw via Gcc-patches
Excerpts from Jakub Jelinek's message of August 27, 2020 12:06 pm: > On Fri, Jul 31, 2020 at 04:28:05PM -0400, Jason Merrill via Gcc-patches wrote: >> On 7/31/20 6:06 AM, Jakub Jelinek wrote: >> > On Fri, Jul 31, 2020 at 10:54:46AM +0100, Jonathan Wakely wrote: >> > > > Does the standard require th

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-08-27 Thread Jonathan Wakely via Gcc-patches
On 27/08/20 13:17 +0200, Jakub Jelinek wrote: On Thu, Aug 27, 2020 at 12:06:59PM +0100, Jonathan Wakely wrote: On 27/08/20 12:46 +0200, Jakub Jelinek wrote: > On Thu, Aug 27, 2020 at 12:06:13PM +0200, Jakub Jelinek via Gcc-patches wrote: > > Oops, rewrote the testcase from __builtin_bit_cast to

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-08-27 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 27, 2020 at 12:06:59PM +0100, Jonathan Wakely wrote: > On 27/08/20 12:46 +0200, Jakub Jelinek wrote: > > On Thu, Aug 27, 2020 at 12:06:13PM +0200, Jakub Jelinek via Gcc-patches > > wrote: > > > > Oops, rewrote the testcase from __builtin_bit_cast to std::bit_cast without > > adjusting

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-08-27 Thread Jonathan Wakely via Gcc-patches
On 27/08/20 12:46 +0200, Jakub Jelinek wrote: On Thu, Aug 27, 2020 at 12:06:13PM +0200, Jakub Jelinek via Gcc-patches wrote: Oops, rewrote the testcase from __builtin_bit_cast to std::bit_cast without adjusting the syntax properly. Also, let's not use bitfields in there, as clang doesn't support

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-08-27 Thread Jonathan Wakely via Gcc-patches
On 27/08/20 12:06 +0200, Jakub Jelinek wrote: On Fri, Jul 31, 2020 at 04:28:05PM -0400, Jason Merrill via Gcc-patches wrote: On 7/31/20 6:06 AM, Jakub Jelinek wrote: > On Fri, Jul 31, 2020 at 10:54:46AM +0100, Jonathan Wakely wrote: > > > Does the standard require that somewhere? Because that i

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-08-27 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 27, 2020 at 12:06:13PM +0200, Jakub Jelinek via Gcc-patches wrote: Oops, rewrote the testcase from __builtin_bit_cast to std::bit_cast without adjusting the syntax properly. Also, let's not use bitfields in there, as clang doesn't support those. So, adjusted testcase below. clang++ re

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-08-27 Thread Richard Biener
On Thu, 27 Aug 2020, Jakub Jelinek wrote: > On Fri, Jul 31, 2020 at 04:28:05PM -0400, Jason Merrill via Gcc-patches wrote: > > On 7/31/20 6:06 AM, Jakub Jelinek wrote: > > > On Fri, Jul 31, 2020 at 10:54:46AM +0100, Jonathan Wakely wrote: > > > > > Does the standard require that somewhere? Becaus

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-08-27 Thread Jakub Jelinek via Gcc-patches
On Fri, Jul 31, 2020 at 04:28:05PM -0400, Jason Merrill via Gcc-patches wrote: > On 7/31/20 6:06 AM, Jakub Jelinek wrote: > > On Fri, Jul 31, 2020 at 10:54:46AM +0100, Jonathan Wakely wrote: > > > > Does the standard require that somewhere? Because that is not what the > > > > compiler implements

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-31 Thread Jason Merrill via Gcc-patches
On 7/31/20 6:06 AM, Jakub Jelinek wrote: On Fri, Jul 31, 2020 at 10:54:46AM +0100, Jonathan Wakely wrote: Does the standard require that somewhere? Because that is not what the compiler implements right now. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78620 But does that imply that all CON

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-31 Thread Jakub Jelinek via Gcc-patches
On Fri, Jul 31, 2020 at 10:54:46AM +0100, Jonathan Wakely wrote: > > Does the standard require that somewhere? Because that is not what the > > compiler implements right now. > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78620 Ah, ok. But does that imply that all CONSTRUCTORs without CONSTRUC

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-31 Thread Jonathan Wakely via Gcc-patches
On 31/07/20 10:19 +0200, Jakub Jelinek wrote: On Thu, Jul 30, 2020 at 05:59:18PM -0400, Jason Merrill via Gcc-patches wrote: > Even if we are guaranteed that (what guarantees it?) when __builtin_bit_cast > is constexpr evaluated no initializer will be omitted if may be value initialized > to so

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-31 Thread Jakub Jelinek via Gcc-patches
On Thu, Jul 30, 2020 at 05:59:18PM -0400, Jason Merrill via Gcc-patches wrote: > > Even if we are guaranteed that (what guarantees it?) when __builtin_bit_cast > > is constexpr evaluated no initializer will be omitted if may be value > > initialized > > to something other than all zeros, > > This

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-30 Thread Jason Merrill via Gcc-patches
On 7/30/20 10:57 AM, Jakub Jelinek wrote: On Thu, Jul 30, 2020 at 10:16:46AM -0400, Jason Merrill wrote: It checks the various std::bit_cast requirements, when not constexpr evaluated acts pretty much like VIEW_CONVERT_EXPR of the source argument to the destination type and the hardest part is o

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-30 Thread Jakub Jelinek via Gcc-patches
On Thu, Jul 30, 2020 at 10:16:46AM -0400, Jason Merrill wrote: > > It checks the various std::bit_cast requirements, when not constexpr > > evaluated acts pretty much like VIEW_CONVERT_EXPR of the source argument > > to the destination type and the hardest part is obviously the constexpr > > evalua

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-30 Thread Jason Merrill via Gcc-patches
On 7/18/20 2:50 PM, Jakub Jelinek wrote: Hi! The following patch adds __builtin_bit_cast builtin, similarly to clang or MSVC which implement std::bit_cast using such an builtin too. Great! It checks the various std::bit_cast requirements, when not constexpr evaluated acts pretty much like VI

Re: [PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-22 Thread Paul Koning via Gcc-patches
> On Jul 18, 2020, at 2:50 PM, Jakub Jelinek via Gcc-patches > wrote: > > Hi! > > The following patch adds __builtin_bit_cast builtin, similarly to > clang or MSVC which implement std::bit_cast using such an builtin too. > It checks the various std::bit_cast requirements, when not constexpr

[PATCH] c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]

2020-07-18 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch adds __builtin_bit_cast builtin, similarly to clang or MSVC which implement std::bit_cast using such an builtin too. It checks the various std::bit_cast requirements, when not constexpr evaluated acts pretty much like VIEW_CONVERT_EXPR of the source argument to the destinat