Re: [PowerPC] PR23774 stack backchain broken saga

2005-09-13 Thread Segher Boessenkool


On 10 sep 2005, at 02:03, Richard Henderson wrote:


On Sat, Sep 10, 2005 at 01:00:04AM +0930, Alan Modra wrote:

2) Next, I defined parallels to keep things together.  Like the
following, with another for DImode.


This seems most reasonable to me.


Especially as the ABI states that the write of the backlink
and the stack pointer update _have_ to be done in one insn.
Not that I can see how e.g. your options 4 and 5 would be
unsafe in this case, but those are violating what the ABI
dictates.


Segher



When is it legal to compare any pair of pointers?

2005-09-13 Thread chris jefferson
I realise that according to the C++ standard it isn't legal to compare
two pointers which are not from the same array. Is anyone aware of
anything in g++ which would actually forbid this, and if there is any
way of checking if will be valid?

I want to be able to perform two main operations. Firstly to compare any
pair of pointers with ==, and also to write code like:

template
  bool
  in_range(T* begin, T* end, T* value)
  { return (begin <= value) != (end <= value); }

Where value may be a pointer not from the same array as begin and end.

Apologises for sending this question to the main gcc list, but I want to
submit such code to the debugging part of libstdc++-v3, and wanted to
check if any optimisations may make use the fact comparing pointers from
different arrays is undefined.

Thank you,

Chris



Re: When is it legal to compare any pair of pointers?

2005-09-13 Thread Paolo Carlini
chris jefferson wrote:

>I realise that according to the C++ standard it isn't legal to compare
>two pointers which are not from the same array. Is anyone aware of
>anything in g++ which would actually forbid this, and if there is any
>way of checking if will be valid?
>
In my opinion we should first close read §5.9 and 5.10. My reading is
that in general the result of pointer comparisons can be "only"
unspecified. Logically, this means that you can "trust" the result only
when both pointers point to elements of the same array.

Then, as far as *our* library (and compiler) are concerned, there is the
interesting example of basic_string::_M_disjunct: with Nathan's
substantive insight we came to the conclusion that such kind of
comparisons can be always meaningful to do (at the C++ library level) if
we use std::less<>() & co. Maybe Nathan has something to add...

Paolo.


Re: When is it legal to compare any pair of pointers?

2005-09-13 Thread Paolo Carlini
Paolo Carlini wrote:

>Then, as far as *our* library (and compiler) are concerned, there is the
>interesting example of basic_string::_M_disjunct: with Nathan's
>substantive insight we came to the conclusion that such kind of
>comparisons can be always meaningful to do (at the C++ library level) if
>we use std::less<>() & co.
>
By the way, 20.3.3/8 is very precise about this.

Paolo.


Re: [PowerPC] PR23774 stack backchain broken saga

2005-09-13 Thread Alan Modra
On Tue, Sep 13, 2005 at 11:28:07AM +0200, Segher Boessenkool wrote:
> Especially as the ABI states that the write of the backlink
> and the stack pointer update _have_ to be done in one insn.

That's on allocation.  Deallocation isn't so critical.  You just need to
ensure the backchain is written before updating sp.

Hmm, on powerpc64-linux you could even alloc up to 288 bytes without
an atomic update, since 288 bytes below the current sp is available for
use.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Re: [PowerPC] PR23774 stack backchain broken saga

2005-09-13 Thread Segher Boessenkool

Especially as the ABI states that the write of the backlink
and the stack pointer update _have_ to be done in one insn.


That's on allocation.  Deallocation isn't so critical.  You just need 
to

ensure the backchain is written before updating sp.


Yes, but your example generated code showed allocation with
two insns.  Of course it works, but it's not allowed by the
ABI.


Hmm, on powerpc64-linux you could even alloc up to 288 bytes without
an atomic update, since 288 bytes below the current sp is available for
use.


Yes.  Question is, can GCC support this (easily) -- it would
have to keep track how much space it already alloca()'ed
before doing _this_ alloca().


Segher



Must mode of set and REG_EQUIV note match?

2005-09-13 Thread Zdenek Dvorak
Hello,

I have the following insn:

