warn_unused_result seems to generate spurious warnings

2008-12-04 Thread Andrew Haley
In this test case:

int fn () __attribute__ ((warn_unused_result));
int
foo ()
{
  if (fn () < 0)
return -1;
  (void) fn ();
  return 0;
}

 $ gcc -S -Wall ~/p.c
/home/aph/p.c: In function 'foo':
/home/aph/p.c:5: warning: ignoring return value of 'fn', declared with 
attribute warn_unused_result

Is this correct?  The result is not unused, but cast to void.

Andrew.


Re: warn_unused_result seems to generate spurious warnings

2008-12-04 Thread Andrew Haley
Andrew Haley wrote:
> In this test case:

I now see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509

Please ignore my earlier message.


ia32 gcc-Debian 4.3.2-1 "rep ret" ?

2008-12-04 Thread Etienne Lorrain
 Hello,

 I did not find any documentation of a "rep ret" instruction, at
http://www.intel.com/design/processor/manuals/253667.pdf
 they just say: "The behavior of the REP prefix is undefined when used with 
non-strings instructions".

 Any pointers?
 Thanks,
 Etienne.

etienne:~$ gcc --version
gcc (Debian 4.3.2-1) 4.3.2
Copyright (C) 2008 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.

etienne:~$ cat tmp.c
void fct2(int);

void fct (int i, int a)
{
a *= 2;
if (i == 2)
fct2(a);
}
etienne:~$ gcc -O2 -fomit-frame-pointer -S tmp.c -o tmp.s
etienne:~$ cat tmp.s
.file   "tmp.c"
.text
.p2align 4,,15
.globl fct
.type   fct, @function
fct:
cmpl$2, 4(%esp)
movl8(%esp), %eax
je  .L5
rep
ret
.p2align 4,,7
.p2align 3
.L5:
addl%eax, %eax
movl%eax, 4(%esp)
jmp fct2
.size   fct, .-fct
.ident  "GCC: (Debian 4.3.2-1) 4.3.2"
.section.note.GNU-stack,"",@progbits
etienne:~$






Re: ia32 gcc-Debian 4.3.2-1 "rep ret" ?

2008-12-04 Thread Andrew Haley
Etienne Lorrain wrote:
>  Hello,
> 
>  I did not find any documentation of a "rep ret" instruction, at
> http://www.intel.com/design/processor/manuals/253667.pdf
>  they just say: "The behavior of the REP prefix is undefined when used with 
> non-strings instructions".
> 
>  Any pointers?

http://gcc.gnu.org/ml/gcc-patches/2003-05/msg02117.html


RE: ia32 gcc-Debian 4.3.2-1 "rep ret" ?

2008-12-04 Thread Ye, Joey
Maybe comments at the insn pattern who emit "rep\; ret" can explain it:
";; Used by x86_machine_dependent_reorg to avoid penalty on single byte RET
;; instruction Athlon and K8 have." 

Thanks - Joey

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Etienne Lorrain
Sent: 2008年12月4日 18:31
To: gcc@gcc.gnu.org
Subject: ia32 gcc-Debian 4.3.2-1 "rep ret" ?


 Hello,

 I did not find any documentation of a "rep ret" instruction, at
http://www.intel.com/design/processor/manuals/253667.pdf
 they just say: "The behavior of the REP prefix is undefined when used with 
non-strings instructions".

 Any pointers?
 Thanks,
 Etienne.

etienne:~$ gcc --version
gcc (Debian 4.3.2-1) 4.3.2
Copyright (C) 2008 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.

etienne:~$ cat tmp.c
void fct2(int);

void fct (int i, int a)
{
a *= 2;
if (i == 2)
fct2(a);
}
etienne:~$ gcc -O2 -fomit-frame-pointer -S tmp.c -o tmp.s
etienne:~$ cat tmp.s
.file   "tmp.c"
.text
.p2align 4,,15
.globl fct
.type   fct, @function
fct:
cmpl$2, 4(%esp)
movl8(%esp), %eax
je  .L5
rep
ret
.p2align 4,,7
.p2align 3
.L5:
addl%eax, %eax
movl%eax, 4(%esp)
jmp fct2
.size   fct, .-fct
.ident  "GCC: (Debian 4.3.2-1) 4.3.2"
.section.note.GNU-stack,"",@progbits
etienne:~$






Re: Transforms on SSA form

2008-12-04 Thread John Freeman
There are documented methods of SSA decomposition.  The naive method is 
a simple reversal of SSA composition:


SSA composition: rename variables (typically by adding suffix), add phi 
nodes

SSA decomposition: rename variables (by dropping suffix), remove phi nodes

The short answer to your question is that there is no C equivalent of a 
phi node.  You simply drop it.


Hope this helps,
John


�dv

2008-12-04 Thread H�rlevel

