algol 60 for gcc

2006-08-08 Thread Petr Machata
Hi list!

I picked a diploma thesis assignment to implement a gcc frontend, and
document the process thoroughly. I chose Algol 60 as the language to
implement. There has already been one attempt to do Algol 60 frontend,
but it probably died:
  http://gcc.gnu.org/ml/gcc/2002-05/msg00432.html

>From my investigation so far, it seems that there is not that much to
document, apart from "read this buch of links and you're basically done;
the rest changes so rapidly it doesn't make sense to document".  But the
assignment is in place, so I will do my best to create something worth
reading.  In particular, I was looking at GCC documentation assignments:
  http://gcc.gnu.org/projects/documentation.html
and I think my work could be useful for "fully document the interface of
front ends to GCC".

I'm trying to make the university to GPL the code and documentation, and
give up their copyright, so that it could be used without restriction,
but won't know the outcome until later this year.

gcc-algol project site is here, for those interested:
  http://projects.almad.net/gcc-algol

Thanks,
PM



Re: algol 60 for gcc

2006-08-08 Thread Rafael Espíndola

On 8/8/06, Petr Machata <[EMAIL PROTECTED]> wrote:

Hi list!

I picked a diploma thesis assignment to implement a gcc frontend, and
document the process thoroughly. I chose Algol 60 as the language to
implement. There has already been one attempt to do Algol 60 frontend,
but it probably died:
  http://gcc.gnu.org/ml/gcc/2002-05/msg00432.html

From my investigation so far, it seems that there is not that much to
document, apart from "read this buch of links and you're basically done;
the rest changes so rapidly it doesn't make sense to document".  But the
assignment is in place, so I will do my best to create something worth
reading.  In particular, I was looking at GCC documentation assignments:
  http://gcc.gnu.org/projects/documentation.html
and I think my work could be useful for "fully document the interface of
front ends to GCC".


For the very first steps you may find the GCC hello world howto useful
(http://svn.gna.org/viewcvs/gsc/branches/hello-world/)


I'm trying to make the university to GPL the code and documentation, and
give up their copyright, so that it could be used without restriction,
but won't know the outcome until later this year.

I believe that the code must be GPL.


gcc-algol project site is here, for those interested:
  http://projects.almad.net/gcc-algol

Thanks,
PM


Thanks for choosing GCC :-)

Rafael


Intro - Project Query

2006-08-08 Thread Matthew Miller
Hey Everyone,

Just wanted to say hi to everyone.  So hello!

Also, I saw an email regarding adding the TLCS-900
microprocessor.  Did anyone start working on the compiler for that
micro?

Sincerely,
Matt

--
Opticon, Inc.
11400 SE 8th Street
Suite 445
Bellevue, WA 98004
Tel (425) 651-2120 x2129
Cell (509) 899-1282
http://www.OpticonUSA.com


smime.p7s
Description: S/MIME cryptographic signature


Re: _JNI_CreateJavaVM missing

2006-08-08 Thread Andrew Haley
Juerg Lehni writes:
 > I compiled the lastest GCJ from SVN head today, and when linking to  
 > my application that uses JNI invocation and worked well before, I  
 > recieved a "undefined symbols" error about _JNI_CreateJavaVM and  
 > _JNI_GetDefaultJavaVMInitArgs.
 > 
 > And indeed, these symbols seem not to be exported anymore, as this  
 > does not show any results:
 > 
 > nm /usr/local/lib/libgcj.7.0.0.dylib | grep _JNI_CreateJavaVM
 > 
 > Is this a mistake on my side, or did something change here in the  
 > meantime? I previously used gcc 4.1.1.
 > 
 > The only modification I made was to apply the patch I posted earlier  
 > on this list:
 > 
 > http://gcc.gnu.org/ml/java/2006-06/msg00143.html

There have been some recent weirdnesses to do with Darwin symbols.

Forwarding to gcc for comment from Darwin maintainers.

Andrew.



Re: status of IPA in gcc trunk?

2006-08-08 Thread Ian Lance Taylor
[EMAIL PROTECTED] (Jack Howarth) writes:

>Is there a wiki gcc page which accurately describes the
> current status of IPA in gcc trunk?

Not to my knowledge.