(insn 522 521 523 87 (set (reg:SI 308)
(reg:SI 0 ax)) 40 {*movsi_1} (nil)
(insn_list:REG_RETVAL 520 (expr_list:REG_EQUAL (parity:DI (reg:DI 248 [ 
D.1874 ]))
(nil

Is this correct? I have a piece of code that breaks if mode of the
assigned register is not equal to mode of the expression in REG_EQUAL
note, and I wonder whether I should be fixing this piece of code, or the
code that sets the REG_EQUAL note on this insn.

Zdenek


GCC 4.0 branch frozen

2005-09-13 Thread Mark Mitchell
I am now going to start spinning 4.0.2 RC1.

(I was planning to do that last weekend, but it didn't happen.)

Therefore, as of now, the GCC 4.0 branch is frozen.  If you've had a
patch approved for 4.0.2 that's not yet been checked in, and you want to
check it in, please send me the patch URL; I'll give it a quick
once-over, and then, very likely, ask you to go ahead and check it in.

All as-of-yet unapproved patches require my explicit proposal between
now and the actual 4.0.2 release.

I will update the web page shortly to reflect current status.

-- 
Mark Mitchell
CodeSourcery, LLC
[EMAIL PROTECTED]
(916) 791-8304


Re: mirror question

2005-09-13 Thread Gerald Pfeifer
On Fri, 9 Sep 2005, Jonathan wrote:
> i could become a mirror if you want
> 
> i'm from rome italy
> the server is in Arezzo Italy
> 
> i have 3 domains that you could mirror though if u wanted
> let me know please :)
> 
> win.ac3bf1.com
> lnx.ac3bf1.com
> rjn.it
> 
> P.S. = send me the files to upload right away if u want or tell me
> what u want 2 upload (and from where to get it) to upload it ;) so
> i'll do it asap :P

Basically you can just go ahead and start mirroring; I assume you'll
want to take .

Once your first mirroring pass is done, we'd appreciate a patch for
our http://gcc.gnu.org/mirrors.html web page.

Gerald


Re: Any plan to support Windows/x86-64?

2005-09-13 Thread Ross Ridge
> Is there any plan to support Windows/x86-64?

I haven't heard of anyone wanting to work on such a port.

> What are needed for the port?

What you'ld need for any OS port.  GCC needs to support the Windows
x64 ABI, you need a suitable runtime library, and you need a suitable
assembler and linker.

I'm not sure how close the Windows x64 ABI is to the x86-64 ABI, but it
seems to be a fair bit different.  Porting MinGW should be the simplest
way to get a suitable runtime library, though maybe you'ld want to use
a newer version of the Microsoft C runtime libary.  Using binutils as
the assembler and linker is pretty much a given, but they'd need to be
ported to support the Windows x64 PE32+ PECOFF, if they don't already.

Ross Ridge



Re: Introduction of GCC improvement work for Itanium via Gelato Federation

2005-09-13 Thread Gerald Pfeifer
On Mon, 12 Sep 2005, Mark Mitchell wrote:
> In summary, I think that splitting GCC optimization efforts between FSF
> and ORC back-ends is unfortunate.  I would far rather that the free
> software community be united behind a single optimizer.   But,
> fundamentally, I don't see much that we can do about it -- unless
> someone is sitting on a patch for making Itanium performance
> dramatically better.  I think the best that we can do is to try to help
> identify what it is that makes ORC perform better and adopt those same
> strategies for FSF GCC.

Do I understand correctly that the new backend is not planned to be 
included in FSF GCC?

(If so, I'm wondering what it's going to buy the interested parties, 
because I have a hard time seeing one of the large GNU/Linux distributors 
switching to a compiler different from FSF GCC for Itanium.)

Competition and exchange of ideas are always a good idea, though.

Gerald


Re: Introduction of GCC improvement work for Itanium via Gelato Federation

2005-09-13 Thread Mark Mitchell
Gerald Pfeifer wrote:

> Do I understand correctly that the new backend is not planned to be 
> included in FSF GCC?

That seems unlikely, in the medium-term, at least.  Some people have
rasied legal issues, which I know nothing about, but the code has not
been assigned to the FSF.  But, those are just details.

Certainly, this is a decision the Steering Committee would have to make,
and it hasn't been discussed.  I think the SC would be hesitant to make
a partial switch for just a few architectures, and I think that, in the
near term, it's unlikely that support for all of GCC's architectures
will be present in any back end other than the FSF back end.

> Competition and exchange of ideas are always a good idea, though.

Indeed.

-- 
Mark Mitchell
CodeSourcery, LLC
[EMAIL PROTECTED]
(916) 791-8304


coding style: type* variable or type *varible

2005-09-13 Thread Rafael Espíndola
I have seen both in gcc. I have found that "type* variable" is
preferred in C++ code but I haven't found any guidelines for C code.

Thanks,
Rafael


Re: coding style: type* variable or type *varible

2005-09-13 Thread Mike Stump

On Sep 13, 2005, at 12:23 PM, Rafael Espíndola wrote:

I have seen both in gcc. I have found that "type* variable" is
preferred in C++ code but I haven't found any guidelines for C code.


If you ask gcc, you find:

mrs $ grep 'int\* ' *.c | wc -l
   4
mrs $ grep 'int \*' *.c | wc -l
 369

pretty clear to me.



Re: coding style: type* variable or type *varible

2005-09-13 Thread Rafael Espíndola
On 9/13/05, Mike Stump <[EMAIL PROTECTED]> wrote:
> If you ask gcc, you find:
> 
> mrs $ grep 'int\* ' *.c | wc -l
> 4
> mrs $ grep 'int \*' *.c | wc -l
>   369
> 
> pretty clear to me.
In treelang/parse.y all variables named "tok" (and some others) are
declared with
struct prod_token_parm_item* tok;

Thanks,
Rafael


Re: rtl line no

2005-09-13 Thread shreyas krishnan
thanks, that works but it seems to require a -g. is there any flag
which might also generate just this line information but avoid most of
the other debug information.

shrey 

On 9/11/05, Dale Johannesen <[EMAIL PROTECTED]> wrote:
> 
> On Sep 11, 2005, at 8:09 AM, shreyas krishnan wrote:
> 
> > Hi,
> >   Can anyone tell me if there is a way to find out roughly the
> > source line no of a particular rtl instruction (if there is ) ? I
> > believe tree has a link to the source line no, in which case how do I
> > find out the source tree node for a particular rtl stmt ?
> 
> See INSN_LOCATOR and locator_line().
> 
>


Re: coding style: type* variable or type *varible

2005-09-13 Thread Daniel Berlin



On Tue, 13 Sep 2005, Rafael Espíndola wrote:


On 9/13/05, Mike Stump <[EMAIL PROTECTED]> wrote:

If you ask gcc, you find:

mrs $ grep 'int\* ' *.c | wc -l
4
mrs $ grep 'int \*' *.c | wc -l
  369

pretty clear to me.

In treelang/parse.y all variables named "tok" (and some others) are
declared with
struct prod_token_parm_item* tok;


So, uh, change them :)

Re: Adding debug symbols causes segmentation faults with GCC-4.1 and MIPS...

2005-09-13 Thread Steven J. Hill

Joe Buck wrote:


You might want to first make sure that your program has no memory
access errors.  You could try building it for x86 and debugging
with valgrind, to see if that catches anything.


A good idea. I built it for x86. Unfortunately, from the output it
appears that 'clone' is not supported, or rather not very well. Here
is a link to the source:

http://www.uclibc.org/cgi-bin/viewcvs.cgi/*checkout*/trunk/uClibc/test/unistd/clone.c?content-type=text%2Fplain&rev=10696

The only interesting output is:

==4032== Syscall param clone(parent_tidptr) contains uninitialised byte(s)
==4032==at 0x1BA108AC: clone (clone.S:100)
==4032==by 0x1B96C412: __libc_start_main (libc-start.c:250)
==4032==by 0x80484A0: ??? (start.S:119)
==4032==
==4032== Syscall param clone(tlsinfo) contains uninitialised byte(s)
==4032==at 0x1BA108AC: clone (clone.S:100)
==4032==by 0x1B96C412: __libc_start_main (libc-start.c:250)
==4032==by 0x80484A0: ??? (start.S:119)
==4032==
==4032== Syscall param clone(child_tidptr) contains uninitialised byte(s)
==4032==at 0x1BA108AC: clone (clone.S:100)
==4032==by 0x1B96C412: __libc_start_main (libc-start.c:250)
==4032==by 0x80484A0: ??? (start.S:119)
==4032==
==4032== Unsupported clone() flags: 0x0
==4032==
==4032== The only supported clone() uses are:
==4032==  - via a threads library (LinuxThreads or NPTL)
==4032==  - via the implementation of fork or vfork
==4032==  - for the Quadrics Elan3 user-space driver

I don't feel like I can trust the output since valgrind admitted it does
not do clone very well.

-Steve


Re: Adding debug symbols causes segmentation faults with GCC-4.1 and MIPS...

2005-09-13 Thread Steven J. Hill

The interesting thing to note is that if I edit this and only do one
clone call, things work. As soon as I attempt to do a second clone,
things fall apart when debugging symbols with '-O0 -g' are compiled.
Again, the source link is below. I am going to have to make a note
of this bug and come back to it. I really need to push forward with
some other development.

-Steve

http://www.uclibc.org/cgi-bin/viewcvs.cgi/*checkout*/trunk/uClibc/test/unistd/clone.c?content-type=text%2Fplain&rev=10696


Re: Adding debug symbols causes segmentation faults with GCC-4.1 and MIPS...

2005-09-13 Thread Nicholas Nethercote

On Tue, 13 Sep 2005, Steven J. Hill wrote:


You might want to first make sure that your program has no memory
access errors.  You could try building it for x86 and debugging
with valgrind, to see if that catches anything.


A good idea. I built it for x86. Unfortunately, from the output it
appears that 'clone' is not supported, or rather not very well. Here
is a link to the source:

http://www.uclibc.org/cgi-bin/viewcvs.cgi/*checkout*/trunk/uClibc/test/unistd/clone.c?content-type=text%2Fplain&rev=10696

The only interesting output is:

==4032== Syscall param clone(parent_tidptr) contains uninitialised byte(s)
==4032==at 0x1BA108AC: clone (clone.S:100)
==4032==by 0x1B96C412: __libc_start_main (libc-start.c:250)
==4032==by 0x80484A0: ??? (start.S:119)
==4032==
==4032== Syscall param clone(tlsinfo) contains uninitialised byte(s)
==4032==at 0x1BA108AC: clone (clone.S:100)
==4032==by 0x1B96C412: __libc_start_main (libc-start.c:250)
==4032==by 0x80484A0: ??? (start.S:119)
==4032==
==4032== Syscall param clone(child_tidptr) contains uninitialised byte(s)
==4032==at 0x1BA108AC: clone (clone.S:100)
==4032==by 0x1B96C412: __libc_start_main (libc-start.c:250)
==4032==by 0x80484A0: ??? (start.S:119)
==4032==
==4032== Unsupported clone() flags: 0x0
==4032==
==4032== The only supported clone() uses are:
==4032==  - via a threads library (LinuxThreads or NPTL)
==4032==  - via the implementation of fork or vfork
==4032==  - for the Quadrics Elan3 user-space driver

I don't feel like I can trust the output since valgrind admitted it does
not do clone very well.


It handles the most common invocations of clone, but this program passes 
in 0 for 'flags', which seems odd.


Nick


Re: coding style: type* variable or type *varible

2005-09-13 Thread Rafael Ávila de Espíndola
On Tuesday 13 September 2005 18:11, Daniel Berlin wrote:
> So, uh, change them :)
I have just submitted a patch :)

