Re: Add uninitialized attribute?

2010-08-21 Thread Florian Weimer
* H. J. Lu: > Sometime I have to do > > int x = 0; > > to silence gcc from uninitialized warnings when I know it is > unnecessary. I guess the official idiom is int x = x; and it is somewhat used in the GNU project although it is not portable.

Re: Forward declarations and variable alignment weirdness

2010-08-21 Thread Piotr Jaroszyński
2010/8/21 Paul Brook : >> I have run into variable alignment issues, which turned out to be >> caused by forward declaration w/o the aligned attribute repeated. > >> Could someone explain this please? If it's a bug to not include the >> aligned attribute in the forward declaration, would it be hard

RE: Add uninitialized attribute?

2010-08-21 Thread Kreitzer, David L
There are some situations where an __undefined__ keyword would be useful, especially w.r.t. vector intrinsics. Here is an example that came up recently. t1 = _mm_movehl_ps(t0, t0); t2 = _mm_add_ps(t1, t0); _mm_storel_pi(mem, t2); In this example, the programmer doesn't care abo

Re: Add uninitialized attribute?

2010-08-21 Thread David Brown
Mark Mitchell wrote: Bernd Schmidt wrote: int x __attribute__ ((uninitialized)); to tell compiler that it is OK for "x" to be uninitialized? Better to call it "initialized", analogous to attribute used/unused. I agree. I think the general idea is reasonable. I also think it might be wort

Re: Add uninitialized attribute?

2010-08-21 Thread Andrew Haley
On 08/21/2010 10:43 AM, Florian Weimer wrote: > * H. J. Lu: > >> Sometime I have to do >> >> int x = 0; >> >> to silence gcc from uninitialized warnings when I know it is >> unnecessary. > > I guess the official idiom is > > int x = x; > > and it is somewhat used in the GNU project although i

Re: Add uninitialized attribute?

2010-08-21 Thread Andrew Pinski
On Sat, Aug 21, 2010 at 8:21 AM, Andrew Haley wrote: > Ewww, yuck.  I think this'll get a read from uninitialized message from > Valgrind.  It's undefined behaviour too. Not to mention there is a patch to get rid of this idiom and warn about it even without uninitialized warning. -- Pinski

CLEAR_INSN_CACHE

2010-08-21 Thread Kilbane, Stephen
Hi, I'm trying to add support to 4.3 for cache flushing when setting up a trampoline. Reading around, it looks like I should be defining CLEAR_INSN_CACHE: To clear the instruction cache when a trampoline is initialized, define the following macro. CLEAR_INSN_CACHE (beg, end) but I can't see

Re: Add uninitialized attribute?

2010-08-21 Thread Florian Weimer
* Andrew Haley: > On 08/21/2010 10:43 AM, Florian Weimer wrote: >> * H. J. Lu: >> >>> Sometime I have to do >>> >>> int x = 0; >>> >>> to silence gcc from uninitialized warnings when I know it is >>> unnecessary. >> >> I guess the official idiom is >> >> int x = x; >> >> and it is somewhat u

Re: Add uninitialized attribute?

2010-08-21 Thread Mark Mitchell
Kreitzer, David L wrote: > There are some situations where an __undefined__ keyword would be useful Thanks for the example. I suppose that in C the natural syntax is a pseudo-function that takes a type, rather than an object, as an argument: __undefined__(int) __undefined__(vector float)

Re: CLEAR_INSN_CACHE

2010-08-21 Thread Ian Lance Taylor
"Kilbane, Stephen" writes: > I'm trying to add support to 4.3 for cache flushing when setting up a > trampoline. > Reading around, it looks like I should be defining CLEAR_INSN_CACHE: > > To clear the instruction cache when a trampoline is initialized, define the > following macro. >CLEAR_I

gcc-4.6-20100821 is now available

2010-08-21 Thread gccadmin
Snapshot gcc-4.6-20100821 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.6-20100821/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.6 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/trunk