Szia

Pár napja kérdezted hogy nem e tudok egy jó letöltős oldalt. És én
most találtam egyet.

Tele van jobbnál jobb filmekkel, és olcsó! 1 db sms elküldése után 500
kb/sec-el töltöttem napokig a legújabb premier filmeket és meséket.

Szerintem neked is be fog válni:



http://href.hu/x/7k7e



__

E-mail címed a Country jóvoltából került bele hírlevél rendszerünkbe.

Ha nem szeretnél több ilyet kapni. Írj a [EMAIL PROTECTED] email címre!

A küldő Fiktív, kitalált személy, de az e-mail címen elérsz
bennünket. 


Re: Transforms on SSA form

2008-12-04 Thread Diego Novillo
2008/12/3 James Courtier-Dutton <[EMAIL PROTECTED]>:

> Example C code:
> a = 1;
> if (condition) a = 2;
> b = a;
>
> In SSA  (use $ for the Phi, Φ)
> a1 = 1;
> if (condition) a2 = 2;
> a3 = $(a1, a2);
> b1 = a3;
>
> My problem is how do I convert the "a3 = $(a1, a2);" back to normal C code?

Try using -fdump-tree-ssa and -fdump-tree-optimized to show you both
the SSA and normal form for the program.  If you use mainline GCC you
can get the SSA form of the program even with optimizations turned
off.  For previous releases of GCC you'll need to enable optimizations
to get the SSA form.

The dump output is C-like, but not compilable in general (needs
declarations and some syntax is usually not valid C).


Diego.


Re: Transforms on SSA form

2008-12-04 Thread Diego Novillo
On Thu, Dec 4, 2008 at 11:20, John Freeman <[EMAIL PROTECTED]> wrote:
> There are documented methods of SSA decomposition.  The naive method is a
> simple reversal of SSA composition:
>
> SSA composition: rename variables (typically by adding suffix), add phi
> nodes
> SSA decomposition: rename variables (by dropping suffix), remove phi nodes
>
> The short answer to your question is that there is no C equivalent of a phi
> node.  You simply drop it.

That's only true if the program was not rewritten into SSA form or no
overlapping live ranges in SSA names exist.

If the program was rewritten into SSA and different SSA names for the
same symbol have overlapping live ranges (due to code motion and copy
propagation mostly), then dropping the PHIs gives you an invalid
program.  You have to convert the PHIs into copies.

If the SSA form you use is simply a factored use-def representation,
then dropping the PHIs is fine, of course.  GCC uses both forms: local
scalars are rewritten into SSA.  Memory symbols (arrays, aggregates,
aliased symbols) are represented with a FUD web.


Diego.


c++ regressions on powerpc-apple-darwin8.5.0

2008-12-04 Thread Jack Howarth
   We seem to have developed a number of c++ regression on
powerpc-apple-darwin8.5.0 which weren't present in r142401...

http://gcc.gnu.org/ml/gcc-testresults/2008-12/msg00311.html

...that are now present in r142425...

http://gcc.gnu.org/ml/gcc-testresults/2008-12/msg00311.html

These new failures include...

FAIL: g++.dg/eh/crossjump1.C (internal compiler error)
FAIL: g++.dg/eh/crossjump1.C (test for excess errors)
WARNING: g++.dg/eh/crossjump1.C compilation failed to produce executable
FAIL: g++.dg/inherit/covariant1.C (internal compiler error)
FAIL: g++.dg/inherit/covariant1.C (test for excess errors)
WARNING: g++.dg/inherit/covariant1.C compilation failed to produce executable
FAIL: g++.dg/inherit/ptrmem2.C (internal compiler error)
FAIL: g++.dg/inherit/ptrmem2.C (test for excess errors)
FAIL: g++.dg/init/array25.C (internal compiler error)
FAIL: g++.dg/init/array25.C (test for excess errors)
WARNING: g++.dg/init/array25.C compilation failed to produce executable
FAIL: g++.dg/init/copy5.C (internal compiler error)
FAIL: g++.dg/init/copy5.C (test for excess errors)
FAIL: g++.dg/init/value1.C (internal compiler error)
FAIL: g++.dg/init/value1.C (test for excess errors)
WARNING: g++.dg/init/value1.C compilation failed to produce executable
FAIL: g++.old-deja/g++.abi/empty2.C (internal compiler error)
FAIL: g++.old-deja/g++.abi/empty2.C (test for excess errors)
ERROR: tcl error sourcing 
/Users/regress/tbox/svn-gcc/gcc/testsuite/g++.old-deja/old-deja.exp.
ERROR: unmatched open brace in list

I have a build going on powerpc-apple-darwin9 and will repeat the tests
to get the exact errors from the compiler.
   Jack


�dv

2008-12-04 Thread H�rlevel

