Re: Manipulating bit fields is behaving inconsistently

2016-02-19 Thread Richard Biener
On Thu, Feb 18, 2016 at 5:31 PM, Wink Saville wrote: > You've convinced me that this isn't a bug, but I assume you'd agree > its weird at best. I tested it with clang and it works as I'd expect: > > $ make > clang -x c -m64 -O3 -Wall -o test.o -c test.c > objdump -d test.o > test.txt > clang -m64

Re: How to efficiently unpack 8 bytes from a 64-bit integer?

2016-02-19 Thread Richard Biener
On Fri, Feb 19, 2016 at 7:24 AM, Phil Ruffwind wrote: > Hello all, > > I am trying to analyze the optimized results of following code. The > intent is to unpack a 64-bit integer into a struct containing eight > 8-bit integers. The optimized result was very promising at first, but > I then discov

Re: How to efficiently unpack 8 bytes from a 64-bit integer?

2016-02-19 Thread Phil Ruffwind
I tried to look for a workaround for this. It seemed that using a union instead of memcpy was enough to convince GCC to optimize into a single "mov". struct alpha unpack(uint64_t x) { union { struct alpha r; uint64_t i; } u; u.i = x;

Re: How to efficiently unpack 8 bytes from a 64-bit integer?

2016-02-19 Thread Richard Biener
On Fri, Feb 19, 2016 at 10:44 AM, Phil Ruffwind wrote: > I tried to look for a workaround for this. It seemed that using a > union instead of memcpy was enough to convince GCC to optimize into a > single "mov". > > struct alpha unpack(uint64_t x) > { > union { > struct

Re: How to efficiently unpack 8 bytes from a 64-bit integer?

2016-02-19 Thread Phil Ruffwind
> Can you please open a bugreport? Done: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69871

Re: Manipulating bit fields is behaving inconsistently

2016-02-19 Thread Richard Biener
On Fri, Feb 19, 2016 at 12:14 PM, Wink Saville wrote: > Can you point me to previous discussions, or maybe some search terms? I'm > curious about the rationale for the odd behavior. I don't remember discussions about a specific decision how to implement the GCC extension but I remember when fixin

Re: Manipulating bit fields is behaving inconsistently

2016-02-19 Thread Wink Saville
What is the process for a patch with a new option to allow a different behavior?

Re: Manipulating bit fields is behaving inconsistently

2016-02-19 Thread Richard Biener
On Fri, Feb 19, 2016 at 12:43 PM, Wink Saville wrote: > What is the process for a patch with a new option to allow a different > behavior? Write one (with testcases), test it and then post it here for review. Richard.

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-19 Thread Michael Matz
Hi, On Thu, 18 Feb 2016, Richard Smith wrote: > >> An empty type is a type where it and all of its subobjects > >> (recursively) are of class, structure, union, or array type. No > >> memory slot nor register should be used to pass or return an object > >> of empty type. > > > > The trivially

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-19 Thread Michael Matz
Hi, On Thu, 18 Feb 2016, H.J. Lu wrote: > >> An empty type is a type where it and all of its subobjects > >> (recursively) are of class, structure, union, or array type. No > >> memory slot nor register should be used to pass or return an object > >> of empty type. > > > > The trivially copya

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-19 Thread H.J. Lu
On Fri, Feb 19, 2016 at 5:35 AM, Michael Matz wrote: > Hi, > > On Thu, 18 Feb 2016, Richard Smith wrote: > >> >> An empty type is a type where it and all of its subobjects >> >> (recursively) are of class, structure, union, or array type. No >> >> memory slot nor register should be used to pass o

Re: Manipulating bit fields is behaving inconsistently

2016-02-19 Thread Joseph Myers
See the references I gave in . -- Joseph S. Myers jos...@codesourcery.com

How to use _Generic with bit-fields

2016-02-19 Thread Wink Saville
I'm using gcc 5.3.0: $ gcc --version gcc (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. And I've tried to use _Generic to print th

Re: Manipulating bit fields is behaving inconsistently

2016-02-19 Thread Wink Saville
The two links in msg00156.html point to single emails and the formatting is odd, such as in 13560.txt: i =3D =5FGeneric(st.bf, Is there a way to look at the actual email thread using a browser or some other means? On Fri, Feb 19, 2016 at 9:30 AM, Joseph Myers wrote: > See the references I ga

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-19 Thread Matthijs van Duin
On 19 February 2016 at 16:27, H.J. Lu wrote: > We want to include static member functions and exclude non-static member > functions. There's no reason to disallow non-static member functions in general; they have no impact on being trivially copyable or not, only the presence of a non-trivial cop

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-19 Thread Matthijs van Duin
On 19 February 2016 at 14:35, Michael Matz wrote: > struct S { > S() {something();} > }; > > would be an empty type, and that's not what we want. Why not? The default constructor is never invoked as part of passing such an object around. Its copy constructor is a nop and requires no reference t

Re: Need suggestion about bug 68425

2016-02-19 Thread David Malcolm
On Thu, 2016-02-18 at 14:28 +, Manuel López-Ibáñez wrote: > On 18/02/16 11:40, Prasad Ghangal wrote: > > Wouldn't it be nice instead of multiple warnings if gcc gives > > single > > warning like : > > > > 68425.c:3:34: warning: excess elements in array initializer (6 > > elements, expected 2)

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-19 Thread H.J. Lu
On Fri, Feb 19, 2016 at 11:03 AM, Matthijs van Duin wrote: > On 19 February 2016 at 14:35, Michael Matz wrote: >> struct S { >> S() {something();} >> }; >> >> would be an empty type, and that's not what we want. > > Why not? The default constructor is never invoked as part of passing > such an

Re: Need suggestion about bug 68425

2016-02-19 Thread Manuel López-Ibáñez
On 19 February 2016 at 19:13, David Malcolm wrote: >> 68425.c:3:34: warning: excess elements in array initializer (6 >> elements, >> expected 2) >>const int array[2] = { 1, 2, 3 ,6 ,89 ,193}; >> ^ > > Yes, that would be ideal. Unfortunately,

Re: gnu-gabi group

2016-02-19 Thread H.J. Lu
On Mon, Feb 15, 2016 at 10:20 AM, Jose E. Marchesi wrote: > > > Great. I'll ask overseers to create a mailinglist. [...] > > Done [1] [2]. If y'all need a wiki too, just ask. > > [1] gnu-g...@sourceware.org > [2] https://sourceware.org/ml/gnu-gabi/ > > The link to the "GNU GABI pr

Re: gnu-gabi group

2016-02-19 Thread Markus Trippelsdorf
On 2016.02.19 at 12:57 -0800, H.J. Lu wrote: > On Mon, Feb 15, 2016 at 10:20 AM, Jose E. Marchesi > wrote: > > > > > Great. I'll ask overseers to create a mailinglist. [...] > > > > Done [1] [2]. If y'all need a wiki too, just ask. > > > > [1] gnu-g...@sourceware.org > > [2] https

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-19 Thread Richard Smith
On Fri, Feb 19, 2016 at 5:35 AM, Michael Matz wrote: > Hi, > > On Thu, 18 Feb 2016, Richard Smith wrote: > >> >> An empty type is a type where it and all of its subobjects >> >> (recursively) are of class, structure, union, or array type. No >> >> memory slot nor register should be used to pass o

Re: gnu-gabi group

2016-02-19 Thread Mark Wielaard
On Fri, Feb 19, 2016 at 12:57:34PM -0800, H.J. Lu wrote: > How do I subscribe gnu-abi mailing list? The project page just > points to the mailing list archive. There is no option to subscribe > it. To subscribe sent email to gnu-abi-subscr...@sourceware.org Or use the subscribe form at https://s

Re: How to use _Generic with bit-fields

2016-02-19 Thread Martin Sebor
On 02/19/2016 11:25 AM, Wink Saville wrote: I'm using gcc 5.3.0: $ gcc --version gcc (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

Re: gnu-gabi group

2016-02-19 Thread H.J. Lu
On Fri, Feb 19, 2016 at 1:00 PM, Markus Trippelsdorf wrote: > On 2016.02.19 at 12:57 -0800, H.J. Lu wrote: >> On Mon, Feb 15, 2016 at 10:20 AM, Jose E. Marchesi >> wrote: >> > >> > > Great. I'll ask overseers to create a mailinglist. [...] >> > >> > Done [1] [2]. If y'all need a wiki too

Re: gnu-gabi group

2016-02-19 Thread H.J. Lu
On Fri, Feb 19, 2016 at 1:16 PM, Mark Wielaard wrote: > On Fri, Feb 19, 2016 at 12:57:34PM -0800, H.J. Lu wrote: >> How do I subscribe gnu-abi mailing list? The project page just >> points to the mailing list archive. There is no option to subscribe >> it. > > To subscribe sent email to gnu-abi-

Re: gnu-gabi group

2016-02-19 Thread Ian Lance Taylor
On Fri, Feb 19, 2016 at 1:16 PM, Mark Wielaard wrote: > On Fri, Feb 19, 2016 at 12:57:34PM -0800, H.J. Lu wrote: >> How do I subscribe gnu-abi mailing list? The project page just >> points to the mailing list archive. There is no option to subscribe >> it. > > To subscribe sent email to gnu-abi-

Re: How to use _Generic with bit-fields

2016-02-19 Thread Joseph Myers
On Fri, 19 Feb 2016, Wink Saville wrote: > And I've tried to use _Generic to print the type of a bit field but > the compiler fails with: Indeed, bit-field types cannot match any type name, only default. The only conversions applied to the controlling expression are those involved in lvalue to

Re: Manipulating bit fields is behaving inconsistently

2016-02-19 Thread Joseph Myers
On Fri, 19 Feb 2016, Wink Saville wrote: > The two links in msg00156.html point to single emails and the > formatting is odd, such as in 13560.txt: > > i =3D =5FGeneric(st.bf, > > Is there a way to look at the actual email thread using a browser or > some other means? I'm not aware of any WG1

Re: [isocpp-parallel] Proposal for new memory_order_consume definition

2016-02-19 Thread Tony V E
There's at least one easy answer in there: > ‎If implementations must support annotation, what form should that annotation take?  P0190R0 recommends the [[carries_dependency]] attribute, but I am not picky as long as it can be (1) applied to all relevant pointer-like object