gcc trunk does support a type of Inter Procedural Analysis.  It is
always done, when optimizing, within a single source file.  There is
also the -combine option to do IPA across multiple files; it is
documented, but it only works for the C frontend, and has some
limitations.  There is also an ongoing project to improve IPA across
multiple files; this project is known as LTO (Link Time Optimization).

> I have run across a
> fortran benchmark which exhibits a huge improvement from
> IPA when compiled on XL Fortran. I would like to attempt
> to use the current IPA support in gcc trunk with gfortran
> but it doesn't seem to be well documented. I was under the
> impression that the gcc IPA would require collection of
> profiling results which would then be used in a successive
> compilation to implement the IPA optimizations.

That is a procedure which I, at least, would probably not call IPA.
That sounds more like what I would call Feedback Direction
Optimization, FDO.  gcc supports that, to a somewhat limited extended,
independently of using IPA.  For FDO, look in the documentation for
-fprofile-generate and -fprofile-use.

> ps Does each front-end have to be modified to use IPA or
> will they automatically use it once it is added to gcc
> trunk?

Each front end will have to be modified to use IPA.  No front end
modifications are required to use FDO.

Hope this helps.

Ian


Re: Incorrect application of loop exit heuristic?

2006-08-08 Thread Pat Haugen
Jan Hubicka <[EMAIL PROTECTED]> wrote on 08/08/2006 01:04:33 AM:

> > are predicted.  Should the 10% probability be applied without dividing
by
> > the number of exits (i.e. each exit has a 10% probability of being
taken,
> > independent of other loop exits)?  The way things are now, once we get
more
> > than 5 exits in a loop those exits may be statically predicted as not
taken
> > since their probabilities will be less than the 2% threshold.
> >
> > The benchmark code in question was a fairly large switch statement
within a
> > loop, having several 'return' statements in the various 'case' legs.
>
> The code there is basically avoiding loops with many exists to be
> predicted to not loop at all (ie if you have 10 exits, having every exit
> with 10% probability is going to make 0.9^10 (roughly 30%) probability
> that the loop will trip.
>
> The code is not quite correct - first it should be computing -10th power
> of the probability (that is close enough to division) and also it should
> track down number of exist conditionals executed each iteration...
> Would be possible to benchmark the SPEC without this division for start?
> How many exit conditionals are executed per iteration in your loop?
>

I did a quick scan of the loop in question.  There are 62 exits in the
loop, but best I could tell, the most that would ever be seen on a single
iteration of the loop is 9 since most the case legs end with a 'break'.

Another alternative a colleague and I kicked around was something like
applying "max(10%/num_exits, 2%)" as the probability of the exit edges.



troubles compiling

2006-08-08 Thread Sebastián Bochoniuk

Hi, I am having a trouble compiling with the GCC. I need to compile a
program in C++ for the HC12 but I am having some troubles.
I am sure that I am doing something wrong but I can not find what.

Can you help me with this? Or at least tell me where can I found a
tutorial or something?.

Best regards
sebastian




Re: troubles compiling

2006-08-08 Thread Jan-Benedict Glaw
On Tue, 2006-08-08 15:04:40 -0300, Sebastián Bochoniuk <[EMAIL PROTECTED]> 
wrote:
> Hi, I am having a trouble compiling with the GCC. I need to compile a
> program in C++ for the HC12 but I am having some troubles.
> I am sure that I am doing something wrong but I can not find what.

Do you have a problem compiling GCC or compiling some other program
with gcc? In the later cast, gcc-help is your help.

> Can you help me with this? Or at least tell me where can I found a
> tutorial or something?.

First of all, you should present the actual error messages and the
related source code.

MfG, JBG

-- 
  Jan-Benedict Glaw  [EMAIL PROTECTED]  +49-172-7608481
 Signature of:Don't believe in miracles: Rely on them!
 the second  :


signature.asc
Description: Digital signature


Re: algol 60 for gcc

2006-08-08 Thread David Nicol

On 8/8/06, Petr Machata <[EMAIL PROTECTED]> wrote:


I'm trying to make the university to GPL the code and documentation, and
give up their copyright, so that it could be used without restriction,
but won't know the outcome until later this year.


I am not a lawyer, but my understanding from researching university claims
to copyright of student work is that a university policy of holding a copyright
on work you have done in a class that you paid to be in is entirely specious.

If you are being compensated for your work and receiving research grants or
something like that it's different, but if you are doing work for a
class that you
are paying to be in, that work is yours under the Berne convention, and it is
yours to license how you please.  As a paying student, you hire your university
to coach you.

You never hear about universities claiming copyright on the output from authors
who have taken creative writing classes, do you?

of course as a doctoral student you may be receiving grant money or stipends
which may make your work work-for-hire, but then again it might not, if your
grant or stipend is a financial aid or is for tasks other than writing
software and
docs, such as being a teaching assistant.

http://www.google.com/search?q=copyright+on+student+work
shows many links to various policy documents, most of which refer to
international copyright law, which should apply to FIT BUT as well as
they apply in Canada or Minnesota.

--
David L Nicol
all your grammar nit are belong to us


Gcc extension: have a semicolon after a function definition ??

2006-08-08 Thread Michael Gong

Hi,

I am wondering why following program is compiled successfully by gcc ? 
Please notice there is a ";" after the function definition.


Is there a gcc extension for it ?

/* foo.c */
int main() {
   printf("hello world\n");
} ;

Thanks.

Michael 



Re: ___divti3 and ___umodti3 missing on Darwin

2006-08-08 Thread Geoffrey Keating


On 07/08/2006, at 6:11 PM, Jack Howarth wrote:


Geoff,
I am still puzzled by your statement that ".1.dylib files  
should never be used
directly in a link". With both gcc trunk and Xcode 2.3, the  
following...


[Jack-Howarths-Computer:~] howarth% gcc -O3 -m64 modulo.c -shared- 
libgcc

[Jack-Howarths-Computer:~] howarth% otool64 -L ./a.out
./a.out:
/usr/lib/libgcc_s_ppc64.1.dylib (compatibility version  
1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,  
current version 88.1.6)


links against the *.1.dylib version of the shared library.


Yes, it does, but not 'directly', that is the command-line to ld does  
not have '-lgcc_s.1'.



Also the *.1.dylib versions
of libgcc_s are the only shared library versions available. Lastly,  
the files in /usr/lib

are very confusing on MacOS X 10.4. I see...

[Jack-Howarths-Computer:/usr/lib] howarth% cd /usr/lib
[Jack-Howarths-Computer:/usr/lib] howarth% ls -l *gcc*
-rw-r--r--   1 root  wheel  53840 Mar  9 20:17 libgcc_s.1.0.dylib
-rw-r--r--   1 root  wheel  66472 Jun 27 18:46 libgcc_s.1.dylib
-rw-r--r--   1 root  wheel  35188 May 16 12:27 libgcc_s.10.4.dylib
-rw-r--r--   1 root  wheel  35496 May 16 12:27 libgcc_s.10.5.dylib
-rw-r--r--   1 root  wheel  60432 Mar 20  2005  
libgcc_s_ppc64.1.0.dylib

-rw-r--r--   1 root  wheel  68972 Jan 30  2006 libgcc_s_ppc64.1.dylib

I see separate libgcc_s.1.0.dylib and libgcc_s.1.dylib as well as
libgcc_s_ppc64.1.0.dylib and  libgcc_s_ppc64.1.dylib files (with
different sizes and timestamps) rather than a symlink from one
to the other. This seems to fly in the face of convention (as well
as being at odds with how all the other shared libs in /usr/lib
on Darwin are handled...i.e. with symlinks). Which libgcc should I be
looking for TImode symbols in?


You should ignore the 'libgcc_s*.1.0.dylib', they're old.  Where you  
should look depends on the question you're asking.

smime.p7s
Description: S/MIME cryptographic signature


A question about cp/pt.c:type_unification_real

2006-08-08 Thread Kazu Hirata
Hi,

I have a question about cp/pt.c:type_unification_real.

What does "args" represent?  The comment above type_unification_real
says "most parms like fn_type_unification."  According to
fn_type_unification, "args" is supposed to point to function
arguments.  In fact, when I backtraced a call to
type_unification_real, I traced "args" to the second argument of
build_new_function_call, which indicates that "args" are function
arguments.

However, "args" appears to be a parameter list, too.  For example,
type_unification_real contains code like:

  parms = xparms;
  args = xargs;

  while (parms && parms != void_list_node
 && args && args != void_list_node)

Note that "args" is compared against void_list_node.

As another example, also in type_unification_real, we have

  if (args && args != void_list_node && parms == void_list_node)
return 1;

Note again that "args" is compared to void_list_node.

Even more confusing is:

  arg = TREE_VALUE (args);
  :
  :
  if (!TYPE_P (arg))

Can a function argument be a type?

Clarification would be greatly apprecaited.

Thanks,

Kazu Hirata


Re: Gcc extension: have a semicolon after a function definition ??

2006-08-08 Thread Andrew Pinski
> 
> Hi,
> 
> I am wondering why following program is compiled successfully by gcc ? 
> Please notice there is a ";" after the function definition.
> 
> Is there a gcc extension for it ?

Yes, use -pedantic-errors for showing if it is a GCC extension or not.

-- Pinski


Re: Gcc extension: have a semicolon after a function definition ??

2006-08-08 Thread Michael Gong

Yes. Gcc gives a warning under -pedantic.


gcc -pedantic foo.c

foo.c:3: warning: ISO C does not allow extra `;' outside of a function


It looks like an old C syntax.

Regards,

Michael


- Original Message - 
From: "Andrew Pinski" <[EMAIL PROTECTED]>

To: "Michael Gong" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; 
Sent: Tuesday, August 08, 2006 4:34 PM
Subject: Re: Gcc extension: have a semicolon after a function definition ??




Hi,

I am wondering why following program is compiled successfully by gcc ? 
Please notice there is a ";" after the function definition.


Is there a gcc extension for it ?


Yes, use -pedantic-errors for showing if it is a GCC extension or not.

-- Pinski



Re: ___divti3 and ___umodti3 missing on Darwin

2006-08-08 Thread Jack Howarth
Geoff,
   Do you have any idea why linuxppc64 is seeing the missing TImode
symbols and the ppc64 libgcc on Darwin isn't? Do you think
explicitly adding the TImode symbols to the .ver for ppc64 would
resolve the issue? Again I would be happy to test any proposed
patches for resolving the issue that you might come up with
(I am assuming you are busy at WWDC).
  Jack
ps Have you checked to see if the problem exists in Xcode 2.4?
I am hoping Apple posts that on connect.apple.com soon so I can
check it myself. With the big push to 64-bit, I am assuming the
64-bit support will be more robust than in Xcode 2.3.


Re: algol 60 for gcc

2006-08-08 Thread Petr Machata
David Nicol wrote:
> On 8/8/06, Petr Machata <[EMAIL PROTECTED]> wrote:
> 
>> I'm trying to make the university to GPL the code and documentation, and
>> give up their copyright, so that it could be used without restriction,
>> but won't know the outcome until later this year.
> 
> I am not a lawyer, but my understanding from researching university
> claims to copyright of student work is that a university policy of
> holding a copyright on work you have done in a class that you paid to
> be in is entirely specious.
> 
> If you are being compensated for your work and receiving research
> grants or something like that it's different, but if you are doing
> work for a class that you are paying to be in, that work is yours
> under the Berne convention, and it is yours to license how you
> please. As a paying student, you hire your university to coach you.

Well, that makes sense, and I'm glad to hear that.  It's just that the
person that was answering my email was unsure, and told me that at the
beginning of the semester the things would get sorted out.  I was
looking into Czech Copyright Act just now, and it seems to me that
university indeed can't prevent me from disposing with the work, unless
I sign something stupid.  Let's see, I believe it'll come right.

> http://www.google.com/search?q=copyright+on+student+work
> shows many links to various policy documents, most of which refer to
> international copyright law, which should apply to FIT BUT as well as
> they apply in Canada or Minnesota.

Thanks,
PM


Re: ___divti3 and ___umodti3 missing on Darwin

2006-08-08 Thread Jack Howarth
Geoff,
   I just install Xcode 2.4 and compiling the modulo.c testcase still
fails to link...

[Jack-Howarths-Computer:~] howarth% gcc -m64 modulo.c
Undefined symbols:
  ___modti3, referenced from:
  _main in ccXflrzz.o
ld64-59.2 failed: symbol(s) not found
collect2: ld returned 1 exit status

so I guess the fix doesn't exist in that version of the Apple gcc branch.
Jack


LLVM 1.8 Release

2006-08-08 Thread Chris Lattner

For those who are interested:

http://lists.cs.uiuc.edu/pipermail/llvm-announce/2006-August/19.html
http://llvm.org/releases/1.8/docs/ReleaseNotes.html

Download here:
http://llvm.org/releases/

-Chris