Szia

Pár napja kérdezted hogy nem e tudok egy jó letöltős oldalt. És én
most találtam egyet.

Tele van jobbnál jobb filmekkel, és olcsó! 1 db sms elküldése után 500
kb/sec-el töltöttem napokig a legújabb premier filmeket és meséket.

Szerintem neked is be fog válni:



http://href.hu/x/7k7e



__

E-mail címed a Country jóvoltából került bele hírlevél rendszerünkbe.

Ha nem szeretnél több ilyet kapni. Írj a [EMAIL PROTECTED] email címre!

A küldő Fiktív, kitalált személy, de az e-mail címen elérsz
bennünket. 


Re: c++ regressions on powerpc-apple-darwin8.5.0

2008-12-04 Thread Jack Howarth
On Thu, Dec 04, 2008 at 12:17:38PM -0500, Jack Howarth wrote:
>We seem to have developed a number of c++ regression on
> powerpc-apple-darwin8.5.0 which weren't present in r142401...
> 
> http://gcc.gnu.org/ml/gcc-testresults/2008-12/msg00311.html
> 
> ...that are now present in r142425...
> 
> http://gcc.gnu.org/ml/gcc-testresults/2008-12/msg00311.html
> 
> These new failures include...
> 
> FAIL: g++.dg/eh/crossjump1.C (internal compiler error)
> FAIL: g++.dg/eh/crossjump1.C (test for excess errors)
> WARNING: g++.dg/eh/crossjump1.C compilation failed to produce executable
> FAIL: g++.dg/inherit/covariant1.C (internal compiler error)
> FAIL: g++.dg/inherit/covariant1.C (test for excess errors)
> WARNING: g++.dg/inherit/covariant1.C compilation failed to produce executable
> FAIL: g++.dg/inherit/ptrmem2.C (internal compiler error)
> FAIL: g++.dg/inherit/ptrmem2.C (test for excess errors)
> FAIL: g++.dg/init/array25.C (internal compiler error)
> FAIL: g++.dg/init/array25.C (test for excess errors)
> WARNING: g++.dg/init/array25.C compilation failed to produce executable
> FAIL: g++.dg/init/copy5.C (internal compiler error)
> FAIL: g++.dg/init/copy5.C (test for excess errors)
> FAIL: g++.dg/init/value1.C (internal compiler error)
> FAIL: g++.dg/init/value1.C (test for excess errors)
> WARNING: g++.dg/init/value1.C compilation failed to produce executable
> FAIL: g++.old-deja/g++.abi/empty2.C (internal compiler error)
> FAIL: g++.old-deja/g++.abi/empty2.C (test for excess errors)
> ERROR: tcl error sourcing 
> /Users/regress/tbox/svn-gcc/gcc/testsuite/g++.old-deja/old-deja.exp.
> ERROR: unmatched open brace in list
> 
> I have a build going on powerpc-apple-darwin9 and will repeat the tests
> to get the exact errors from the compiler.
>Jack
> 

It appears that powerpc-ibm-aix5.3.0.0 is showing the same failures...

http://gcc.gnu.org/ml/gcc-testresults/2008-12/msg00356.html
 
   Jack


Reload generating memory ref in memory ref

2008-12-04 Thread Michael Eager

Hi --

I'm running into a situation where reload is replacing
a pseudo-register in an insn with a memory reference.
The problem is that this is happening in a memory ref.

The initial pattern is something like

(set (reg/v:SI 1) (mem/s:SI (plus:SI
(reg/f:SI 30)
(const_int 4)) ))

After reload, this becomes

