Re: (extern int vs. int) and (extern function vs. function) (was: gcc-in-cxx update)

2009-04-30 Thread Gabriel Dos Reis
On Thu, Apr 30, 2009 at 6:54 AM, Eus wrote: > Hi Ho! > > Sorry, if I sort of hijack this thread. > > On Wed, 2009-04-29 at 15:43 +, Joseph S. Myers wrote: > >> > > "int i;" is not the same as "extern int i;". >> > >> > Sorry for my ignorance but I have been reading and searching for the >> > a

Re: gcc-in-cxx update

2009-04-30 Thread Gabriel Dos Reis
On Wed, Apr 29, 2009 at 10:54 AM, Manuel López-Ibáñez wrote: > 2009/4/29 Joseph S. Myers : >> On Wed, 29 Apr 2009, Manuel López-Ibáñez wrote: >> >>> 2009/4/29 Joseph S. Myers : >>> > On Wed, 29 Apr 2009, Manuel López-Ibáñez wrote: >>> > >>> >> >> BTW, why is this warned about? >>> >> > >>> >> > I

Re: gcc-in-cxx update

2009-04-30 Thread Gabriel Dos Reis
On Wed, Apr 29, 2009 at 10:19 AM, Manuel López-Ibáñez wrote: > 2009/4/29 Joseph S. Myers : >> On Wed, 29 Apr 2009, Manuel López-Ibáñez wrote: >> >>> >> BTW, why is this warned about? >>> > >>> > I imagine because in C it is not conventional to use "extern" when >>> > defining something, only on a

Re: gcc-in-cxx update

2009-04-30 Thread Gabriel Dos Reis
On Wed, Apr 29, 2009 at 8:42 AM, Manuel López-Ibáñez wrote: >>> >>> BTW, why is this warned about? >> >> I imagine because in C it is not conventional to use "extern" when >> defining something, only on a declaration that is not a definition. > > But may it lead to some confusion or subtle error?

Re: gcc-in-cxx update

2009-04-30 Thread Gabriel Dos Reis
On Wed, Apr 29, 2009 at 7:13 AM, Manuel López-Ibáñez wrote: >>> * In C a const variable which is neither "extern" nor "static" is >>>   visible outside of the current translation unit.  In C++ it is not, >>>   without an explicit "extern" declaration.  I'm not sure how best to >>>   handle this w

Re: (extern int vs. int) and (extern function vs. function) (was: gcc-in-cxx update)

2009-04-30 Thread Eus
Hi Ho! On Thu, 2009-04-30 at 12:40 -0700, James Dennett wrote: > [I imagine Ian is aware of this anywyay, but to try to clarify...] > > At file scope, "int i;" with no initializer is a "tentative > definition" in C, see 6.9.2/2; a tentative definition is an odd beast > that works in some ways ra

Re: (extern int vs. int) and (extern function vs. function) (was: gcc-in-cxx update)

2009-04-30 Thread Eus
Hi Ho! On Thu, 2009-04-30 at 11:57 -0700, Ian Lance Taylor wrote: > What you are describing is a common and traditional implementation of C, > but it is not strictly standard conformant. The ISO C standard says > that "int i;" is always a definition, and "extern int i;" is always a > declaration

gcc-4.5-20090430 is now available

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

Please help me test the power7-meissner branch before I submit the changes

2009-04-30 Thread Michael Meissner
The power7 stuff should be fairly stable at this point, and I feel it is time to submit it to the mainline GCC. If other powerpc users can try out the branch to see if there are regressions, it would be helpful. Note with the recent gimple type validation errors, the mainline now has more failure

Re: [graphite] Weekly phone call notes

2009-04-30 Thread Andrew Pinski
On Thu, Apr 30, 2009 at 2:53 PM, Albert Cohen wrote: > I believe the short-cut proposed by Sebastian makes sense. We never go out > of SSA, just the hard-to-maintain-in-SSA induction variables are converted > temporarily into single-element arrays. This of course is only a quick fix, > and it does

Re: Is this valid c++ ?

