Re: Offloading GSOC 2015

2015-03-11 Thread Thomas Schwinge
Hi! On Tue, 3 Mar 2015 16:16:21 +0100, guray ozen wrote: > I finished my master at Barcelona Supercomputing Center and i started > to do PhD. My master thesis code generation OpenMP 4.0 for GPU > accelerators. And i am still working on it. > > Last year i presented my research compiler MACC at I

Re: Undefined behavior due to 6.5.16.1p3

2015-03-11 Thread Robbert Krebbers
Dear Joseph, On 03/10/2015 11:01 PM, Joseph Myers wrote: and did "u.b.b2 = f (u.a);" instead of "u.b.b2 = u.a;", that would not be undefined (see 6.8.6.4 and GCC PR 43784). Thanks for the references, those are useful! But what about "long long" on 32 bits machines. For example: union { long

Re: Undefined behavior due to 6.5.16.1p3

2015-03-11 Thread Martin Sebor
On 03/11/2015 07:27 AM, Robbert Krebbers wrote: Dear Joseph, On 03/10/2015 11:01 PM, Joseph Myers wrote: and did "u.b.b2 = f (u.a);" instead of "u.b.b2 = u.a;", that would not be undefined (see 6.8.6.4 and GCC PR 43784). Thanks for the references, those are useful! But what about "long long"

Re: Undefined behavior due to 6.5.16.1p3

2015-03-11 Thread Vincent Lefevre
On 2015-03-11 14:27:25 +0100, Robbert Krebbers wrote: > But what about "long long" on 32 bits machines. For example: > > union { > long long a; > struct { char b1; long long b2; } b; > } u; > > Will GCC perform similar optimizations as for the case of big structs? I > tried to play around wit

Re: Undefined behavior due to 6.5.16.1p3

2015-03-11 Thread Vincent Lefevre
On 2015-03-11 17:11:55 +0100, Jakub Jelinek wrote: > On Wed, Mar 11, 2015 at 05:08:16PM +0100, Vincent Lefevre wrote: > > On 2015-03-11 14:27:25 +0100, Robbert Krebbers wrote: > > > But what about "long long" on 32 bits machines. For example: > > > > > > union { > > > long long a; > > > struct

Re: Undefined behavior due to 6.5.16.1p3

2015-03-11 Thread Jonathan Wakely
On 11 March 2015 at 16:11, Jakub Jelinek wrote: > There is some PR about it in our bugzilla, and the conclusion is that > it is both invalid (in C only one union member can be active at any time, > we as extension allow type punning through unions etc.) > and we really don't want to support it. I

Re: Undefined behavior due to 6.5.16.1p3

2015-03-11 Thread Jakub Jelinek
On Wed, Mar 11, 2015 at 05:31:01PM +0100, Vincent Lefevre wrote: > > (in C only one union member can be active at any time, > > we as extension allow type punning through unions etc.) > > I disagree that it is an extension. The standard does not say > that "one union member can be active at any ti

gcc-4.9-20150311 is now available

2015-03-11 Thread gccadmin
Snapshot gcc-4.9-20150311 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.9-20150311/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.9 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches

inline asm clobbers

2015-03-11 Thread David Wohlferd
Why does gcc allow you to specify clobbers using numbers: asm ("" : : "r" (var) : "0"); // i386: clobbers eax How is this better than using register names? This makes even less sense when you realize that (apparently) the indices of registers aren't fixed. Which means there is no way to kn

Re: Undefined behavior due to 6.5.16.1p3

2015-03-11 Thread Robbert Krebbers
On 03/11/2015 05:31 PM, Vincent Lefevre wrote: I disagree that it is an extension. The standard does not say that "one union member can be active at any time". The interpretation under which this is allowed in confirmed by Note 95 of 6.5.2.3p3. Effective types disallow to access a union member o

Re: inline asm clobbers

2015-03-11 Thread Ian Lance Taylor
On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd wrote: > > Why does gcc allow you to specify clobbers using numbers: > >asm ("" : : "r" (var) : "0"); // i386: clobbers eax > > How is this better than using register names? > > This makes even less sense when you realize that (apparently) the in

Re: inline asm clobbers

2015-03-11 Thread Paul_Koning
> On Mar 11, 2015, at 7:19 PM, Ian Lance Taylor wrote: > > On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd > wrote: >> >> Why does gcc allow you to specify clobbers using numbers: >> >> asm ("" : : "r" (var) : "0"); // i386: clobbers eax >> >> How is this better than using register names?

Re: inline asm clobbers

2015-03-11 Thread Ian Lance Taylor
On Wed, Mar 11, 2015 at 4:41 PM, wrote: > >> On Mar 11, 2015, at 7:19 PM, Ian Lance Taylor wrote: >> >> On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd >> wrote: >>> >>> Why does gcc allow you to specify clobbers using numbers: >>> >>> asm ("" : : "r" (var) : "0"); // i386: clobbers eax >>>

Re: inline asm clobbers

2015-03-11 Thread David Wohlferd
On 3/11/2015 4:19 PM, Ian Lance Taylor wrote: On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd wrote: Why does gcc allow you to specify clobbers using numbers: asm ("" : : "r" (var) : "0"); // i386: clobbers eax How is this better than using register names? This makes even less sense whe

Re: inline asm clobbers

2015-03-11 Thread David Wohlferd
On 3/11/2015 4:41 PM, paul_kon...@dell.com wrote: On Mar 11, 2015, at 7:19 PM, Ian Lance Taylor wrote: On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd wrote: Why does gcc allow you to specify clobbers using numbers: asm ("" : : "r" (var) : "0"); // i386: clobbers eax How is this better

Re: Undefined behavior due to 6.5.16.1p3

2015-03-11 Thread Joseph Myers
On Wed, 11 Mar 2015, Vincent Lefevre wrote: > BTW, the following is forbidden (and makes no sense), but is accepted > by GCC without a warning: > > int foo (void) > { > union { char a[8]; int b; } u = { .a = { 0 }, .b = 1 }; > return u.b; > } What constraint do you think forbids it? It look

Re: inline asm clobbers

2015-03-11 Thread Ian Lance Taylor
On Wed, Mar 11, 2015 at 5:51 PM, David Wohlferd wrote: > > The reason I believe the order can change is this comment from i386.h: > > /* Order in which to allocate registers. Each register must be >listed once, even those in FIXED_REGISTERS. List frame pointer >late and fixed registers l