(set (reg/v:SI 1) (mem/s:SI (plus:SI
(mem/f/c:SI (plus:SI (reg/f:SI 19) (const_int -2))
(const_int 4))

The reg-equiv for pseudo-reg 30 is the mem ref in the middle.

Any idea about why this might be happening, or, better,
how to get reload to generate a load from reg-equiv to a reg
rather than replace the pseudo-reg with the reg-equiv?

--
Michael Eager[EMAIL PROTECTED]
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


gcc-4.3-20081204 is now available

2008-12-04 Thread gccadmin
Snapshot gcc-4.3-20081204 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.3-20081204/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.3 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch 
revision 142447

You'll find:

gcc-4.3-20081204.tar.bz2  Complete GCC (includes all of below)

gcc-core-4.3-20081204.tar.bz2 C front end and core compiler

gcc-ada-4.3-20081204.tar.bz2  Ada front end and runtime

gcc-fortran-4.3-20081204.tar.bz2  Fortran front end and runtime

gcc-g++-4.3-20081204.tar.bz2  C++ front end and runtime

gcc-java-4.3-20081204.tar.bz2 Java front end and runtime

gcc-objc-4.3-20081204.tar.bz2 Objective-C front end and runtime

gcc-testsuite-4.3-20081204.tar.bz2The GCC testsuite

Diffs from 4.3-20081127 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.3
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


Re: c++ regressions on powerpc-apple-darwin8.5.0

2008-12-04 Thread Jack Howarth
   Under powerpc-apple-darwin9, these new failures appear as...

Executing on host: 
/sw/src/fink.build/gcc44-4.3.999-20081204/darwin_objdir/gcc/testsuite/g++/../../g++
 -B/sw/src/fink.build/gcc44-4.3.999-20081204/darwin_objdir/gcc/testsuite/g+
+/../../ 
/sw/src/fink.build/gcc44-4.3.999-20081204/gcc-4.4-20081204/gcc/testsuite/g++.dg/eh/crossjump1.C
  -nostdinc++ -I/sw/src/fink.build/gcc44-4.3.999-20081204/darwin_objdir/p
owerpc-apple-darwin9/libstdc++-v3/include/powerpc-apple-darwin9 
-I/sw/src/fink.build/gcc44-4.3.999-20081204/darwin_objdir/powerpc-apple-darwin9/libstdc++-v3/include
 -I/sw/src/fi
nk.build/gcc44-4.3.999-20081204/gcc-4.4-20081204/libstdc++-v3/libsupc++ 
-I/sw/src/fink.build/gcc44-4.3.999-20081204/gcc-4.4-20081204/libstdc++-v3/include/backward
 -I/sw/src/fink
.build/gcc44-4.3.999-20081204/gcc-4.4-20081204/libstdc++-v3/testsuite/util 
-fmessage-length=0  -O2
-L/sw/src/fink.build/gcc44-4.3.999-20081204/darwin_objdir/powerpc-apple-dar
win9/./libstdc++-v3/src/.libs  
-L/sw/src/fink.build/gcc44-4.3.999-20081204/darwin_objdir/powerpc-apple-darwin9/./libstdc++-v3/src/.libs
 -L/sw/src/fink.build/gcc44-4.3.999-200812
04/darwin_objdir/powerpc-apple-darwin9/./libiberty  -multiply_defined suppress 
-lm   -o ./crossjump1.exe(timeout = 300)
/sw/src/fink.build/gcc44-4.3.999-20081204/gcc-4.4-20081204/gcc/testsuite/g++.dg/eh/crossjump1.C:
 In function 'void foo()':
/sw/src/fink.build/gcc44-4.3.999-20081204/gcc-4.4-20081204/gcc/testsuite/g++.dg/eh/crossjump1.C:21:
 internal compiler error: in expr_size, at explow.c:250
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
compiler exited with status 1
output is:
/sw/src/fink.build/gcc44-4.3.999-20081204/gcc-4.4-20081204/gcc/testsuite/g++.dg/eh/crossjump1.C:
 In function 'void foo()':
/sw/src/fink.build/gcc44-4.3.999-20081204/gcc-4.4-20081204/gcc/testsuite/g++.dg/eh/crossjump1.C:21:
 internal compiler error: in expr_size, at explow.c:250
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

FAIL: g++.dg/eh/crossjump1.C (internal compiler error)
FAIL: g++.dg/eh/crossjump1.C (test for excess errors)
Excess errors:
/sw/src/fink.build/gcc44-4.3.999-20081204/gcc-4.4-20081204/gcc/testsuite/g++.dg/eh/crossjump1.C:21:
 internal compiler error: in expr_size, at explow.c:250

WARNING: g++.dg/eh/crossjump1.C compilation failed to produce executable

I'll open a PR shortly.
   Jack


Re: Reload generating memory ref in memory ref

2008-12-04 Thread Ian Lance Taylor
Michael Eager <[EMAIL PROTECTED]> writes:

> I'm running into a situation where reload is replacing
> a pseudo-register in an insn with a memory reference.
> The problem is that this is happening in a memory ref.
>
> The initial pattern is something like
>
> (set (reg/v:SI 1) (mem/s:SI (plus:SI
>   (reg/f:SI 30)
>   (const_int 4)) ))
>
> After reload, this becomes
>
> (set (reg/v:SI 1) (mem/s:SI (plus:SI
>   (mem/f/c:SI (plus:SI (reg/f:SI 19) (const_int -2))
> (const_int 4))
>
> The reg-equiv for pseudo-reg 30 is the mem ref in the middle.
>
> Any idea about why this might be happening, or, better,
> how to get reload to generate a load from reg-equiv to a reg
> rather than replace the pseudo-reg with the reg-equiv?

This is a normal occurrence during the course of reload.  If this
escapes from reload, it suggests that your GO_IF_LEGITIMATE_ADDRESS
macro is incorrectly accepting a MEM as a memory address, or that your
insn operand predicate is somehow accepting it.

Ian