Rafael


pgpOrEeEKuddE.pgp
Description: PGP signature


regmove fixups vs pseudos

2005-09-13 Thread DJ Delorie

Any reason why we blindly assume destination registers will be hard
registers here?

Index: regmove.c
===
RCS file: /cvs/gcc/gcc/gcc/regmove.c,v
retrieving revision 1.173
diff -p -U3 -r1.173 regmove.c
--- regmove.c   25 Aug 2005 06:44:09 -  1.173
+++ regmove.c   14 Sep 2005 00:27:34 -
@@ -1020,7 +1020,8 @@ fixup_match_2 (rtx insn, rtx dst, rtx sr
  if (REG_N_CALLS_CROSSED (REGNO (src)) == 0)
break;
 
- if (call_used_regs [REGNO (dst)]
+ if ((REGNO(dst) < FIRST_PSEUDO_REGISTER
+  && call_used_regs [REGNO (dst)])
  || find_reg_fusage (p, CLOBBER, dst))
break;
}


gcc-3.4-20050913 is now available

2005-09-13 Thread gccadmin
Snapshot gcc-3.4-20050913 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/3.4-20050913/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 3.4 CVS branch
with the following options: -rgcc-ss-3_4-20050913 

You'll find:

gcc-3.4-20050913.tar.bz2  Complete GCC (includes all of below)

gcc-core-3.4-20050913.tar.bz2 C front end and core compiler

gcc-ada-3.4-20050913.tar.bz2  Ada front end and runtime

gcc-g++-3.4-20050913.tar.bz2  C++ front end and runtime

gcc-g77-3.4-20050913.tar.bz2  Fortran 77 front end and runtime

gcc-java-3.4-20050913.tar.bz2 Java front end and runtime

gcc-objc-3.4-20050913.tar.bz2 Objective-C front end and runtime

gcc-testsuite-3.4-20050913.tar.bz2The GCC testsuite

Diffs from 3.4-20050906 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-3.4
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.


gccadmin's crontab

2005-09-13 Thread Joseph S. Myers
For a while gccadmin's crontab has been out of sync with the version in 
CVS (maintainer-scripts/crontab).  That in use has

43 10 * * 5 sh /home/gccadmin/scripts/gcc_release -s 4.1:HEAD   -l -d 
/sourceware/snapshot-tmp/gcc all

while that in CVS has

43 17 * * 6 sh /home/gccadmin/scripts/gcc_release -s 4.1:HEAD   -l -d 
/sourceware/snapshot-tmp/gcc all

It may of course be necessary to make changes to the live crontab for 
testing before checking them in, but once tested they should be posted to 
gcc-patches and checked in.

-- 
Joseph S. Myers   http://www.srcf.ucam.org/~jsm28/gcc/
[EMAIL PROTECTED] (personal mail)
[EMAIL PROTECTED] (CodeSourcery mail)
[EMAIL PROTECTED] (Bugzilla assignments and CCs)


Re: When is it legal to compare any pair of pointers?

2005-09-13 Thread Daniel Jacobowitz
On Tue, Sep 13, 2005 at 11:22:18AM +0100, chris jefferson wrote:
> I realise that according to the C++ standard it isn't legal to compare
> two pointers which are not from the same array. Is anyone aware of
> anything in g++ which would actually forbid this, and if there is any
> way of checking if will be valid?
> 
> I want to be able to perform two main operations. Firstly to compare any
> pair of pointers with ==, and also to write code like:
> 
> template
>   bool
>   in_range(T* begin, T* end, T* value)
>   { return (begin <= value) != (end <= value); }
> 
> Where value may be a pointer not from the same array as begin and end.
> 
> Apologises for sending this question to the main gcc list, but I want to
> submit such code to the debugging part of libstdc++-v3, and wanted to
> check if any optimisations may make use the fact comparing pointers from
> different arrays is undefined.

If two pointers to a T* are in the same array, their difference [in
bytes] must be 0 modulo sizeof(T).  If they aren't, and sizeof(T) >
alignof(T), then it doesn't have to be.  I'm pretty sure GCC can
optimize based on this information.

This bit binutils, in the form of a crash in a hash function on
Solaris.  I think that was pointer subtraction, rather than comparison,
however.

Perhaps someone who remembers this problem more clearly than
I do can chip in if I've gotten it totally wrong.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


Re: regmove fixups vs pseudos

2005-09-13 Thread Ian Lance Taylor
DJ Delorie <[EMAIL PROTECTED]> writes:

> Any reason why we blindly assume destination registers will be hard
> registers here?
> 
> Index: regmove.c
> ===
> RCS file: /cvs/gcc/gcc/gcc/regmove.c,v
> retrieving revision 1.173
> diff -p -U3 -r1.173 regmove.c
> --- regmove.c 25 Aug 2005 06:44:09 -  1.173
> +++ regmove.c 14 Sep 2005 00:27:34 -
> @@ -1020,7 +1020,8 @@ fixup_match_2 (rtx insn, rtx dst, rtx sr
> if (REG_N_CALLS_CROSSED (REGNO (src)) == 0)
>   break;
>  
> -   if (call_used_regs [REGNO (dst)]
> +   if ((REGNO(dst) < FIRST_PSEUDO_REGISTER
> +&& call_used_regs [REGNO (dst)])
> || find_reg_fusage (p, CLOBBER, dst))
>   break;
>   }

The destination register which is set by a CALL will normally be
FUNCTION_VALUE, which is normally a hard register.

Do you have an example in which something else happens?

Ian


help: interfacing between C and fortran program

2005-09-13 Thread Gaurav Gautam, Noida
Hi,


I have a function written in fortran say fun(x, y), with x and y as integer 
(scalars) . Function returns integer.


I need to call this function from a C program. How do I do it.
Can some one help me.

Does Gfortran and gcc support this. ??


Regards
Gaurav