Re: Getting host and target size and alignment information at build time?

2008-04-12 Thread Tim Josling
On Fri, 2008-04-11 at 17:05 -0400, Daniel Jacobowitz wrote:
> On Sat, Apr 12, 2008 at 06:59:28AM +1000, Tim Josling wrote:
> > > Why not get it out of GCC later?  You don't need to hack up GCC to do
> > > that.

> That's not what I meant.  You don't need it _during the GCC build
> process_.  You can fork GCC and run it and have it tell you the answer
> based on the current command line arguments, read its output, and
> go on with what you were doing.  Which presumably involves further
> compilation.
> 

You're right... That's more or less what I think I will do. I'm working
on a proof of concept at the moment.

> (You didn't say what you are trying to do, so I'm guessing at the
> context a bit.)
> 

Here is some more explanation of what I am trying to do. 

My COBOL compiler was going to look like this:

(1). The gcc driver calls a lisp program which does the preprocessing
(lex/parse/copy-includes/replaces), lex, parse, cross checking,
simplification, and creates an output file in a simple binary format.
This Lisp program does not have direct access to any GCC code including
headers.

(2). The gcc driver passes the output file to another program (cob1)
which would be similar to cc1 except that its input file is a simple
binary format that does not need to be lexed and parsed. This program
will be drived by toplev.c and will generate, via the gcc back end, the
assembler output to be assembled and linked by subsequent programs
called from the gcc driver. It will have access to all the gcc middle
and back end code.

My initial intention was that the program (1) should know as little
about gcc as possible. I then realised that it would need some target
information such as type sizes and alignment information from gcc. I
thought I could get this information by writing a small program that
would pull in some headers and could then output a Lisp program that
could be compiled into program (1).

This didn't work out very well because the information is only available
within the compiler at run time on the target system, and it is dynamic
and option-dependent.

So I will add an option to the compiler "-fget-types". This will trigger
the output on standard output of all the information I need. So the flow
will be:

(0) cob1 -fGet-types ->stdout passed as a parameter to (1)
(1) Lisp pgm ->binary file
(2) cob1 Main toplev.c compilation taking binary file as input.

For various reasons I have to run the Lisp program via a shell script. I
cab readily include the -fget-types run in that, something like this

lisp  --user-parms -o 
 -ftypes=`cob1 -fget-types` 

The stdout from cob1 -fget-types will get passed to the Lisp program via
the shell back-quotes facility, which incorporates stdout from a file
into the command line where the back quotes appear. This is used
elsewhere in gcc.

Regards,
Tim Josling





Re: GCC 4.2.4 Status Report (2008-04-10)

2008-04-12 Thread Gerald Pfeifer
Installed.

Gerald

Index: index.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/index.html,v
retrieving revision 1.656
diff -u -3 -p -r1.656 index.html
--- index.html  7 Apr 2008 12:02:22 -   1.656
+++ index.html  12 Apr 2008 12:58:11 -
@@ -120,7 +120,7 @@ annual report for 2008
   GCC 4.2.3
 
   Status:
-  http://gcc.gnu.org/ml/gcc/2008-03/msg01080.html";>2008-03-31
+  http://gcc.gnu.org/ml/gcc/2008-04/msg00243.html";>2008-04-10
   (regression fixes and docs only).
   
   

Request copyright assignment form

2008-04-12 Thread Bob Walters
Hello GVC,

I'm interested in helping with the libstdc++ project, per this thread:
http://gcc.gnu.org/ml/libstdc++/2008-04/msg00026.html

