Re: how to load a cfg from a file by tree-ssa

2006-11-24 Thread Rob Quill

On 24/11/06, Paolo Bonzini <[EMAIL PROTECTED]> wrote:

Rob Quill wrote:
> I haven't looked into this yet, but as I think I may need to be able
> to do something similar, is it possible to parse the cfg file that is
> given out, and build a C structure like that?

It seems to me that the answer had been already given in the message you
fully quoted: we cannot help you.


I don't wish to labour the point, but what I am trying to understand
is whether it is impossible or just impractical. Could you explain why
it is that it can't be done? For example, the file given out doesn't
maintain enough information about the graph, in which case, why is in
not possible to output enough information in such a format that it can
be read and parsed into a C structure?

Sorry if this is tedious, or I have missed something obvious.
Compilers are a new subject for me, but a C representation of a
control flow graph would be greatly benificial for some optimisations
I am trying to make to allow the use of light formal methods in GDB.

See here for a discussion:

http://sourceware.org/ml/gdb/2006-10/msg00078.html




And, by the way, I suggest not to top post: see
http://en.wikipedia.org/wiki/TOFU for more info.


Appologies.

Thanks for your help.

Rob


Paolo

>> > but i don't know how to load that file in a structure.
>> > I.e. i have the file .cfg builded by gcc with the option
>> > -fdump-tree-cfg and i want to load this file in a C structure so i can
>> > manipulate it.
>>
>> There is no such functionality in GCC.  GCC can only build the CFG from
>> source code, and can only do so to produce assembly language output.




Re: how to load a cfg from a file by tree-ssa

2006-11-24 Thread Paolo Bonzini

Rob Quill wrote:

On 24/11/06, Paolo Bonzini <[EMAIL PROTECTED]> wrote:

Rob Quill wrote:
> I haven't looked into this yet, but as I think I may need to be able
> to do something similar, is it possible to parse the cfg file that is
> given out, and build a C structure like that?

It seems to me that the answer had been already given in the message you
fully quoted: we cannot help you.


I don't wish to labour the point, but what I am trying to understand
is whether it is impossible or just impractical. 


It is neither impossible, nor impractical.  Rather, it is irrelevant as 
for as GCC is concerned: it is not within the scope of a compiler to 
read back the CFG that (it prints them out to aid debugging), and this 
is why GCC does not provide APIs to do so.


All you have to do, is understand the output format (either by looking 
at tree-cfg.c or by "reverse engineering" it yourself), and write a 
corresponding parser.  The C structs you will use may be based on those 
in GCC (see basic-block.h) but probably will not because these will 
bring many other details on the GCC intermediate representation.


Paolo


Re: how to load a cfg from a file by tree-ssa

2006-11-24 Thread Rob Quill

On 24/11/06, Paolo Bonzini <[EMAIL PROTECTED]> wrote:

Rob Quill wrote:
> On 24/11/06, Paolo Bonzini <[EMAIL PROTECTED]> wrote:
>> Rob Quill wrote:
>> > I haven't looked into this yet, but as I think I may need to be able
>> > to do something similar, is it possible to parse the cfg file that is
>> > given out, and build a C structure like that?
>>
>> It seems to me that the answer had been already given in the message you
>> fully quoted: we cannot help you.
>
> I don't wish to labour the point, but what I am trying to understand
> is whether it is impossible or just impractical.

It is neither impossible, nor impractical.  Rather, it is irrelevant as
for as GCC is concerned: it is not within the scope of a compiler to
read back the CFG that (it prints them out to aid debugging), and this
is why GCC does not provide APIs to do so.

All you have to do, is understand the output format (either by looking
at tree-cfg.c or by "reverse engineering" it yourself), and write a
corresponding parser.  The C structs you will use may be based on those
in GCC (see basic-block.h) but probably will not because these will
bring many other details on the GCC intermediate representation.


Excellent. This is what I expected I would have to do all along.

Thank you for your help.

Rob


Paolo



Re: how to load a cfg from a file by tree-ssa

2006-11-24 Thread Diego Novillo

Rob Quill wrote on 11/23/06 12:41:

I haven't looked into this yet, but as I think I may need to be able
to do something similar, is it possible to parse the cfg file that is
given out, and build a C structure like that?

Parsing a CFG dump is trivial.  See the script I posted in 
http://gcc.gnu.org/ml/gcc/2006-11/msg00576.html.  You can then convert 
it to whichever C data structure you want.


error in GCC Internals Manual

2006-11-24 Thread Andrija Radicevic
Hi,

I hope that this is the right mailing list to report this to. While reading
through the "GCC Internals Manual", I have found a mix-up in the chapter
"11.7 Constant expressions". The description of the expression
(const_vector:m [x0 x1 ...]) contains text belonging to the description of
the expression (const_double:m addr i0 i1 ...). More precise, all the
paragraphs starting from the 4th (begins with addr is used to contain the
mem ...), should be moved up to the description of (const_double:m addr i0
i1 ...). Though, I have some doubts regarding the last paragraph.


Best regards

Andrija Radicevic




disabling GCC flags at configure time

2006-11-24 Thread Basile STARYNKEVITCH

I am thinking of extending the *.opt machinery (ie the
gcc/opt-functions.awk gcc/optc-gen.awk gcc/opth-gen.awk files) to
offer some GCC options which can be disabled or enabled by an
appropriate configure flag.

More precisely, configure can generate HAVE_* and ENABLE_* flags
(usually in the gneerated $GCCBUILD/gcc/auto-host.h). My intent is to
hack so that the code corresponding to some flags (eg those marked
with CppCondition(HAVE_FOO) in common.opt) is conditionally generated
with #if defined(HAVE_FOO) && HAVE_FOO!=0 in files
$GCCBUILD/gcc/options.c and $GCCBUILD/gcc/options.h

A typical use could be to provide more expansive optimisations or
analysis. These could be enabled at configure time with
$GCCTOP/configure --enable-foo and then a -fanalys-foo flag is
possible in GCC. Otherwise (if configure got --disable-foo) such a
flag has no sense.

Any comments?

BTW, my copyright assignment (to FSF) has been signed by my
organisation (CEA-LIST where I am employed) and is currently either
flying (by Chronopost express) above the atlantic, or pehaps soon
arrived in Boston at FSF (but since it is Thankgiving I could expect
some delay).  Hence, I believe I can now legally submit patches which
exceed 10 lines.



-- 
Basile STARYNKEVITCH http://starynkevitch.net/Basile/ 
email: basilestarynkevitchnet mobile: +33 6 8501 2359 
8, rue de la Faïencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


Re: disabling GCC flags at configure time

2006-11-24 Thread Basile STARYNKEVITCH



Hello All

In a previous message I (Basile S.) wrote on Fri, Nov 24, 2006 at
08:54:31PM

> 
> I am thinking of extending the *.opt machinery (ie the
> gcc/opt-functions.awk gcc/optc-gen.awk gcc/opth-gen.awk files) to
> offer some GCC options which can be disabled or enabled by an
> appropriate configure flag.
> 
> More precisely, configure can generate HAVE_* and ENABLE_* flags
> (usually in the gneerated $GCCBUILD/gcc/auto-host.h). My intent is to
> hack so that the code corresponding to some flags (eg those marked
> with CppCondition(HAVE_FOO) in common.opt) is conditionally generated
> with #if defined(HAVE_FOO) && HAVE_FOO!=0 in files
> $GCCBUILD/gcc/options.c and $GCCBUILD/gcc/options.h

I am a bit ashamed to not have re-read the documentation.  Perhaps the
Condition() option syntax might be perhaps used. From
$GCCTOP/gcc/doc/options.texi (file rev119164 from trunk)

  @item Condition(@var{cond})
  The option should only be accepted if preprocessor condition
  @var{cond} is true.  Note that any C declarations associated with the
  option will be present even if @var{cond} is false; @var{cond} simply
  controls whether the option is accepted and whether it is printed in
  the @option{--help} output.


