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

2016-02-18 Thread Phil Ruffwind
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 discovered that whenever the unpacking function gets inlined into anothe

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

2016-02-18 Thread Richard Smith
On Thu, Feb 18, 2016 at 6:35 AM, Michael Matz wrote: > Hi, > > On Tue, 16 Feb 2016, H.J. Lu wrote: > >> Here is the new definition: >> >> 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 shoul

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

2016-02-18 Thread H.J. Lu
On Thu, Feb 18, 2016 at 6:35 AM, Michael Matz wrote: > Hi, > > On Tue, 16 Feb 2016, H.J. Lu wrote: > >> Here is the new definition: >> >> 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 shoul

Re: Manipulating bit fields is behaving inconsistently

2016-02-18 Thread Wink Saville
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 -O3 -Wall test.o -o test wink@wink-desktop:~/prgs/large_fields_are_

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

2016-02-18 Thread Michael Matz
Hi, On Tue, 16 Feb 2016, H.J. Lu wrote: > Here is the new definition: > > 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 triv

Re: Need suggestion about bug 68425

2016-02-18 Thread Manuel López-Ibáñez
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) const int array[2] = { 1, 2, 3 ,6 ,89 ,193};

Re: Help with building MEM_REF node

2016-02-18 Thread Richard Biener
On Wed, Feb 17, 2016 at 5:27 PM, Cristina Georgiana Opriceana wrote: > Hello, > > I inserted a new local var decl in gimple, a pointer which is > malloc'ed and now I am trying to read/write in that memory. > > int *mumu; > mumu = malloc ( 40 * sizeof (int)); > mumu[1] = 10; > > The following state

Need suggestion about bug 68425

2016-02-18 Thread Prasad Ghangal
I was looking at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68425 For testcase const int array[2] = { 1, 2, 3 ,6 ,89 ,193}; gcc 6.0.0 produces warnings like (spacing may get disturbed by gmail) : 68425.c: In function ‘main’: 68425.c:3:34: warning: excess elements in array initializer

Re: Manipulating bit fields is behaving inconsistently

2016-02-18 Thread Bernd Edlinger
Hi, > struct fields { > long long unsigned f0:12; > long long unsigned f1:52; > } __attribute__((__packed__)); the C99 standard ISO/IEC 9899 forbids this type: 6.7.2.1 Structure and union specifiers 4 A bit-field shall have a type that is a qualified or unqualified version of _Bool, signed