I've been advised in a follow-up
(http://gcc.gnu.org/ml/libstdc++/2008-04/msg00029.html) that I need to
fill out, and smail in a copyright assignment form in order to make a
contribution.

Can you send me any reference to the current copyright assignment
form, so that I can get this taken care of.  I found something online
at http://gcc.gnu.org/ml/gcc/2002-09/msg00678.html, but have no idea
if that is current, so wanted to check with you first.

Thanks in advance,
- Bob Walters


Re: http://gcc.gnu.org/onlinedocs/libstdc++/ needs a bit of help

2008-04-12 Thread Gerald Pfeifer
On Wed, 9 Apr 2008, Benjamin Kosnik wrote:
> From what I can tell, the links to libstdc++ documentation on the gcc
> web site are generated from the gcc/libstdc++-v3/doc/html directory.
> This is fine, I guess. But the problem is that when this directory
> structure changed, none of the old files were deleted. Instead, we had
> the old and new documents "live" in one directory. This is a bug.

Yes, and no.  I think there are two issues here.  The one you are pointing 
out, the other the fact that we changed existing URLs (some of them old or 
"prominent" ones with external links towards them). 

I believe you have mostly addressed the first, and I'll try to help with
the second.

> On March 31, I moved all the old content into a director called
> "dated." Or, at least all the stuff I could move: 
> 
> www/gcc/htdocs/onlinedocs/libstdc++/dated
> 
> is the repository for all the old docs. In addition, ext/pb_assoc
> should be moved in to that as well, but I am lacking permissions to
> do this. 

I've moved ext/pb_assoc now.  Looking in the libstdc++ directory, there 
are a couple of further files/directories I'm not sure about:

  -rw-r--r--   1 bkoz gcc   1862 Feb 12 20:27 bk02.html
  -rw-r--r--   1 gccadmin gcc724 Apr 12 00:55 bk02.html.gz
  -rw-r--r--   1 bkoz gcc   1821 Feb 12 20:27 bk03.html
  -rw-r--r--   1 gccadmin gcc717 Apr 12 00:55 bk03.html.gz
  drwxr-sr-x   2 bkoz gcc 114688 Feb 13 21:39 libstdc++-html.20080213
  drwxr-sr-x   2 bkoz gcc 258048 Mar 26 06:05 libstdc++-html.20080326
  drwxr-sr-x   2 bkoz gcc 237568 Jan 18 06:49 libstdc++-html-USERS-20080118

As part of addressing the second issue, I will commit the patch below
in a minute which adjust our internal links as well as redirecting all
external ones and bookmarks.

Gerald

Index: faq.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/faq.html,v
retrieving revision 1.205
diff -u -3 -p -r1.205 faq.html
--- faq.html9 Sep 2007 17:38:18 -   1.205
+++ faq.html12 Apr 2008 23:20:19 -
@@ -20,7 +20,7 @@ and the http://www.fortran.com/
 Information page.
 
 Other GCC-related FAQs: 
-   http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html";>
+   http://gcc.gnu.org/onlinedocs/libstdc++/faq.html";>
  libstdc++-v3, and 
http://gcc.gnu.org/java/faq.html";>GCJ.
 
Index: .htaccess
===
RCS file: /cvs/gcc/wwwdocs/htdocs/.htaccess,v
retrieving revision 1.23
retrieving revision 1.25
diff -u -3 -p -r1.23 -r1.25
--- .htaccess   12 Apr 2008 22:41:15 -  1.23
+++ .htaccess   12 Apr 2008 23:24:21 -  1.25
@@ -24,6 +24,7 @@ Redirect permanent /libstdc++/links.html
 Redirect permanent /onlinedocs/g77_news.html   
http://gcc.gnu.org/onlinedocs/g77/News.html
 Redirect permanent /onlinedocs/g77_bugs.html   
http://gcc.gnu.org/onlinedocs/g77/Trouble.html
 Redirect permanent /onlinedocs/g77/
http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/
+Redirect permanent /onlinedocs/libstdc++/faq/index.html 
http://gcc.gnu.org/onlinedocs/libstdc++/faq.html
 
 Redirect permanent /c9xstatus.html 
http://gcc.gnu.org/c99status.html
 Redirect permanent /cvswrite.html  http://gcc.gnu.org/svnwrite.html


Committed: fix cris.md strict_low_part constraints (was: Re: A doubt about constraint modifiers)

2008-04-12 Thread Hans-Peter Nilsson
> Date: Fri, 11 Apr 2008 15:32:02 +0200
> From: Bernd Schmidt <[EMAIL PROTECTED]>

> Mohamed Shafi wrote:
> > In cris i saw this patten
> > 
> > (define_insn "*andhi_lowpart"
> >   [(set (strict_low_part
> >  (match_operand:HI 0 "register_operand""=r,r, r,r,r,r"))
> > (and:HI (match_operand:HI 1 "register_operand" "%0,0, 0,0,0,r")
> > (match_operand:HI 2 "general_operand"   "r,Q>,L,O,g,!To")))]
> > 
> > Here = is used.
> 
> This is incorrect since when the last alternative matches, nothing tells 
> the compiler that operand 0 is also an input.

Oops, thanks for noticing.  For consistency, I made all
strict_low_part constraints use "+", including those where all
alternatives had %0.  Regtested cross to cris-elf and
crisv32-elf.

PS. I'm not a native speaker, but FWIW I agree with Joe Buck
regarding usage of the word "doubt", but I see it's quite common
with some non-native speakers, indicating the fault is at the
teaching level.

gcc:
* config/cris/cris.md ("*andhi_lowpart_non_v32", "*andhi_lowpart_v32")
("*andqi_lowpart_non_v32", "*andqi_lowpart_v32"): Use "+" for the
operand 0 constraint, not "=".

Index: config/cris/cris.md
===
--- config/cris/cris.md (revision 134224)
+++ config/cris/cris.md (working copy)
@@ -2958,7 +2958,7 @@ (define_insn "*expanded_andhi_v32"
 
 (define_insn "*andhi_lowpart_non_v32"
   [(set (strict_low_part
-(match_operand:HI 0 "register_operand""=r,r, r,r,r,r"))
+(match_operand:HI 0 "register_operand""+r,r, r,r,r,r"))
(and:HI (match_operand:HI 1 "register_operand" "%0,0, 0,0,0,r")
(match_operand:HI 2 "general_operand"   "r,Q>,L,O,g,!To")))]
   "!TARGET_V32"
@@ -2974,7 +2974,7 @@ (define_insn "*andhi_lowpart_non_v32"
 
 (define_insn "*andhi_lowpart_v32"
   [(set (strict_low_part
-(match_operand:HI 0 "register_operand" "=r,r,r,r,r"))
+(match_operand:HI 0 "register_operand" "+r,r,r,r,r"))
(and:HI (match_operand:HI 1 "register_operand" "%0,0,0,0,0")
(match_operand:HI 2 "general_operand" "r,Q>,L,O,g")))]
   "TARGET_V32"
@@ -3025,7 +3025,7 @@ (define_insn "*andqi3_v32"
 
 (define_insn "*andqi_lowpart_non_v32"
   [(set (strict_low_part
-(match_operand:QI 0 "register_operand""=r,r, r,r,r"))
+(match_operand:QI 0 "register_operand""+r,r, r,r,r"))
(and:QI (match_operand:QI 1 "register_operand" "%0,0, 0,0,r")
(match_operand:QI 2 "general_operand"   "r,Q>,O,g,!To")))]
   "!TARGET_V32"
@@ -3040,7 +3040,7 @@ (define_insn "*andqi_lowpart_non_v32"
 
 (define_insn "*andqi_lowpart_v32"
   [(set (strict_low_part
-(match_operand:QI 0 "register_operand" "=r,r,r,r"))
+(match_operand:QI 0 "register_operand" "+r,r,r,r"))
(and:QI (match_operand:QI 1 "register_operand" "%0,0,0,0")
(match_operand:QI 2 "general_operand" "r,Q>,O,g")))]
   "TARGET_V32"

brgds, H-P