However, I grepped the source and did not found any use of this in any
gcc/*.opt file. Does anyone have an idea why this Condition is still
there?

And my initial proposal (which I called CppCondition) is slightly
different (and more general, perhaps safer) If the preprocessor
condition is false, the C variable for the flag should be not even
generated. (hence any reference to it will fail at Gcc build time).

Comments please?


Happy Thanksgiving to north americans, and regards to everyone.

-- 
Basile STARYNKEVITCH http://starynkevitch.net/Basile/ 
email: basilestarynkevitchnet mobile: +33 6 8501 2359 
8, rue de la Faïencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


Re: Help for warning: type attributes are honored only at type definition

2006-11-24 Thread Francesco Montorsi

Andrew Haley ha scritto:

Francesco Montorsi writes:
 > 
 > Looking around for a solution (e.g. suppress that specific warning) I've 
 > found:
 > 
 > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20345
 > 
 > and I wonder if the patch referenced there 
 > (http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01511.html) does fix my 
 > problem, too. Does anyone know that?
 > 
 > In that case, which is the first GCC version which will include that patch?


4.2.  I think you should try a snapshot.

Snapshot gcc-4.3-20061118 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.3-20061118/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

Ok, thanks for the advice.
I'll try it!

Thanks,
Francesco





gcc-4.1-20061124 is now available

2006-11-24 Thread gccadmin
Snapshot gcc-4.1-20061124 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.1-20061124/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

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

You'll find:

gcc-4.1-20061124.tar.bz2  Complete GCC (includes all of below)

gcc-core-4.1-20061124.tar.bz2 C front end and core compiler

gcc-ada-4.1-20061124.tar.bz2  Ada front end and runtime

gcc-fortran-4.1-20061124.tar.bz2  Fortran front end and runtime

gcc-g++-4.1-20061124.tar.bz2  C++ front end and runtime

gcc-java-4.1-20061124.tar.bz2 Java front end and runtime

gcc-objc-4.1-20061124.tar.bz2 Objective-C front end and runtime

gcc-testsuite-4.1-20061124.tar.bz2The GCC testsuite

Diffs from 4.1-20061117 are available in the diffs/ subdirectory.

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


powerpc64-gnu libgcc?

2006-11-24 Thread Daniel Jacobowitz
In updating toplevel libgcc, I noticed this in t-ppccomm:

ifneq (,$findstring gnu,$(target))
... -mlong-double-128 ...

This suggests it was supposed to apply to both GNU/Linux and GNU/Hurd, but
no other PowerPC targets.  Is that right?  If so, I assume it's safe to fix
it to do so.  It doesn't quite at present; powerpc64-gnu does not include
t-ppccomm.  powerpc-gnu does.

-- 
Daniel Jacobowitz
CodeSourcery


Re: 32bit Calling conventions on linux/ppc.

2006-11-24 Thread David Edelsohn
> Joslwah  writes:

Joslwah> Looking at the Linux 32bit PowerPC ABI spec, it appears to me that
Joslwah> floats in excess of those that are passed in registers are supposed to
Joslwah> be promoted to doubles and passed on the stack.  Examing the resulting
Joslwah> stack from a gcc generated C call it appears they are passed as
Joslwah> floats.  

Joslwah> Can someone confirm/refute this, or else point me to an ABI that says
Joslwah> that they should be passed as floats.

The SVR4 PowerPC ABI Supplement does seem to imply that floats
should be passed in the stack as doubles.  The PowerPC Linux ABI is not
identical to the SVR4 PPC ABI.  I am not sure what benefit might be gained
by promoting floats passed on the stack to double.

David



Re: powerpc64-gnu libgcc?

2006-11-24 Thread David Edelsohn
> Daniel Jacobowitz writes:


Dan> In updating toplevel libgcc, I noticed this in t-ppccomm:
Dan> ifneq (,$findstring gnu,$(target))
Dan> ... -mlong-double-128 ...

Dan> This suggests it was supposed to apply to both GNU/Linux and GNU/Hurd, but
Dan> no other PowerPC targets.  Is that right?  If so, I assume it's safe to fix
Dan> it to do so.  It doesn't quite at present; powerpc64-gnu does not include
Dan> t-ppccomm.  powerpc-gnu does.

Yes, I believe the intent was to apply the flag to all GNU-based
PowerPC ABIs, but not SVR4 classic or eABI.

David