2009-04-30 Thread Ian Lance Taylor
Albert Hopkins writes: > I have the following code snippet: > > typedef volatile struct { > } mystruct; > > void mytest(mystruct* x) {}; > > As a C program (gcc) this compiles fine, but with g++ I get the > following error: > > test.cpp:4: error: non-local function ‘void mytest(volatile mystruct*

Re: [graphite] Weekly phone call notes

2009-04-30 Thread Albert Cohen
Sebastian Pop wrote: On Wed, Apr 29, 2009 at 17:15, Richard Guenther wrote: I don't see how SSA form makes anything more complicated ;) One of the difficulties was regenerating the phi nodes after code hoisting: CLooG optimizes for (i) if (invariant of i) s += A[i]; into if (invaria

Is this valid c++ ?

2009-04-30 Thread Albert Hopkins
I have the following code snippet: typedef volatile struct { } mystruct; void mytest(mystruct* x) {}; As a C program (gcc) this compiles fine, but with g++ I get the following error: test.cpp:4: error: non-local function ‘void mytest(volatile mystruct*)’ uses anonymous type test.cpp:2: error: ‘

Re: (extern int vs. int) and (extern function vs. function) (was: gcc-in-cxx update)

2009-04-30 Thread James Dennett
On Thu, Apr 30, 2009 at 11:57 AM, Ian Lance Taylor wrote: > Eus writes: > >> I think the difference between "int i;" and "extern int i;" at >> file-scope in C is that "int i;" will only be treated as a definition if >> it is not defined in another place in the same file/TU. IOW, its linkage >> is

Re: [lambda] Segmentation fault in simple lambda program

2009-04-30 Thread Esben Mose Hansen
On Thursday 30 April 2009 19:19:31 you wrote: > When I try to specify the capture it works ((&sum, &f) works too but f is > const): > > #include > > int > main(void) > { > int numbers[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; > const std::size_t nn = sizeof(numbers)/sizeof(int); > int sum = 0; >

Re: Reserving a number of consecutive registers

2009-04-30 Thread Eric Botcazou
> Let's say I want to rename register r6 to r15. I can safely do that in > the block if I know that r15 is not used in that basic block and that > r6 is not a live-out of the basic block. > > However, how to handle the case where r6 is a live-out ? Then, I would > have to make sure that r15 is not

Re: (extern int vs. int) and (extern function vs. function) (was: gcc-in-cxx update)

2009-04-30 Thread Ian Lance Taylor
Eus writes: > I think the difference between "int i;" and "extern int i;" at > file-scope in C is that "int i;" will only be treated as a definition if > it is not defined in another place in the same file/TU. IOW, its linkage > is internal within the TU itself. But, "extern int i" is definitely

Re: [lambda] Segmentation fault in simple lambda program

2009-04-30 Thread Smith-Rowland, Edward M
Esben Mose Hansen writes: > this program SEGFAULTs > > #include > > int main() { > int numbers[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; > const std::size_t nn = sizeof(numbers)/sizeof(int); > int sum = 0; > int f = 5; > std::for_each(&numbers[0], &numbers[nn], [&] (int n) { > sum +=

Re: gcc-4.4.0 Build Report: Success on Open Solaris 2008.11, x86_64

2009-04-30 Thread Janis Johnson
On Thu, 2009-04-30 at 11:56 -0400, David Fang wrote: > > On Thu, Apr 30, 2009 at 7:30 AM, Tom Browder wrote: > >> On Wed, Apr 29, 2009 at 18:28, Janis Johnson wrote: > >> ... > >>> The preferred way to post test results is by running the script > >>> $SRC/contrib/test_summary from within the buil

Re: gcc-4.4.0 Build Report: Success on Open Solaris 2008.11, x86_64

2009-04-30 Thread David Fang
On Thu, Apr 30, 2009 at 7:30 AM, Tom Browder wrote: On Wed, Apr 29, 2009 at 18:28, Janis Johnson wrote: ... The preferred way to post test results is by running the script $SRC/contrib/test_summary from within the build directory.  It produces a summary in the form of a script which will mail

Re: gcc-4.4.0 Build Report: Success on Open Solaris 2008.11, x86_64

2009-04-30 Thread Andrew Pinski
On Thu, Apr 30, 2009 at 7:30 AM, Tom Browder wrote: > On Wed, Apr 29, 2009 at 18:28, Janis Johnson wrote: > ... >> The preferred way to post test results is by running the script >> $SRC/contrib/test_summary from within the build directory.  It >> produces a summary in the form of a script which

Re: gcc-4.4.0 Build Report: Success on Open Solaris 2008.11, x86_64

2009-04-30 Thread Tom Browder
On Wed, Apr 29, 2009 at 18:28, Janis Johnson wrote: ... > The preferred way to post test results is by running the script > $SRC/contrib/test_summary from within the build directory.  It > produces a summary in the form of a script which will mail that > summary to gcc-testresu...@gcc.gnu.org, whe

Re: Reserving a number of consecutive registers

2009-04-30 Thread Jean Christophe Beyler
Ok, now in the easy case it seems to be working. I've handled most cases but I was wondering about one problem that I don't seem to be able to handle. Let's say I want to rename register r6 to r15. I can safely do that in the block if I know that r15 is not used in that basic block and that r6 is

Re: (extern int vs. int) and (extern function vs. function) (was: gcc-in-cxx update)

2009-04-30 Thread Eus
Hi Ho! Sorry, if I sort of hijack this thread. On Wed, 2009-04-29 at 15:43 +, Joseph S. Myers wrote: > > > "int i;" is not the same as "extern int i;". > > > > Sorry for my ignorance but I have been reading and searching for the > > answer and I cannot tell what is the difference between "i

Re: [graphite] Weekly phone call notes

2009-04-30 Thread Sebastian Pop
On Wed, Apr 29, 2009 at 17:15, Richard Guenther wrote: > I don't see how SSA form makes anything more complicated ;) > One of the difficulties was regenerating the phi nodes after code hoisting: CLooG optimizes for (i) if (invariant of i) s += A[i]; into if (invariant of i) for (i)