\input texinfo  @c -*-texinfo-*-
@setfilename gcc.info
@c @setfilename usegcc.info
@c To produce the full manual, use the "gcc.info" setfilename, and
@c make sure the following does NOT begin with '@c' (and the @clear line DOES)
@set INTERNALS
@c To produce a user-only manual, use the "usegcc.info" setfilename, and
@c make sure the following does NOT begin with '@c':
@c @clear INTERNALS

@ifset INTERNALS
@settitle Using and Porting GNU CC
@end ifset
@ifclear INTERNALS
@settitle Using GNU CC
@end ifclear

@syncodeindex fn cp

@ifinfo
This file documents the use
@ifset INTERNALS
and the internals
@end ifset
of the GNU compiler.

Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc.

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

@ignore
Permission is granted to process this file through Tex and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).

@end ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
section entitled ``GNU General Public License'' is included exactly as
in the original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that the section entitled ``GNU General Public License'' and
this permission notice may be included in translations approved by the
Free Software Foundation instead of in the original English.
@end ifinfo

@setchapternewpage odd

@titlepage
@ifset INTERNALS
@center @titlefont{Using and Porting GNU CC}
@end ifset
@ifclear INTERNALS
@title Using GNU CC
@end ifclear
@sp 2
@center Richard M. Stallman
@sp 3
@center last updated 15 February 1992
@sp 1
@center for version 2.0
@center (preliminary draft, which will change)
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1988, 1989, 1992 Free Software Foundation, Inc.

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
section entitled ``GNU General Public License'' is included exactly as
in the original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that the section entitled ``GNU General Public License'' and
this permission notice may be included in translations approved by the
Free Software Foundation instead of in the original English.
@end titlepage
@page

@ifinfo

@node Top, Copying,, (DIR)
@ichapter Introduction
@cindex introduction

@ifset INTERNALS
This manual documents how to run, install and port the GNU C compiler, as
well as its new features and incompatibilities, and how to report bugs.
It corresponds to GNU CC version 2.0.
@end ifset

@ifclear INTERNALS
This manual documents how to run and install the GNU C compiler, as
well as its new features and incompatibilities, and how to report bugs.
It corresponds to GNU CC version 2.0.
@end ifclear

@end ifinfo
@ifset INTERNALS
@menu
* Copying::         GNU General Public License says
                     how you can copy and share GNU CC.
* Contributors::    People who have contributed to GNU CC.
* Boycott::	    Protect your freedom---fight ``look and feel''.
* Invoking GCC::      Command options supported by @samp{gcc}.
* Installation::    How to configure, compile and install GNU CC.
* Trouble::         If you have trouble installing GNU CC.
* Service::         How to find suppliers of support for GNU CC.
* Incompatibilities:: Incompatibilities of GNU CC.
* Extensions::      GNU extensions to the C language.
* Bugs::            How to report bugs (if you want to get them fixed).
* VMS::             Using GNU CC on VMS.
* Portability::     Goals of GNU CC's portability features.
* Interface::       Function-call interface of GNU CC output.
* Passes::          Order of passes, what they do, and what each file is for.
* RTL::             The intermediate representation that most passes work on.
* Machine Desc::    How to write machine description instruction patterns.
* Machine Macros::  How to write the machine description C macros.
* Config::          Writing the @file{xm-@var{machine}.h} file.
* Index::	    Index of concepts and symbol names.
@end menu
@end ifset
@ifclear INTERNALS
@menu
* Copying::         GNU General Public License says
                     how you can copy and share GNU CC.
* Contributors::    People who have contributed to GNU CC.
* Boycott::	    Protect your freedom---fight ``look and feel''.
* Invoking GCC::      Command options supported by @samp{gcc}.
* Installation::    How to configure, compile and install GNU CC.
* Trouble::         If you have trouble installing GNU CC.
* Service::         How to find suppliers of support for GNU CC.
* Incompatibilities:: Incompatibilities of GNU CC.
* Extensions::      GNU extensions to the C language.
* Bugs::            How to report bugs (if you want to get them fixed).
* VMS::             Using GNU CC on VMS.
* Index::	    Index of concepts and symbol names.
@end menu
@end ifclear

@node Copying, Contributors, Top, Top
@unnumbered GNU GENERAL PUBLIC LICENSE
@center Version 2, June 1991

@display
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display

@unnumberedsec Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software---to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

  The precise terms and conditions for copying, distribution and
modification follow.

@iftex
@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end iftex
@ifinfo
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end ifinfo

@enumerate
@item
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The ``Program'', below,
refers to any such program or work, and a ``work based on the Program''
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term ``modification''.)  Each licensee is addressed as ``you''.

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

@item
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

@item
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

@enumerate a
@item
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.

@item
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

@item
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License.  (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
@end enumerate

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

@item
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

@enumerate a
@item
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

@item
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

@item
Accompany it with the information you received as to the offer
to distribute corresponding source code.  (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
@end enumerate

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

@item
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

@item
You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

@item
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

@item
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

@item
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

@item
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and ``any
later version'', you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

@item
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

@iftex
@heading NO WARRANTY
@end iftex
@ifinfo
@center NO WARRANTY
@end ifinfo

@item
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

@item
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
@end enumerate

@iftex
@heading END OF TERMS AND CONDITIONS
@end iftex
@ifinfo
@center END OF TERMS AND CONDITIONS
@end ifinfo

@page
@unnumberedsec Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the ``copyright'' line and a pointer to where the full notice is found.

@smallexample
@var{one line to give the program's name and a brief idea of what it does.}
Copyright (C) 19@var{yy}  @var{name of author}

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@end smallexample

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

@smallexample
Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@end smallexample

The hypothetical commands @samp{show w} and @samp{show c} should show
the appropriate parts of the General Public License.  Of course, the
commands you use may be called something other than @samp{show w} and
@samp{show c}; they could even be mouse-clicks or menu items---whatever
suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a ``copyright disclaimer'' for the program, if
necessary.  Here is a sample; alter the names:

@example
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.

@var{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
@end example

This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License.

@node Contributors, Boycott, Copying, Top
@unnumbered Contributors to GNU CC
@cindex contributors

In addition to Richard Stallman, several people have written parts
of GNU CC.

@itemize @bullet
@item
The idea of using RTL and some of the optimization ideas came from the
U. of Arizona Portable Optimizer, written by Jack Davidson and
Christopher Fraser.  See ``Register Allocation and Exhaustive Peephole
Optimization'', Software Practice and Experience 14 (9), Sept. 1984,
857-866.

@item
Paul Rubin wrote most of the preprocessor.

@item
Leonard Tower wrote parts of the parser, RTL generator, and RTL
definitions, and of the Vax machine description.

@item
Ted Lemon wrote parts of the RTL reader and printer.

@item
Jim Wilson implemented loop strength reduction and some other
loop optimizations.

@item
Nobuyuki Hikichi of Software Research Associates, Tokyo, contributed
the support for the Sony NEWS machine.

@item
Charles LaBrec contributed the support for the Integrated Solutions
68020 system.

@item
Michael Tiemann of Cygnus Support wrote the front end for C++, as well
as the support for inline functions and instruction scheduling.  Also
the descriptions of the National Semiconductor 32000 series cpu, the
SPARC cpu and part of the Motorola 88000 cpu.

@item
Jan Stein of the Chalmers Computer Society provided support for
Genix, as well as part of the 32000 machine description.

@item
Randy Smith finished the Sun FPA support.

@item
Robert Brown implemented the support for Encore 32000 systems.

@item
David Kashtan of SRI adapted GNU CC to the Vomit-Making System (VMS).

@item
Alex Crain provided changes for the 3b1.

@item
Greg Satz and Chris Hanson assisted in making GNU CC work on HP-UX for
the 9000 series 300.

@item
William Schelter did most of the work on the Intel 80386 support.

@item
Christopher Smith did the port for Convex machines.

@item
Paul Petersen wrote the machine description for the Alliant FX/8.

@item
Alain Lichnewsky ported GNU CC to the Mips cpu.

@item
Devon Bowen, Dale Wiles and Kevin Zachmann ported GNU CC to the Tahoe.

@item
Jonathan Stone wrote the machine description for the Pyramid computer.

@item
Richard Kenner of New York University wrote the machine descriptions for
the AMD 29000, the IBM RT PC, and the IBM RS/6000 as well as the support
for instruction attributes.  He also made changes to better support RISC
processors including changes to common subexpression elimination,
strength reduction, function calling sequence handling, and condition
code support, in addition to generalizing the code for frame pointer
elimination.

@item
Richard Kenner and Michael Tiemann jointly developed reorg.c, the delay
slot scheduler.

@item
Mike Meissner and Tom Wood of Data General finished the port to the
Motorola 88000.

@item 
Masanobu Yuhara of Fujitsu Laboratories implemented the machine
description for the Tron architecture (specifically, the Gmicro).

@item
NeXT, Inc.@: donated the front end that supports the Objective C
language.
@c We need to be careful to make it clear that "Objective C"
@c is the name of a language, not that of a program or product.

@item
James van Artsdalen wrote the code that makes efficient use of
the Intel 80387 register stack.

@item
Mike Meissner at the Open Software Foundation finished the port to the
MIPS cpu, including adding ECOFF debug support.

@item
Ron Guilmette implemented the protoize and unprotoize tools, the support
for Dwarf symbolic debugging information, and much of the support for
System V Release 4.  He has also worked heavily on the Intel 386 and 860
support.
@end itemize

@node Boycott, Invoking GCC, Contributors, Top
@chapter Protect Your Freedom---Fight ``Look And Feel''

@quotation
@i{This section is a political message from the League for Programming
Freedom to the users of GNU CC.  It is included here as an expression
of support for the League on the part of the Free Software Foundation.}
@end quotation

Apple, Lotus and Xerox are trying to create a new form of
legal monopoly: a copyright on a class of user interfaces.  These
monopolies would cause serious problems for users and developers of
computer software and systems.

Until a few years ago, the law seemed clear: no one could restrict
others from using a user interface; programmers were free to implement
any interface they chose.  Imitating interfaces, sometimes with changes,
was standard practice in the computer field.  The interfaces we know
evolved gradually in this way; for example, the Macintosh user interface
drew ideas from the Xerox interface, which in turn drew on work done at
Stanford and SRI.  1-2-3 imitated VisiCalc, and dBase imitated a
database program from JPL.

Most computer companies, and nearly all computer users, were happy with
this state of affairs.  The companies that are suing say it does not
offer ``enough incentive'' to develop their products, but they must have
considered it ``enough'' when they made their decision to do so.  It
seems they are not satisfied with the opportunity to continue to compete
in the marketplace---not even with a head start.

If Xerox, Lotus, and Apple are permitted to make law through
the courts, the precedent will hobble the software industry:

@itemize @bullet
@item
Gratuitous incompatibilities will burden users.  Imagine if each
car manufacturer had to arrange the pedals in a different order.

@item
Software will become and remain more expensive.  Users will be
``locked in'' to proprietary interfaces, for which there is no real
competition.

@item
Large companies have an unfair advantage wherever lawsuits become
commonplace.  Since they can easily afford to sue, they can intimidate
small companies with threats even when they don't really have a case.

@item
User interface improvements will come slower, since incremental
evolution through creative imitation will no longer be permitted.

@item
Even Apple, etc., will find it harder to make improvements if
they can no longer adapt the good ideas that others introduce, for
fear of weakening their own legal positions.  Some users suggest that
this stagnation may already have started.

@item
If you use GNU software, you might find it of some concern that user
interface copyright will make it hard for the Free Software Foundation
to develop programs compatible with the interfaces that you already
know.
@end itemize

To protect our freedom from lawsuits like these, a group of programmers
and users have formed a new grass-roots political organization, the
League for Programming Freedom.

The purpose of the League is to oppose new monopolistic practices such
as user-interface copyright and software patents; it calls for a return
to the legal policies of the recent past, in which these practices were
not allowed.  The League is not concerned with free software as an
issue, and not affiliated with the Free Software Foundation.

The League's membership rolls include John McCarthy, inventor of Lisp,
Marvin Minsky, founder of the Artificial Intelligence lab, Guy L.
Steele, Jr., author of well-known books on Lisp and C, as well as
Richard Stallman, the developer of GNU CC.  Please join and add your
name to the list.  Membership dues in the League are $42 per year for
programmers, managers and professionals; $10.50 for students; $21 for
others.

The League needs both activist members and members who only pay their
dues.

To join, or for more information, phone (617) 492-0023 or write to:

@display
League for Programming Freedom
1 Kendall Square #143
P.O. Box 9171
Cambridge, MA 02139
@end display

You can also send electronic mail to @code{league@@prep.ai.mit.edu}.

Here are some suggestions from the League for things you can do to
protect your freedom to write programs:

@itemize @bullet
@item
Don't buy from Xerox, Lotus or Apple.  Buy from their competitors or
from the defendants they are suing.

@item
Don't develop software to work with the systems made by these companies.

@item
Port your existing software to competing systems, so that you encourage
users to switch.

@item
Write letters to company presidents to let them know their conduct
is unacceptable.

@item
Tell your friends and colleagues about this issue and how it threatens
to ruin the computer industry.

@item
Above all, don't work for the look-and-feel plaintiffs, and don't
accept contracts from them.

@item
Write to Congress to explain the importance of this issue.

@display
House Subcommittee on Intellectual Property
2137 Rayburn Bldg
Washington, DC 20515

Senate Subcommittee on Patents, Trademarks and Copyrights
United States Senate
Washington, DC 20510
@end display

(These committees have received lots of mail already; let's give them
even more.)
@end itemize

Express your opinion!  You can make a difference.

@include invoke.texi

@node Installation, Trouble, Invoking GCC, Top
@chapter Installing GNU CC
@cindex installing GNU CC

Here is the procedure for installing GNU CC on a Unix system.

@menu
* Other Dir::     Compiling in a separate directory (not where the source is).
* Sun Install::   See below for installation on the Sun.
* 3B1 Install::   See below for installation on the 3B1.
* VMS Install::   See below for installation on VMS.
* SCO Install::   See below for installation on SCO System V 3.2.
                    (This may also be a start on solving 
                     the problems of installation on Xenix.)
* Unos Install::  See below for installation on Unos (from CRDS).
@end menu
@iftex
See below for VMS systems, and modified procedures needed on other
systems including Sun, 3B1, SCO Unix and Unos.  The following section
says how to compile in a separate directory on Unix; here we assume you
compile in the same directory that contains the source files.
@end iftex

@enumerate
@item
If you have built GNU CC previously in the same directory for a
different target machine, do @samp{make cleanconfig} to delete all files
that might be invalid.

@item
On a Sequent system, go to the Berkeley universe.

@item
On a System V release 4 system, make sure @file{/usr/bin} precedes
@file{/usr/ucb} in @code{PATH}.  The @code{cc} command in
@file{/usr/ucb} uses libraries which have bugs.

@item
Specify the host and target machine configurations.  You do this by
running the file @file{configure} with appropriate arguments.

If you are building a compiler to produce code for the machine it runs
on, specify just one machine type.  To build a cross-compiler, specify
two configurations, one for the @dfn{host machine} (which the compiler
runs on), and one for the @dfn{target machine} (which the compiler
produces code for).  The command looks like this:

@example
configure --host=sun3-sunos3 --target=sparc-sun-sunos4.1
@end example

A configuration name may be canonical or it may be more or less
abbreviated.

A canonical configuration name has three parts, separated by dashes.
It looks like this: @samp{@var{cpu}-@var{company}-@var{system}}.
(The three parts may themselves contain dashes; @file{configure}
can figure out which dashes serve which purpose.)  For example,
@samp{m68k-sun-sunos4.1} specifies a Sun 3.

You can also replace parts of the configuration by nicknames or aliases.
For example, @samp{sun3} stands for @samp{m68k-sun}, so
@samp{sun3-sunos4.1} is another way to specify a Sun 3.  You can also
use simply @samp{sun3-sunos}, since the version of Sunos is assumed by
default to be version 4.  @samp{sun3-bsd} also works, since
@file{configure} knows that the only BSD variant on a Sun 3 is Sunos.

You can specify a version number after any of the system types, and some
of the CPU types.  In most cases, the version is irrelevant, and will be
ignored.  So you might as well specify the version if you know it.

Here are the possible CPU types:

@quotation
@c gmicro, pyramid, alliant, spur and tahoe omitted since they don't work.
a29k, arm, c@var{n}, hppa, i386,
i860, m68000, m68k, m88k, mips,
ns32k, romp, rs6000, sparc, vax.
@end quotation

Note that the type hppa currently works only with Berkeley systems,
not with HP/UX.

Here are the recognized company names.  As you can see, customary
abbreviations are used rather than the longer official names.

@quotation
alliant, altos, apollo, att,
convergent, convex, crds, dec, dg,
encore, harris, hp, ibm, mips,
motorola, ncr, next, ns, omron,
sequent, sgi, sony, sun, tti,
unicom.
@end quotation

The company name is meaningful only to disambiguate when the rest of
the information supplied is insufficient.  You can omit it, writing
just @samp{@var{cpu}-@var{system}}, if it is not needed.  For example,
@samp{vax-ultrix4.2} is equivalent to @samp{vax-dec-ultrix4.2}.

Here is a list of system types:

@quotation
bsd, sysv, mach, minix, genix,
ultrix, vms, sco, esix, isc,
aix, sunos, hpux, unos,
luna, dgux, newsos, osfrose, osf,
dynix, aos, ctix.
@end quotation

@noindent
You can omit the system type; then @file{configure} guesses the
operating system from the CPU and company.

Often a particular model of machine has a name.  Many of these names are
recognized as an alias for a CPU/company combination.  The alias
@samp{sun3}, mentioned above, is an example of this: it stands for
@samp{m68k-sun}.  Sometimes we accept a company name as a machine name,
when the name is popularly used for a particular machine.  Here is a
table of the known machine names:

@quotation
3300, 3b1, 7300, altos3068, altos,
apollo68, att-7300, balance,
convex-c@var{n}, crds, decstation-3100,
decstation-dec, decstation, delta, encore,
gmicro, hp7@var{nn}, hp8@var{nn},
hp9k2@var{nn}, hp9k3@var{nn}, hp9k7@var{nn},
hp9k8@var{nn}, iris4d, iris, isi68,
m3230, magnum, merlin, miniframe,
mmax, news-3600, news800, news, next,
pbd, pc532, pmax, ps2, risc-news,
rtpc, sun2, sun386i, sun386, sun3,
sun4, symmetry, tower-32, tower.
@end quotation 

If you specify an impossible combination such as @samp{i860-dg-vms},
then you may get an error message from @file{configure}, or it may
ignore part of the information and do the best it can with the rest.
@file{configure} always prints the canonical name for the alternative
that it used.

On certain systems, you must specify whether you want GNU CC to work with
the usual compilation tools or with the GNU compilation tools (including
GAS).  Use the @samp{--gas} argument when you run @file{configure}, if
you want to use the GNU tools.  The systems were this makes a difference
are @samp{i386-@var{anything}-sysv}, @samp{i860-@var{anything}-bsd},
@samp{m68k-hp-hpux}, @samp{m68k-sony-bsd}, @samp{m68k-altos-sysv},
@samp{m68000-hp-hpux}, and @samp{m68000-att-sysv}.  On any other
system, @samp{--gas} has no effect.

On certain systems, you must specify whether the machine has a floating
point unit.  These systems are @samp{m68k-sun-sunos@var{n}} and
@samp{m68k-isi-bsd}.  On any other system, @samp{--nfp} currently has no
effect, though perhaps there are other systems where it could usefully
make a difference.

If you want to install your own homemade configuration files, you can
use @samp{local} as the company name to access them.  If you use 
configuration @samp{@var{cpu}-local}, the entire configuration name
is used to form the configuration file names.

Thus, if you specify @samp{m68k-local}, then the files used are
@file{m68k-local.md}, @file{m68k-local.h}, @file{m68k-local.c},
@file{xm-m68k-local.h}, @file{t-m68k-local}, and @file{x-m68k-local}.

Here is a list of configurations that have special treatment:

@table @samp
@ignore
@item fx80
Alliant FX/8 computer.  Note that the standard installed C compiler in
Concentrix 5.0 has a bug which prevent it from compiling GNU CC
correctly.  You can patch the compiler bug as follows:

@example
cp /bin/pcc ./pcc
adb -w ./pcc - << EOF
15f6?w 6610
EOF
@end example

Then you must use the @samp{-ip12} option when compiling GNU CC
with the patched compiler, as shown here:

@example
make CC="./pcc -ip12" CFLAGS=-w
@end example

Note also that Alliant's version of DBX does not manage to work with the
output from GNU CC.
@end ignore

@item m68000-att
AT&T 3b1, a.k.a. 7300 PC.  Special procedures are needed to compile GNU
CC with this machine's standard C compiler, due to bugs in that
compiler.  @xref{3b1 Install}.  You can bootstrap it more easily with
previous versions of GNU CC if you have them.

@item m68000-hp-bsd
HP 9000 series 200 running BSD.  Note that the C compiler that comes
with this system cannot compile GNU CC; contact @code{law@@super.org}
to get binaries of GNU CC for bootstrapping.

@item m68k-altos
Altos 3068.  You must use the GNU assembler, linker and debugger, with
COFF-encapsulation.  Also, you must fix a kernel bug.  Details in the
file @file{ALTOS-README}.

@item m68k-hp-hpux
HP 9000 series 200 or 300 running HPUX.  GNU CC does not support the
special symbol table used by HP's debugger, but you can debug programs
with GDB if you specify @samp{--gas} to use the GNU tools instead.  In
order to use the GNU tools, you must install a library conversion
program called @code{hpxt}.

@item m68k-sun
Sun 3.  We do not provide a configuration file to use the Sun FPA by
default, because programs that establish signal handlers for floating
point traps inherently cannot work with the FPA.

@item m88k-dgux
Motorola m88k running DG/UX.  To build native or cross compilers on
DG/UX, you must first change to the 88open BCS software development
environment.  This is done by issuing this command:

@example
eval `sde-target m88kbcs`
@end example

@item ns32k-encore
Encore ns32000 system.  Encore systems are supported only under BSD.

@item ns32k-*-genix
National Semiconductor ns32000 system.  Genix has bugs in @code{alloca}
and @code{malloc}; you must get the compiled versions of these from GNU
Emacs.

@item ns32k-utek
UTEK ns32000 system (``merlin'').  The C compiler that comes with this
system cannot compile GNU CC; contact @samp{tektronix!reed!mason} to get
binaries of GNU CC for bootstrapping.

@item rs6000-ibm
IBM PowerStation/6000 machines.  Due to the nonstandard debugging
information required for this machine, @samp{-g} is not available in
this configuration.

@item vax-dec-ultrix
Don't try compiling with Vax C (@code{vcc}).  It produces incorrect code
in some cases (for example, when @code{alloca} is used).

Meanwhile, compiling @file{cp-parse.c} with pcc does not work because of
an internal table size limitation in that compiler.  To avoid this
problem, compile just the GNU C compiler first, and use it to recompile 
building all the languages that you want to run.
@end table

Here we spell out what files will be set up by @code{configure}.  Normally
you need not be concerned with these files.

@itemize @bullet
@item
@ifset INTERNALS
A symbolic link named @file{config.h} is made to the top-level config
file for the machine you will run the compiler on (@pxref{Config}).
This file is responsible for defining information about the host
machine.  It includes @file{tm.h}.
@end ifset
@ifclear INTERNALS
A symbolic link named @file{config.h} is made to the top-level config
file for the machine you plan to run the compiler on (@pxref{Config,,The
Configuration File, gcc.info, Using and Porting GCC}).  This file is
responsible for defining information about the host machine.  It
includes @file{tm.h}.
@end ifclear

The top-level config file is located in the subdirectory @file{config}.
Its name is always @file{xm-@var{something}.h}; usually
@file{xm-@var{machine}.h}, but there are some exceptions.

If your system does not support symbolic links, you might want to
set up @file{config.h} to contain a @samp{#include} command which
refers to the appropriate file.

@item
A symbolic link named @file{tconfig.h} is made to the top-level config
file for your target machine.  This is used for compiling certain
programs to run on that machine.

@item
A symbolic link named @file{tm.h} is made to the machine-description
macro file for your target machine.  It should be in the subdirectory
@file{config} and its name is often @file{@var{machine}.h}.

@item
A symbolic link named @file{md} will be made to the machine description
pattern file.  It should be in the @file{config} subdirectory and its
name should be @file{@var{machine}.md}; but @var{machine} is often not
the same as the name used in the @file{tm.h} file because the
@file{md} files are more general.

@item
A symbolic link named @file{aux-output.c} will be made to the output
subroutine file for your machine.  It should be in the @file{config}
subdirectory and its name should be @file{@var{machine}.c}.

@item
The command file @file{configure} also constructs @file{Makefile} by
adding some text to the template file @file{Makefile.in}.  The
additional text comes from files in the @file{config} directory, named
@file{t-@var{target}} and @file{h-@var{host}}.  If these files do not
exist, it means nothing needs to be added for a given target or host.
@end itemize

@cindex Bison parser generator
@cindex parser generator, Bison
@item
Make sure the Bison parser generator is installed.  (This is
unnecessary if the Bison output files @file{c-parse.c} and
@file{cexp.c} are more recent than @file{c-parse.y} and @file{cexp.y}
and you do not plan to change the @samp{.y} files.)

Bison versions older than Sept 8, 1988 will produce incorrect output
for @file{c-parse.c}.

@item
Build the compiler.  Just type @samp{make LANGUAGES=c} in the compiler
directory.

@samp{LANGUAGES=c} specifies that only the C compiler should be
compiled.  The makefile normally builds compilers for all the supported
languages; currently, C, C++ and Objective C.  However, C is the only
language that is sure to work when you build with other non-GNU C
compilers.  In addition, building anything but C at this stage is a
waste of time.

In general, you can specify the languages to build by typing the
argument @samp{LANGUAGES="@var{list}"}, where @var{list} is one or more
words from the list @samp{c}, @samp{c++}, and @samp{objective-c}.

Ignore any warnings you may see about ``statement not reached'' in
@file{insn-emit.c}; they are normal.  Any other compilation errors may
represent bugs in the port to your machine or operating system, and
should be investigated and reported (@pxref{Bugs}).

Some commercial compilers fail to compile GNU CC because they have bugs
or limitations.  For example, the Microsoft compiler is said to run out
of macro space.  Some Ultrix compilers run out of expression space; then
you need to break up the statement where the problem happens.

@item
If you are using COFF-encapsulation, you must convert @file{libgcc.a} to
a GNU-format library at this point.  See the file @file{README-ENCAP}
in the directory containing the GNU binary file utilities, for
directions.

@cindex stage1
@item
Move the first-stage object files and executables into a subdirectory
with this command:

@example
make stage1
@end example

The files are moved into a subdirectory named @file{stage1}.
Once installation is complete, you may wish to delete these files
with @code{rm -r stage1}.

@item
Recompile the compiler with itself, with this command:

@example
make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
@end example

This is called making the stage 2 compiler.

The command shown above builds compilers for all the supported
languages.  If you don't want them all, you can specify the languages to
build by typing the argument @samp{LANGUAGES="@var{list}"}.  @var{list}
should contain one or more words from the list @samp{c}, @samp{c++}, and
@samp{objective-c}, separated by spaces.

On a 68000 or 68020 system lacking floating point hardware,
unless you have selected a @file{tm.h} file that expects by default
that there is no such hardware, do this instead:

@example
make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float"
@end example

@item
If you wish to test the compiler by compiling it with itself one more
time, do this:

@example
make stage2
make CC=stage2/gcc CFLAGS="-g -O -Bstage2/" 
@end example

@noindent
This is called making the stage 3 compiler.  Aside from the @samp{-B}
option, the options should be the same as when you made the stage 2
compiler.

Then compare the latest object files with the stage 2 object
files---they ought to be identical, unless they contain time stamps.  On
systems where object files do not contain time stamps, you can do this
(in Bourne shell):

@example
for file in *.o; do
cmp $file stage2/$file
done
@end example

This will mention any object files that differ between stage 2 and stage
3.  Any difference, no matter how innocuous, indicates that the stage 2
compiler has compiled GNU CC incorrectly, and is therefore a potentially
serious bug which you should investigate and report (@pxref{Bugs}).

On systems that use COFF object files, bytes 5 to 8 will always be
different, since it is a timestamp.  On these systems, you can do the
comparison as follows (in Bourne shell):

@example
for file in *.o; do
tail +10c $file > foo1
tail +10c stage2/$file > foo2
cmp foo1 foo2 || echo $file
done
@end example

On MIPS machines, you need to use the shell script @file{ecoff-cmp}
to compare two object files if you have built the compiler with
the @samp{-mno-mips-tfile} option.  Thus, do this:

@example
for file in *.o; do
ecoff-cmp $file stage2/$file
done
@end example

@item
Install the compiler driver, the compiler's passes and run-time support.
You can use the following command:

@example
make CC=stage2/gcc install
@end example

@noindent
(Use the same value for @code{CC} that you used when compiling the files
that are being installed.)

This copies the files @file{cc1}, @file{cpp} and @file{libgcc.a} to files
@file{cc1}, @file{cpp} and @file{libgcc.a} in directory
@file{/usr/local/lib/gcc/@var{target}/@var{version}}, which is where the
compiler driver program looks for them.  Here @var{target} is the target
machine type specified when you ran @file{configure}, and @var{version}
is the version number of GNU CC.  This naming scheme permits various
versions and/or cross-compilers to coexist.

It also copies the driver program @file{gcc} into the directory
@file{/usr/local/bin}, so that it appears in typical execution search
paths.@refill

@cindex @code{alloca} and SunOs
@strong{Warning: there is a bug in @code{alloca} in the Sun library.
To avoid this bug, install the binaries of GNU CC that were compiled
by GNU CC.  They use @code{alloca} as a built-in function and never
the one in the library.}

@item
If you will be using C++ or Objective C, and your operating system does
not handle constructors, then you must build and install the program
@code{collect2}.  Do this with the following command:

@example
make CC="stage2/gcc -O" install-collect2
@end example

The systems that @strong{do} handle constructors on their own include
system V release 4, and system V release 3 on the Intel 386.

Berkeley systems that use the ``a.out'' object file format handle
constructors without @code{collect2} if you use the GNU linker.  But if
you don't use the GNU linker, then you need @code{collect2} on these
systems.

@item
Build and install @code{protoize} if you want it.  Type

@example
make CC="stage2/gcc -O" install-proto
@end example

There is as yet no documentation for @code{protoize}.  Sorry.

@item
Correct errors in the header files on your machine.

Various system header files often contain constructs which are
incompatible with ANSI C, and they will not work when you compile
programs with GNU CC.  This behavior consists of substituting for macro
argument names when they appear inside of character constants.  The most
common offender is @file{ioctl.h}.

You can overcome this problem when you compile by specifying the
@samp{-traditional} option.

Alternatively, on Sun systems and 4.3BSD at least, you can correct the
include files by running the shell script @file{fixincludes}.  This
installs modified, corrected copies of the files @file{ioctl.h},
@file{ttychars.h} and many others, in a special directory where only
GNU CC will normally look for them.  This script will work on various
systems because it chooses the files by searching all the system
headers for the problem cases that we know about.

Use the following command to do this:

@example
make install-fixincludes
@end example

@noindent
If you selected a different directory for GNU CC installation when you
installed it, by specifying the Make variable @code{prefix} or
@code{libdir}, specify it the same way in this command.

Note that some systems are starting to come with ANSI C system header
files.  On these systems, don't run @file{fixincludes}; it may not work,
and is certainly not necessary.
@end enumerate

If you cannot install the compiler's passes and run-time support in
@file{/usr/local/lib}, you can alternatively use the @samp{-B} option to
specify a prefix by which they may be found.  The compiler concatenates
the prefix with the names  @file{cpp}, @file{cc1} and @file{libgcc.a}.
Thus, you can put the files in a directory @file{/usr/foo/gcc} and
specify @samp{-B/usr/foo/gcc/} when you run GNU CC.

Also, you can specify an alternative default directory for these files
by setting the Make variable @code{libdir} when you make GNU CC.

@node Other Dir, Sun Install, Installation, Installation
@section Compilation in a Separate Directory
@cindex other directory, compilation in
@cindex compilation in a separate directory
@cindex separate directory, compilation in

If you wish to build the object files and executables in a directory
other than the one containing the source files, here is what you must
do differently:

@enumerate
@item
Make sure you have a version of Make that supports the @code{VPATH}
feature.  (GNU Make supports it, as do Make versions on most BSD
systems.)

@item
Go to that directory before running @file{configure}:

@example
mkdir gcc-sun3
cd gcc-sun3
@end example

On systems that do not support symbolic links, this directory must be
on the same file system as the source code directory.

@item
Specify where to find @file{configure} when you run it:

@example
../gcc-2.00/configure @dots{}
@end example

This also tells @code{configure} where to find the compiler sources;
@code{configure} takes the directory from the file name that was used to
invoke it.  But if you want to be sure, you can specify the source
directory with the @samp{--srcdir} option, like this:

@example
../gcc-2.00/configure --srcdir=../gcc-2.00 sun3
@end example

The directory you specify with @samp{--srcdir} need not be the same
as the one that @code{configure} is found in.
@end enumerate

Now, you can run @code{make} in that directory.  You need not repeat the
configuration steps shown above, when ordinary source files change.  You
must, however, run @code{configure} again when the configuration files
change, if your system does not support symbolic links.

@node Sun Install, 3b1 Install, Other Dir, Installation
@section Installing GNU CC on the Sun
@cindex Sun installation
@cindex installing GNU CC on the Sun

Make sure the environment variable @code{FLOAT_OPTION} is not set when
you compile @file{libgcc.a}.  If this option were set to @code{f68881}
when @file{libgcc.a} is compiled, the resulting code would demand to be
linked with a special startup file and would not link properly without
special pains.

@cindex @code{alloca}, for SunOs
There is a bug in @code{alloca} in certain versions of the Sun library.
To avoid this bug, install the binaries of GNU CC that were compiled by
GNU CC.  They use @code{alloca} as a built-in function and never the one
in the library.

Some versions of the Sun compiler crash when compiling GNU CC.  The
problem is a segmentation fault in cpp.  This problem seems to be due to
the bulk of data in the environment variables.  You may be able to avoid
it by using the following command to compile GNU CC with Sun CC:

@example
make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
@end example

@node 3b1 Install, SCO Install, Sun Install, Installation
@section Installing GNU CC on the 3b1
@cindex 3b1 installation
@cindex installing GNU CC on the 3b1

Installing GNU CC on the 3b1 is difficult if you do not already have
GNU CC running, due to bugs in the installed C compiler.  However,
the following procedure might work.  We are unable to test it.

@enumerate
@item
Comment out the @samp{#include "config.h"} line on line 37 of
@file{cccp.c} and do @samp{make cpp}.  This makes a preliminary version
of GNU cpp.

@item
Save the old @file{/lib/cpp} and copy the preliminary GNU cpp to that
file name.

@item
Undo your change in @file{cccp.c}, or reinstall the original version,
and do @samp{make cpp} again.

@item
Copy this final version of GNU cpp into @file{/lib/cpp}.

@findex obstack_free
@item
Replace every occurrence of @code{obstack_free} in the file
@file{tree.c} with @code{_obstack_free}.

@item
Run @code{make} to get the first-stage GNU CC.

@item
Reinstall the original version of @file{/lib/cpp}.

@item
Now you can compile GNU CC with itself and install it in the normal
fashion.
@end enumerate

@node SCO Install, Unos Install, 3B1 Install, Installation
@section Installing GNU CC on SCO System V 3.2
@cindex SCO installation
@cindex installation on SCO systems

The compiler that comes with this system does not work properly with
@samp{-O}.  Therefore, you should redefine the Make variable
@code{CCLIBFLAGS} not to use @samp{-O}.

In addition, the compiler produces incorrect output when compiling parts
of GNU CC; the resulting executable @file{cc1} does not work properly
when it is used with @samp{-O}.

Therefore, what you must do after building the first stage
is use GNU CC to compile itself without optimization.  Here is how:

@example
make -k cc1 CC="./gcc -B./"
@end example

You can think of this as ``stage 1.1'' of the installation process.
However, using this command has the effect of discarding the faulty
stage 1 executable for @file{cc1} and replacing it with stage 1.1.  You
can then proceed with @samp{make stage1} and the rest of installation.

On Xenix, the same thing is necessary; in addition, you may have to
remove @samp{-g} from the options used with @code{cc}, and you may have
to simplify complicated statements in the sources of GNU CC to get them
to compile.

@node Unos Install, VMS Install, SCO Install, Installation
@section Installing GNU CC on Unos
@cindex Unos installation
@cindex installing GNU CC on Unos

Use @samp{configure unos} for building on Unos.

The Unos assembler is named @code{casm} instead of @code{as}.  For some
strange reason linking @file{/bin/as} to @file{/bin/casm} changes the
behavior, and does not work.  So, when installing GNU CC, you should
install the following script as @file{as} in the subdirectory where
the passes of GCC are installed:

@example
#!/bin/sh
casm $*
@end example

The default Unos library is named @file{libunos.a} instead of
@file{libc.a}.  To allow GNU CC to function, either change all
references to @samp{-lc} in @file{gcc.c} to @samp{-lunos} or link
@file{/lib/libc.a} to @file{/lib/libunos.a}.

@cindex @code{alloca}, for Unos
When compiling GNU CC with the standard compiler, to overcome bugs in
the support of @code{alloca}, do not use @samp{-O} when making stage 2.
Then use the stage 2 compiler with @samp{-O} to make the stage 3
compiler.  This compiler will have the same characteristics as the usual
stage 2 compiler on other systems.  Use it to make a stage 4 compiler
and compare that with stage 3 to verify proper compilation.

Unos uses memory segmentation instead of demand paging, so you will need
a lot of memory.  5 Mb is barely enough if no other tasks are running.
If linking @file{cc1} fails, try putting the object files into a library
and linking from that library.

@node VMS Install,, Unos Install, Installation
@section Installing GNU CC on VMS
@cindex VMS installation
@cindex installing GNU CC on VMS

The VMS version of GNU CC is distributed in a backup saveset containing
both source code and precompiled binaries.

To install the @file{gcc} command so you can use the compiler easily, in
the same manner as you use the VMS C compiler, you must install the VMS CLD
file for GNU CC as follows:

@enumerate
@item
Define the VMS logical names @samp{GNU_CC} and @samp{GNU_CC_INCLUDE}
to point to the directories where the GNU CC executables
(@file{gcc-cpp}, @file{gcc-cc1}, etc.) and the C include files are
kept.  This should be done with the commands:@refill

@smallexample
$ assign /super /system disk:[gcc.] gnu_cc
$ assign /super /system disk:[gcc.include.] gnu_cc_include
@end smallexample

@noindent
with the appropriate disk and directory names.  These commands can be
placed in your system startup file so they will be executed whenever
the machine is rebooted.  You may, if you choose, do this via the
@file{GCC_INSTALL.COM} script in the @file{[GCC]} directory.

@item
Install the @file{GCC} command with the command line:

@smallexample
$ set command /table=sys$library:dcltables gnu_cc:[000000]gcc
@end smallexample

@item
To install the help file, do the following:

@smallexample
$ lib/help sys$library:helplib.hlb gcc.hlp
@end smallexample

@noindent
Now you can invoke the compiler with a command like @samp{gcc /verbose
file.c}, which is equivalent to the command @samp{gcc -v -c file.c} in
Unix.
@end enumerate

If you wish to use GNU C++ you must first install GNU CC, and then
perform the following steps:

@enumerate
@item
Define the VMS logical name @samp{GNU_GXX_INCLUDE} to point to the
directory where the preprocessor will search for the C++ header files.
This can be done with the command:@refill

@smallexample
$ assign /super /system disk:[gcc.gxx_include.] gnu_gxx_include
@end smallexample

@noindent
with the appropriate disk and directory name.  If you are going to be
using libg++, you should place the libg++ header files in the directory
that this logical name points to.

@item
Obtain the file @file{gcc-cc1plus.exe}, and place this in the same
directory that @file{gcc-cc1.exe} is kept.

@item 
You will need several library functions which are used to call the
constructors and destructors for global objects.  These functions are
part of the libg++ distribution, and you will automatically get them if
you install libg++.

If you are not planning to install libg++, you will need to obtain the
files @file{gxx-startup-1.mar} and @file{gstart.cc} from the libg++
distribution, compile them, and supply them to the linker whenever you
link a C++ program.

The GNU C++ compiler can be invoked with a command like @samp{gcc /plus
/verbose file.cc}, which is equivalent to the command @samp{g++ -v -c
file.cc} in Unix.
@end enumerate

We try to put corresponding binaries and sources on the VMS distribution
tape.  But sometimes the binaries will be from an older version that the
sources, because we don't always have time to update them.  (Use the
@samp{/version} option to determine the version number of the binaries and
compare it with the source file @file{version.c} to tell whether this is
so.)  In this case, you should use the binaries you get to recompile the
sources.  If you must recompile, here is how:

@enumerate
@item
Copy the file @file{vms.h} to @file{tm.h}, @file{xm-vms.h} to
@file{config.h}, @file{vax.md} to @file{md.} and @file{vax.c}
to @file{aux-output.c}.  The files to be copied are found in the
subdirectory named @file{config}; they should be copied to the
main directory of GNU CC.  If you wish, you may use the command file
@file{config-gcc.com} to perform these steps for you.@refill

@item
Setup the logical names and command tables as defined above.  In
addition, define the VMS logical name @samp{GNU_BISON} to point at the
to the directories where the Bison executable is kept.  This should be
done with the command:@refill

@smallexample
$ assign /super /system disk:[bison.] gnu_bison
@end smallexample

You may, if you choose, use the @file{INSTALL_BISON.COM} script in the
@file{[BISON]} directory.

@item
Install the @samp{BISON} command with the command line:@refill

@smallexample
$ set command /table=sys$library:dcltables gnu_bison:[000000]bison
@end smallexample

@item
Type @samp{@@make-gcc} to recompile everything (alternatively, you may
submit the file @file{make-gcc.com} to a batch queue).  If you wish to
build the GNU C++ compiler as well as the GNU CC compiler, you must
first edit @file{make-gcc.com} and follow the instructions that appear
in the comments.@refill

@strong{If you are building GNU CC with a previous version of GNU CC,
you also should check to see that you have the newest version of the
assembler}.  In particular, GNU CC version 2 treats global constant
variables slightly differently from GNU CC version 1, and GAS version
1.38.1 does not have the patches required to work with GCC version 2.
If you use GAS 1.38.1, then @code{extern const} variables will not have
the read-only bit set, and the linker will generate warning messages
about mismatched psect attributes for these variables.  These warning
messages are merely a nuisance, and can safely be ignored.

If you are compiling with a version of GNU CC older than 1.33, specify
@samp{/DEFINE=("inline=")} as an option in all the compilations.  This
requires editing all the @code{gcc} commands in @file{make-cc1.com}.
(The older versions had problems supporting @code{inline}.)  Once you
have a working 1.33 or newer GNU CC, you can change this file back.
@end enumerate

Under previous versions of GNU CC, the generated code would occasionally
give strange results when linked to the sharable @file{VAXCRTL} library.
Now this should work.

Even with this version, however, GNU CC itself should not be linked to
the sharable @file{VAXCRTL}.  The @code{qsort} routine supplied with
@file{VAXCRTL} has a bug which can cause a compiler crash.

Similarly, the preprocessor should not be linked to the sharable
@file{VAXCRTL}.  The @code{strncat} routine supplied with @file{VAXCRTL}
has a bug which can cause the preprocessor to go into an infinite loop.

If you attempt to link to the sharable @file{VAXCRTL}, the VMS linker
will strongly resist any effort to force it to use the @code{qsort} and
@code{strncat} routines from @file{gcclib}.  Until the bugs in
@file{VAXCRTL} have been fixed, linking any of the compiler components
to the sharable VAXCRTL is not recommended.  (These routines can be
bypassed by placing duplicate copies of @code{qsort} and @code{strncat}
in @file{gcclib} under different names, and patching the compiler
sources to use these routines).  Both of the bugs in @file{VAXCRTL} are
still present in VMS version 5.4-1, which is the most recent version as
of this writing.

The executables that are generated by @file{make-cc1.com} and
@file{make-cccp.com} use the nonshared version of @file{VAXCRTL} (and
thus use the @code{qsort} and @code{strncat} routines from
@file{gcclib.olb}).

@node Trouble, Service, Installation, Top
@chapter Known Causes of Trouble with GNU CC
@cindex bugs, known
@cindex installation trouble
@cindex known causes of trouble

Here are some of the things that have caused trouble for people installing
or using GNU CC.

@itemize @bullet
@item
On certain systems, defining certain environment variables such as
@code{CC} can interfere with the functioning of @code{make}.

@item
Cross compilation can run into trouble for certain machines because
some target machines' assemblers require floating point numbers to be
written as @emph{integer} constants in certain contexts.

The compiler writes these integer constants by examining the floating
point value as an integer and printing that integer, because this is
simple to write and independent of the details of the floating point
representation.  But this does not work if the compiler is running on
a different machine with an incompatible floating point format, or
even a different byte-ordering.

In addition, correct constant folding of floating point values
requires representing them in the target machine's format.
(The C standard does not quite require this, but in practice
it is the only way to win.)

@ifset INTERNALS
It is now possible to overcome these problems by defining macros such
as @code{REAL_VALUE_TYPE}.  But doing so is a substantial amount of
work for each target machine.  @xref{Cross-compilation}.
@end ifset
@ifclear INTERNALS
It is now possible to overcome these problems by defining macros such
as @code{REAL_VALUE_TYPE}.  But doing so is a substantial amount of
work for each target machine.  @xref{Cross-compilation,,Cross
Compilation and Floating Point Format, gcc.info, Using and Porting GCC}.
@end ifclear

@cindex promotion of formal parameters
@item
Users often think it is a bug when GNU CC reports an error for code
like this:

@example
int foo (short);

int foo (x)
     short x;
@{@dots{}@}
@end example

The error message is correct: this code really is erroneous, because the
old-style non-prototype definition passes subword integers in their
promoted types.  In other words, the argument is really an @code{int},
not a @code{short}.  The correct prototype is this:

@example
int foo (int);
@end example

@cindex conflicting types
@cindex scope of declaration
@item
Users often think it is a bug when GNU CC reports an error for code
like this:

@example
int foo (struct mumble *);

struct mumble @{ @dots{} @};

int foo (struct mumble *x)
@{ @dots{} @}
@end example

This code really is erroneous, because the scope of @code{struct
mumble} the prototype is limited to the argument list containing it.
It does not refer to the @code{struct mumble} defined with file scope
immediately below---they are two unrelated types with similar names in
different scopes.

But in the definition of @code{foo}, the file-scope type is used
because that is available to be inherited.  Thus, the definition and
the prototype do not match, and you get an error.

This behavior may seem silly, but it's what the ANSI standard specifies.
It is easy enough for you to make your code work by moving the
definition of @code{struct mumble} above the prototype.  It's not worth
being incompatible with ANSI C just to avoid an error for the example
shown above.

@item
Certain local variables aren't recognized by debuggers when you compile
with optimization.

This occurs because sometimes GNU CC optimizes the variable out of
existence.  There is no way to tell the debugger how to compute the
value such a variable ``would have had'', and it is not clear that would
be desirable anyway.  So GNU CC simply does not mention the eliminated
variable when it writes debugging information.

You have to expect a certain amount of disagreement between the
executable and your source code, when you use optimization.

@ignore
@cindex @code{vfork}, for the Sun-4
@item
There is a bug in @code{vfork} on the Sun-4 which causes the registers
of the child process to clobber those of the parent.  Because of this,
programs that call @code{vfork} are likely to lose when compiled
optimized with GNU CC when the child code alters registers which contain
C variables in the parent.  This affects variables which are live in the
parent across the call to @code{vfork}.

If you encounter this, you can work around the problem by declaring
variables @code{volatile} in the function that calls @code{vfork}, until
the problem goes away, or by not declaring them @code{register} and not
using @samp{-O} for those source files.
@end ignore

@item
@code{-2147483648} is positive.

This is because 2147483648 cannot fit in the type @code{int}, so
(following the ANSI C rules) its data type is @code{unsigned long int}.
Negating this value yields 2147483648 again.

@cindex @code{genflags}, crash on Sun 4
@item
Sometimes on a Sun 4 you may observe a crash in the program
@code{genflags} while building GCC.  This is said to be due to a bug in
@code{sh}.  You can probably get around it by running @code{genflags}
manually and then retrying the @code{make}.

@item 
On some versions of Ultrix, the system supplied compiler cannot compile
@file{cp-parse.c} because it cannot handle so many cases in a @code{switch}
statement.  You can work around this problem by compiling with GNU CC.

@item
On some BSD systems including some versions of Ultrix, use of profiling
causes static variable destructors (currently used only in C++) not to
be run.

@item
On the IBM RS/6000, compiling code of the form

@example
extern int foo;

@dots{} foo @dots{}

static int foo;
@end example

@noindent
will cause the linker to report an undefined symbol @code{foo}.
Although this behavior differs from most other systems, it is not a
bug because redefining an @code{extern} variable as @code{static}
is undefined in ANSI C.
@end itemize

For additional common problems, see @ref{Incompatibilities}.

@node Service, Incompatibilities, Trouble, Top
@chapter How To Get Help with GNU CC

If you need help installing, using or changing GNU CC, there are two
ways to find it:

@itemize @bullet
@item
Send a message to a suitable network mailing list.  First try
@code{bug-gcc@@prep.ai.mit.edu}, and if that brings no response, try
@code{help-gcc@@prep.ai.mit.edu}.

@item
Look in the service directory for someone who might help you for a fee.
The service directory is found in the file named @file{SERVICE} in the
GNU CC distribution.
@end itemize

@node Incompatibilities, Extensions, Service, Top
@chapter Incompatibilities of GNU CC
@cindex incompatibilities of GNU CC

There are several noteworthy incompatibilities between GNU C and most
existing (non-ANSI) versions of C.  The @samp{-traditional} option
eliminates most of these incompatibilities, @emph{but not all}, by
telling GNU C to behave like the other C compilers.

@itemize @bullet
@cindex string constants
@cindex read-only strings
@cindex shared strings
@item
GNU CC normally makes string constants read-only.  If several
identical-looking string constants are used, GNU CC stores only one
copy of the string.

@cindex @code{mktemp}, and constant strings
One consequence is that you cannot call @code{mktemp} with a string
constant argument.  The function @code{mktemp} always alters the
string its argument points to.

@cindex @code{sscanf}, and constant strings
@cindex @code{fscanf}, and constant strings
@cindex @code{scanf}, and constant strings
Another consequence is that @code{sscanf} does not work on some systems
when passed a string constant as its format control string or input.
This is because @code{sscanf} incorrectly tries to write into the string
constant.  Likewise @code{fscanf} and @code{scanf}.

The best solution to these problems is to change the program to use
@code{char}-array variables with initialization strings for these
purposes instead of string constants.  But if this is not possible,
you can use the @samp{-fwritable-strings} flag, which directs GNU CC
to handle string constants the same way most C compilers do.
@samp{-traditional} also has this effect, among others.

@item
GNU CC does not substitute macro arguments when they appear inside of
string constants.  For example, the following macro in GNU CC

@example
#define foo(a) "a"
@end example

@noindent
will produce output @code{"a"} regardless of what the argument @var{a} is.

The @samp{-traditional} option directs GNU CC to handle such cases
(among others) in the old-fashioned (non-ANSI) fashion.

@cindex @code{setjmp} incompatibilities
@cindex @code{longjmp} incompatibilities
@item
When you use @code{setjmp} and @code{longjmp}, the only automatic
variables guaranteed to remain valid are those declared
@code{volatile}.  This is a consequence of automatic register
allocation.  Consider this function:

@example
jmp_buf j;

foo ()
@{
  int a, b;

  a = fun1 ();
  if (setjmp (j))
    return a;

  a = fun2 ();
  /* @r{@code{longjmp (j)} may occur in @code{fun3}.} */
  return a + fun3 ();
@}
@end example

Here @code{a} may or may not be restored to its first value when the
@code{longjmp} occurs.  If @code{a} is allocated in a register, then
its first value is restored; otherwise, it keeps the last value stored
in it.

If you use the @samp{-W} option with the @samp{-O} option, you will
get a warning when GNU CC thinks such a problem might be possible.

The @samp{-traditional} option directs GNU C to put variables in
the stack by default, rather than in registers, in functions that
call @code{setjmp}.  This results in the behavior found in
traditional C compilers.

@cindex external declaration scope
@cindex scope of external declarations
@cindex declaration scope
@item
Declarations of external variables and functions within a block apply
only to the block containing the declaration.  In other words, they
have the same scope as any other declaration in the same place.

In some other C compilers, a @code{extern} declaration affects all the
rest of the file even if it happens within a block.

The @samp{-traditional} option directs GNU C to treat all @code{extern}
declarations as global, like traditional compilers.

@item
In traditional C, you can combine @code{long}, etc., with a typedef name,
as shown here:

@example
typedef int foo;
typedef long foo bar;
@end example

In ANSI C, this is not allowed: @code{long} and other type modifiers
require an explicit @code{int}.  Because this criterion is expressed
by Bison grammar rules rather than C code, the @samp{-traditional}
flag cannot alter it.

@cindex typedef names as function parameters
@item
PCC allows typedef names to be used as function parameters.  The
difficulty described immediately above applies here too.

@cindex whitespace
@item
PCC allows whitespace in the middle of compound assignment operators
such as @samp{+=}.  GNU CC, following the ANSI standard, does not
allow this.  The difficulty described immediately above applies here
too.

@cindex apostrophes
@cindex '
@item
GNU CC will flag unterminated character constants inside of preprocessor
conditionals that fail.  Some programs have English comments enclosed in
conditionals that are guaranteed to fail; if these comments contain
apostrophes, GNU CC will probably report an error.  For example,
this code would produce an error:

@example
#if 0
You can't expect this to work.
#endif
@end example

The best solution to such a problem is to put the text into an actual
C comment delimited by @samp{/*@dots{}*/}.  However,
@samp{-traditional} suppresses these error messages.

@cindex @code{float} as function value type
@item
When compiling functions that return @code{float}, PCC converts it to
a double.  GNU CC actually returns a @code{float}.  If you are concerned
with PCC compatibility, you should declare your functions to return
@code{double}; you might as well say what you mean.

@cindex structures
@cindex unions
@item
When compiling functions that return structures or unions, GNU CC
output code normally uses a method different from that used on most
versions of Unix.  As a result, code compiled with GNU CC cannot call
a structure-returning function compiled with PCC, and vice versa.

The method used by GNU CC is as follows: a structure or union which is
1, 2, 4 or 8 bytes long is returned like a scalar.  A structure or union
with any other size is stored into an address supplied by the caller
(usually in a special, fixed register, but on some machines it is passed
on the stack).  The machine-description macros @code{STRUCT_VALUE} and
@code{STRUCT_INCOMING_VALUE} tell GNU CC where to pass this address.

By contrast, PCC on most target machines returns structures and unions
of any size by copying the data into an area of static storage, and then
returning the address of that storage as if it were a pointer value.
The caller must copy the data from that memory area to the place where
the value is wanted.  GNU CC does not use this method because it is
slower and nonreentrant.

On some newer machines, PCC uses a reentrant convention for all
structure and union returning.  GNU CC on most of these machines uses a
compatible convention when returning structures and unions in memory,
but still returns small structures and unions in registers.

You can tell GNU CC to use a compatible convention for all structure and
union returning with the option @samp{-fpcc-struct-return}.
@end itemize

There are also system-specific incompatibilities.

@itemize @bullet
@ignore
@c wfs@@nicholas.ma.utexas.edu says that this problem is solved 
@c provided alloca always adds 0x60 extra bytes to form a new save area
@c and avoids overlapping the old one.  And it seems that GCC
@c already does this.  So he thinks this problem is gone.

@item 
@cindex Sparc
The Sparc version of @code{setjmp} interacts badly with unexpected stack
adjustments.  With rare exceptions, you cannot use @code{setjmp} in a
function which moves the stack pointer.

In the current version of GNU CC, there are two ways that the stack
pointer can change value: (1) calls to @code{alloca}, and (2) use of
variable-sized objects.  You should avoid both in functions that call
@code{setjmp}.

The cause of the problem is the way that Sun implemented register
windows.  The 96 bytes at addresses @code{%sp} through @code{%sp+95}
correspond to the register window save area.  When a register window
must be spilled, its stack pointer is located, and the registers are
dumped starting at that address.  Similarly, when a register window must
be restored, its stack pointer is located, and the registers are
restored from that address.

When @code{setjmp} is called, the current register window's registers
are saved into the register save area, and the address of this save area
is stored into the @code{jmp_buf}.  Other subsequent function calls
store newer values of the registers into the same save area; that is ok.
When @code{longjmp} is called, the registers are restored using that
address.  (Actually, @emph{all} register windows are restored from all
valid register windows at the time @code{longjmp} is called.)

This scheme assumes that the stack pointer does not change after the
call to @code{setjmp}.  If the pointer changes, @code{longjmp} will
restore using the old stack value, which may obtain garbage.
@end ignore
@cindex Alliant
@item
On the Alliant, the system's own convention for returning structures
and unions is unusual, and is not compatible with GNU CC no matter
what options are used.

@cindex RT PC
@cindex IBM RT PC
@item
On the IBM RT PC, the MetaWare HighC compiler (hc) uses yet another
convention for structure and union returning.  Use
@samp{-mhc-struct-return} to tell GNU CC to use a convention compatible
with it.

@cindex Vax calling convention
@cindex Ultrix calling convention
@item
On Ultrix, the Fortran compiler expects registers 2 through 5 to be saved
by function calls.  However, the C compiler uses conventions compatible
with BSD Unix: registers 2 through 5 may be clobbered by function calls.

GNU CC uses the same convention as the Ultrix C compiler.  You can use
these options to produce code compatible with the Fortran compiler:

@smallexample
-fcall-saved-r2 -fcall-saved-r3 -fcall-saved-r4 -fcall-saved-r5
@end smallexample

@item
@cindex DBX
DBX rejects some files produced by GNU CC, though it accepts similar
constructs in output from PCC.  Until someone can supply a coherent
description of what is valid DBX input and what is not, there is
nothing I can do about these problems.  You are on your own.
@end itemize

@include extend.texi

@node Bugs, VMS, Extensions, Top
@chapter Reporting Bugs
@cindex bugs
@cindex reporting bugs

Your bug reports play an essential role in making GNU CC reliable.

When you encounter a problem, the first thing to do is to see if it is
already known.  @xref{Trouble}.  Also look in @ref{Incompatibilities}.
If it isn't known, then you should report the problem.

Reporting a bug may help you by bringing a solution to your problem, or
it may not.  (If it does not, look in the service directory; see
@ref{Service}.)  In any case, the principal function of a bug report is
to help the entire community by making the next version of GNU CC work
better.  Bug reports are your contribution to the maintenance of GNU CC.

In order for a bug report to serve its purpose, you must include the
information that makes for fixing the bug.

@menu
* Criteria:  Bug Criteria.   Have you really found a bug?
* Reporting: Bug Reporting.  How to report a bug effectively.
* Non-bugs::                 Some things we think are not problems.
* Known: Trouble.            Known problems.
* Help: Service.             Where to ask for help.
@end menu

@node Bug Criteria, Bug Reporting, Bugs, Bugs
@section Have You Found a Bug?
@cindex bug criteria

If you are not sure whether you have found a bug, here are some guidelines:

@itemize @bullet
@cindex fatal signal
@cindex core dump
@item
If the compiler gets a fatal signal, for any input whatever, that is a
compiler bug.  Reliable compilers never crash.

@cindex invalid assembly code
@cindex assembly code, invalid
@item
If the compiler produces invalid assembly code, for any input whatever
(except an @code{asm} statement), that is a compiler bug, unless the
compiler reports errors (not just warnings) which would ordinarily
prevent the assembler from being run.

@cindex undefined behavior
@cindex undefined function value
@cindex increment operators
@item
If the compiler produces valid assembly code that does not correctly
execute the input source code, that is a compiler bug.

However, you must double-check to make sure, because you may have run
into an incompatibility between GNU C and traditional C
(@pxref{Incompatibilities}).  These incompatibilities might be considered
bugs, but they are inescapable consequences of valuable features.

Or you may have a program whose behavior is undefined, which happened
by chance to give the desired results with another C compiler.

For example, in many nonoptimizing compilers, you can write @samp{x;}
at the end of a function instead of @samp{return x;}, with the same
results.  But the value of the function is undefined if @code{return}
is omitted; it is not a bug when GNU CC produces different results.

Problems often result from expressions with two increment operators,
as in @code{f (*p++, *p++)}.  Your previous compiler might have
interpreted that expression the way you intended; GNU CC might
interpret it another way.  Neither compiler is wrong.  The bug is
in your code.

After you have localized the error to a single source line, it should
be easy to check for these things.  If your program is correct and
well defined, you have found a compiler bug.

@item
If the compiler produces an error message for valid input, that is a
compiler bug.

Note that the following is not valid input, and the error message for
it is not a bug:

@example
int foo (char);

int
foo (x)
     char x;
@{ @dots{} @}
@end example

@noindent
The prototype says to pass a @code{char}, while the definition says to
pass an @code{int} and treat the value as a @code{char}.  This is what
the ANSI standard says, and it makes sense.

@cindex invalid input
@item
If the compiler does not produce an error message for invalid input,
that is a compiler bug.  However, you should note that your idea of
``invalid input'' might be my idea of ``an extension'' or ``support
for traditional practice''.

@item
If you are an experienced user of C compilers, your suggestions
for improvement of GNU CC are welcome in any case.
@end itemize

@node Bug Reporting, Non-bugs, Bug Criteria, Bugs
@section How to Report Bugs
@cindex bug reports
@cindex compiler bugs, reporting

Send bug reports for GNU C to one of these addresses:

@example
bug-gcc@@prep.ai.mit.edu
@{ucbvax|mit-eddie|uunet@}!prep.ai.mit.edu!bug-gcc
@end example

@strong{Do not send bug reports to @samp{help-gcc}, or to the newsgroup
@samp{gnu.gcc.help}.} Most users of GNU CC do not want to receive bug
reports.  Those that do, have asked to be on @samp{bug-gcc}.

The mailing list @samp{bug-gcc} has a newsgroup which serves as a
repeater.  The mailing list and the newsgroup carry exactly the same
messages.  Often people think of posting bug reports to the newsgroup
instead of mailing them.  This appears to work, but it has one problem
which can be crucial: a newsgroup posting does not contain a mail path
back to the sender.  Thus, if I need to ask for more information, I
may be unable to reach you.  For this reason, it is better to send bug
reports to the mailing list.

As a last resort, send bug reports on paper to:

@example
GNU Compiler Bugs
Free Software Foundation
675 Mass Ave
Cambridge, MA 02139
@end example

The fundamental principle of reporting bugs usefully is this:
@strong{report all the facts}.  If you are not sure whether to state a
fact or leave it out, state it!

Often people omit facts because they think they know what causes the
problem and they conclude that some details don't matter.  Thus, you might
assume that the name of the variable you use in an example does not matter.
Well, probably it doesn't, but one cannot be sure.  Perhaps the bug is a
stray memory reference which happens to fetch from the location where that
name is stored in memory; perhaps, if the name were different, the contents
of that location would fool the compiler into doing the right thing despite
the bug.  Play it safe and give a specific, complete example.  That is the
easiest thing for you to do, and the most helpful.

Keep in mind that the purpose of a bug report is to enable me to fix
the bug if it is not known.  It isn't very important what happens if
the bug is already known.  Therefore, always write your bug reports on
the assumption that the bug is not known.

Sometimes people give a few sketchy facts and ask, ``Does this ring a
bell?''  Those bug reports are useless, and I urge everyone to
@emph{refuse to respond to them} except to chide the sender to report
bugs properly.

To enable me to fix the bug, you should include all these things:

@itemize @bullet
@item
The version of GNU CC.  You can get this by running it with the
@samp{-v} option.

Without this, I won't know whether there is any point in looking for
the bug in the current version of GNU CC.

@item
A complete input file that will reproduce the bug.  If the bug is in
the C preprocessor, send me a source file and any header files that it
requires.  If the bug is in the compiler proper (@file{cc1}), run your
source file through the C preprocessor by doing @samp{gcc -E
@var{sourcefile} > @var{outfile}}, then include the contents of
@var{outfile} in the bug report.  (Any @samp{-I}, @samp{-D} or
@samp{-U} options that you used in actual compilation should also be
used when doing this.)

A single statement is not enough of an example.  In order to compile
it, it must be embedded in a function definition; and the bug might
depend on the details of how this is done.

Without a real example I can compile, all I can do about your bug
report is wish you luck.  It would be futile to try to guess how to
provoke the bug.  For example, bugs in register allocation and
reloading frequently depend on every little detail of the function
they happen in.

@item
The command arguments you gave GNU CC to compile that example and
observe the bug.  For example, did you use @samp{-O}?  To guarantee
you won't omit something important, list them all.

If I were to try to guess the arguments, I would probably guess wrong
and then I would not encounter the bug.

@item
The type of machine you are using, and the operating system name and
version number.

@item
The operands you gave to the @code{configure} command when you installed
the compiler.

@item
A description of what behavior you observe that you believe is
incorrect.  For example, ``It gets a fatal signal,'' or, ``There is an
incorrect assembler instruction in the output.''

Of course, if the bug is that the compiler gets a fatal signal, then I
will certainly notice it.  But if the bug is incorrect output, I might
not notice unless it is glaringly wrong.  I won't study all the
assembler code from a 50-line C program just on the off chance that it
might be wrong.

Even if the problem you experience is a fatal signal, you should still
say so explicitly.  Suppose something strange is going on, such as,
your copy of the compiler is out of synch, or you have encountered a
bug in the C library on your system.  (This has happened!)  Your copy
might crash and mine would not.  If you @i{told} me to expect a crash,
then when mine fails to crash, I would know that the bug was not
happening for me.  If you had not told me to expect a crash, then I
would not be able to draw any conclusion from my observations.

Often the observed symptom is incorrect output when your program is run.
Sad to say, this is not enough information for me unless the program is
short and simple.  If you send me a large program, I don't have time to
figure out how it would work if compiled correctly, much less which line
of it was compiled wrong.  So you will have to do that.  Tell me which
source line it is, and what incorrect result happens when that line is
executed.  A person who understands the program can find this as
easily as a bug in the program itself.

@item
If you send me examples of output from GNU CC, please use @samp{-g}
when you make them.  The debugging information includes source line
numbers which are essential for correlating the output with the input.

@item
If you wish to suggest changes to the GNU CC source, send me context
diffs.  If you even discuss something in the GNU CC source, refer to
it by context, not by line number.

The line numbers in my development sources don't match those in your
sources.  Your line numbers would convey no useful information to me.

@item
Additional information from a debugger might enable me to find
a problem on a machine which I do not have available myself.
However, you need to think when you collect this information if
you want it to have any chance of being useful.

@cindex backtrace for bug reports
For example, many people send just a backtrace, but that is never
useful by itself.  A simple backtrace with arguments conveys little
about GNU CC because the compiler is largely data-driven; the same
functions are called over and over for different RTL insns, doing
different things depending on the details of the insn.

Most of the arguments listed in the backtrace are useless because they
are pointers to RTL list structure.  The numeric values of the
pointers, which the debugger prints in the backtrace, have no
significance whatever; all that matters is the contents of the objects
they point to (and most of the contents are other such pointers).

In addition, most compiler passes consist of one or more loops that
scan the RTL insn sequence.  The most vital piece of information about
such a loop---which insn it has reached---is usually in a local variable,
not in an argument.

@findex debug_rtx
What you need to provide in addition to a backtrace are the values of
the local variables for several stack frames up.  When a local
variable or an argument is an RTX, first print its value and then use
the GDB command @code{pr} to print the RTL expression that it points
to.  (If GDB doesn't run on your machine, use your debugger to call
the function @code{debug_rtx} with the RTX as an argument.)  In
general, whenever a variable is a pointer, its value is no use
without the data it points to.

In addition, include a debugging dump from just before the pass
in which the crash happens.  Most bugs involve a series of insns,
not just one.
@end itemize

Here are some things that are not necessary:

@itemize @bullet
@item
A description of the envelope of the bug.

Often people who encounter a bug spend a lot of time investigating
which changes to the input file will make the bug go away and which
changes will not affect it.

This is often time consuming and not very useful, because the way I
will find the bug is by running a single example under the debugger
with breakpoints, not by pure deduction from a series of examples.
I recommend that you save your time for something else.

Of course, if you can find a simpler example to report @emph{instead}
of the original one, that is a convenience for me.  Errors in the
output will be easier to spot, running under the debugger will take
less time, etc.  Most GNU CC bugs involve just one function, so the
most straightforward way to simplify an example is to delete all the
function definitions except the one where the bug occurs.  Those
earlier in the file may be replaced by external declarations if the
crucial function depends on them.  (Exception: inline functions may
affect compilation of functions defined later in the file.)

However, simplification is not vital; if you don't want to do this,
report the bug anyway and send me the entire test case you used.

@item
A patch for the bug.

A patch for the bug does help me if it is a good one.  But don't omit
the necessary information, such as the test case, on the assumption that
a patch is all I need.  I might see problems with your patch and decide
to fix the problem another way, or I might not understand it at all.

Sometimes with a program as complicated as GNU CC it is very hard to
construct an example that will make the program follow a certain path
through the code.  If you don't send me the example, I won't be able
to construct one, so I won't be able to verify that the bug is fixed.

And if I can't understand what bug you are trying to fix, or why your
patch should be an improvement, I won't install it.  A test case will
help me to understand.

@item
A guess about what the bug is or what it depends on.

Such guesses are usually wrong.  Even I can't guess right about such
things without first using the debugger to find the facts.
@end itemize

@node Non-bugs,, Bug Reporting, Bugs
@section Certain Changes We Don't Want to Make

This section lists changes that people frequently request, but which
we do not make because we think GNU CC is better without them.

@itemize @bullet
@item 
Checking the number and type of arguments to a function which has an
old-fashioned definition and no prototype.

Such a feature would work only occasionally---only for calls that appear
in the same file as the called function, following the definition.  The
only way to check all calls reliably is to add a prototype for the
function.  But adding a prototype will eliminate the need for this
feature.  So the feature is not worthwhile.

@item 
Warning about using an expression whose type is signed as a shift count.

Shift count operands are probably signed more often than unsigned.
Warning about this would cause far more annoyance than good.

@item
Warning about assigning a signed value to an unsigned variable.

Such assignments must be very common; warning about them would cause
more annoyance than good.

@item
Making bitfields unsigned by default on particular machines where ``the
ABI standard'' says to do so.

The ANSI C standard leaves it up to the implementation whether a bitfield
declared plain @code{int} is signed or not.  This in effect creates two
alternative dialects of C.

The GNU C compiler supports both dialects; you can specify the dialect
you want with the option @samp{-fsigned-bitfields} or
@samp{-funsigned-bitfields}.  However, this leaves open the question
of which dialect to use by default.

Currently, the preferred dialect makes plain bitfields signed, because
this is simplest.  Since @code{int} is the same as @code{signed int} in
every other context, it is cleanest for them to be the same in bitfields
as well.

Some computer manufacturers have published Application Binary Interface
standards which specify that plain bitfields should be unsigned.  It is
a mistake, however, to say anything about this issue in an ABI.  This is
because the handling of plain bitfields distinguishes two dialects of C.
Both dialects are meaningful on every type of machine.  Whether a
particular object file was compiled using signed bitfields or unsigned
is of no concern to functions in any other object file, even if they
access the same bitfields in the same data structures.

A given program is written in one or the other of these two dialects.
The program stands a chance to work on most any machine if it is
compiled with the proper dialect.  It is unlikely to work at all if
compiled with the wrong dialect.

Many users appreciate the GNU C compiler because it provides an
environment that is uniform across machines.  These users would be
inconvenienced if the compiler treated plain bitfields differently on
certain machines.

Occasionally users write programs intended only for a particular machine
type.  On these occasions, the users would benefit if the GNU C compiler
were to support by default the same dialect as the other compilers on
that machine.  But such applications are rare.  And users writing a
program to run on more than one type of machine cannot possibly benefit
from this kind of compatibility.

This is why GNU CC does and will treat plain bitfields in the same
fashion on all types of machines (by default).

(Of course, users strongly concerned about portability should indicate
explicitly in each bitfield whether it is signed or not.)

@item
Undefining @code{__STDC__} when @samp{-ansi} is not used.

Currently, GNU CC defines @code{__STDC__} as long as you don't use
@samp{-traditional}.  This provides good results in practice.

Programmers normally use conditionals on @code{__STDC__} to ask whether
it is safe to use certain features of ANSI C, such as function
prototypes or ANSI token concatenation.  Since plain @samp{gcc} supports
all the features of ANSI C, the correct answer to these questions is
``yes''.

Some users try to use @code{__STDC__} to check for the availability of
certain library facilities.  This is actually incorrect usage in an ANSI
C program, because the ANSI C standard says that a conforming
freestanding implementation should define @code{__STDC__} even though it
does not have the library facilities.  @samp{gcc -ansi -pedantic} is a
conforming freestanding implementation, and it is therefore required to
define @code{__STDC__}, even though it does not come with an ANSI C
library.

Sometimes people say that defining @code{__STDC__} in a compiler that
does not completely conform to the ANSI C standard somehow violates the
standard.  This is illogical.  The standard is a standard for compilers
that are supposed to conform.  It says nothing about what any other
compilers should do.  Whatever the ANSI C standard says is relevant to
the design of plain @samp{gcc} without @samp{-ansi} only for pragmatic
reasons, not as a requirement.

@item
Undefining @code{__STDC__} in C++.

Programs written to compile with C++-to-C translators get the
value of @code{__STDC__} that goes with the C compiler that is
subsequently used.  These programs must test @code{__STDC__}
to determine what kind of C preprocessor that compiler uses:
whether they should concatenate tokens in the ANSI C fashion
or in the traditional fashion.

These programs work properly with GNU C++ if @code{__STDC__} is defined.
They would not work otherwise.

In addition, many header files are written to provide prototypes in ANSI
C but not in traditional C.  Many of these header files can work without
change in C++ provided @code{__STDC__} is defined.  If @code{__STDC__}
is not defined, they will all fail, and will all need to be changed to
test explicitly for C++ as well.
@end itemize

@ifset INTERNALS
@node VMS, Portability, Bugs, Top
@chapter Using GNU CC on VMS
@end ifset
@ifclear INTERNALS
@node VMS, Index, Bugs, Top
@chapter Using GNU CC on VMS
@end ifclear

@menu
* Include Files and VMS::  Where the preprocessor looks for the include files.
* Global Declarations::    How to do globaldef, globalref and globalvalue with
                           GNU CC.
* VMS Misc::		   Misc information.
@end menu

@node Include Files and VMS, Global Declarations, VMS, VMS 
@section Include Files and VMS

@cindex include files and VMS
@cindex VMS and include files
@cindex header files and VMS
Due to the differences between the filesystems of Unix and VMS, GNU CC
attempts to translate file names in @samp{#include} into names that VMS
will understand.  The basic strategy is to prepend a prefix to the
specification of the include file, convert the whole filename to a VMS
filename, and then try to open the file.  GNU CC tries various prefixes
one by one until one of them succeeds:

@enumerate
@item
The first prefix is the @samp{GNU_CC_INCLUDE:} logical name: this is
where GNU C header files are traditionally stored.  If you wish to store
header files in non-standard locations, then you can assign the logical
@samp{GNU_CC_INCLUDE} to be a search list, where each element of the
list is suitable for use with a rooted logical.

@item
The next prefix tried is @samp{SYS$SYSROOT:[SYSLIB.]}.  This is where
VAX-C header files are traditionally stored.

@item 
If the include file specification by itself is a valid VMS filename, the
preprocessor then uses this name with no prefix in an attempt to open
the include file.

@item
If the file specification is not a valid VMS filename (i.e. does not
contain a device or a directory specifier, and contains a @samp{/}
character), the preprocessor tries to convert it from Unix syntax to 
VMS syntax.

Conversion works like this: the first directory name becomes a device,
and the rest of the directories are converted into VMS-format directory
names.  For example, @file{X11/foobar.h} is translated to
@file{X11:[000000]foobar.h} or @file{X11:foobar.h}, whichever one can be
opened.  This strategy allows you to assign a logical name to point to
the actual location of the header files.

@item
If none of these strategies succeeds, the @samp{#include} fails.
@end enumerate

Include directives of the form:

@example
#include foobar
@end example

@noindent
are a common source of incompatibility between VAX-C and GNU CC.  VAX-C
treats this much like a standard @code{#include <foobar.h>} directive.
That is incompatible with the ANSI C behavior implemented by GNU CC: to
expand the name @code{foobar} as a macro.  Macro expansion should
eventually yield one of the two standard formats for @code{#include}:

@example
#include "@var{file}"
#include <@var{file}>
@end example

If you have this problem, the best solution is to modify the source to
convert the @code{#include} directives to one of the two standard forms.
That will work with either compiler.  If you want a quick and dirty fix,
define the file names as macros with the proper expansion, like this:

@example
#define stdio <stdio.h>
@end example

@noindent
This will work, as long as the name doesn't conflict with anything else
in the program.

Another source of incompatibility is that VAX-C assumes that:

@example
#include "foobar"
@end example

@noindent
is actually asking for the file @file{foobar.h}.  GNU CC does not
make this assumption, and instead takes what you ask for literally;
it tries to read the file @file{foobar}.  The best way to avoid this
problem is to always specify the desired file extension in your include
directives.

GNU CC for VMS is distributed with a set of include files that is
sufficient to compile most general purpose programs.  Even though the
GNU CC distribution does not contain header files to define constants
and structures for some VMS system-specific functions, there is no
reason why you cannot use GNU CC with any of these functions.  You first
may have to generate or create header files, either by using the public
domain utility @code{UNSDL} (which can be found on a DECUS tape), or by
extracting the relevant modules from one of the system macro libraries,
and using an editor to construct a C header file.

@node Global Declarations, VMS Misc, Include Files and VMS, VMS
@section Global Declarations and VMS

@findex GLOBALREF
@findex GLOBALDEF
@findex GLOBALVALUEDEF
@findex GLOBALVALUEREF
GNU CC does not provide the @code{globalref}, @code{globaldef} and
@code{globalvalue} keywords of VAX-C.  You can get the same effect with
an obscure feature of GAS, the GNU assembler.  (This requires GAS
version 1.39 or later.)  The following macros allow you to use this
feature in a fairly natural way:

@smallexample
#ifdef __GNUC__
#define GLOBALREF(NAME) \
        NAME asm("_$$PsectAttributes_GLOBALSYMBOL$$" #NAME  )
#define GLOBALDEF(NAME,VALUE) \
        NAME asm("_$$PsectAttributes_GLOBALSYMBOL$$" #NAME  ) = VALUE
#define GLOBALVALUEREF(NAME) \
  const NAME [1] asm("_$$PsectAttributes_GLOBALVALUE$$" #NAME  )
#define GLOBALVALUEDEF(NAME,VALUE) \
  const NAME [1] asm("_$$PsectAttributes_GLOBALVALUE$$" #NAME  ) = @{VALUE@}
#else
#define GLOBALREF(NAME) globalref NAME
#define GLOBALDEF(NAME,VALUE) globaldef NAME = VALUE
#define GLOBALVALUEDEF(NAME,VALUE) globalvalue NAME = VALUE
#define GLOBALVALUEREF(NAME) globalvalue NAME
#endif
@end smallexample

@noindent
(The @code{_$$PsectAttributes_GLOBALSYMBOL} prefix at the start of the
name is removed by the assembler, after it has modified the attributes
of the symbol).  These macros are provided in the VMS binaries
distribution in a header file @file{GNU_HACKS.H}.  An example of the
usage is:

@example
int GLOBALREF (ijk);
int GLOBALDEF (jkl, 0);
@end example

The macros @code{GLOBALREF} and @code{GLOBALDEF} cannot be used
straightforwardly for arrays, since there is no way to insert the array
dimension into the declaration at the right place.  However, you can
declare an array with these macros if you first define a typedef for the
array type, like this:

@example
typedef int intvector[10];
intvector GLOBALREF (foo);
@end example

Array and structure initializers will also break the macros; you can
define the initializer to be a macro of its own, or you can expand the
@code{GLOBALDEF} macro by hand.  You may find a case where you wish to
use the @code{GLOBALDEF} macro with a large array, but you are not
interested in explicitly initializing each element of the array.  In
such cases you can use an initializer like: @code{@{0,@}}, which will
initialize the entire array to @code{0}.

A shortcoming of this implementation is that a variable declared with
@code{GLOBALVALUEREF} or @code{GLOBALVALUEDEF} is always an array.  For
example, the declaration:

@example
int GLOBALVALUEREF(ijk);
@end example

@noindent
declares the variable @code{ijk} as an array of type @code{int [1]}.
This is done because a globalvalue is actually a constant; its ``value''
is what the linker would normally consider an address.  That is not how
an integer value works in C, but it is how an array works.  So treating
the symbol as an array name gives consistent results---with the
exception that the value seems to have the wrong type.  @strong{Don't
try to access an element of the array.}  It doesn't have any elements.
The array ``address'' may not be the address of actual storage.

The fact that the symbol is an array may lead to warnings where the
variable is used.  Insert type casts to avoid the warnings.  Here is an
example; it takes advantage of the ANSI C feature allowing macros that
expand to use the same name as the macro itself.

@example
int GLOBALVALUEREF (ss$_normal);
int GLOBALVALUEDEF (xyzzy,123);
#ifdef __GNUC__
#define ss$_normal ((int) ss$_normal)
#define xyzzy ((int) xyzzy)
#endif
@end example

Don't use @code{globaldef} or @code{globalref} with a variable whose
type is an enumeration type; this is not implemented.  Instead, make the
variable an integer, and use a @code{globalvaluedef} for each of the
enumeration values.  An example of this would be:

@example
#ifdef __GNUC__
int GLOBALDEF (color, 0);
int GLOBALVALUEDEF (RED, 0);
int GLOBALVALUEDEF (BLUE, 1);
int GLOBALVALUEDEF (GREEN, 3);
#else
enum globaldef color @{RED, BLUE, GREEN = 3@};
#endif
@end example

@node VMS Misc, , Global Declarations, VMS
@section Other VMS Issues

@cindex exit status and VMS
@cindex return value of @code{main}
@cindex @code{main} and the exit status
GNU CC automatically arranges for @code{main} to return 1 by default if
you fail to specify an explicit return value.  This will be interpreted
by VMS as a status code indicating a normal successful completion.
Version 1 of GNU CC did not provide this default.

GNU CC on VMS works only with the GNU assembler, GAS.  You need version
1.37 or later of GAS in order to produce value debugging information for
the VMS debugger.  Use the ordinary VMS linker with the object files
produced by GAS.

@cindex shared VMS run time system
@cindex @file{VAXCRTL}
Under previous versions of GNU CC, the generated code would occasionally
give strange results when linked to the sharable @file{VAXCRTL} library.
Now this should work.

A caveat for use of @code{const} global variables: the @code{const}
modifier must be specified in every external declaration of the variable
in all of the source files that use that variable.  Otherwise the linker
will issue warnings about conflicting attributes for the variable.  Your
program will still work despite the warnings, but the variable will be
placed in writable storage.

@cindex name augmentation
@cindex case sensitivity and VMS
@cindex VMS and case sensitivity
The VMS linker does not distinguish between upper and lower case letters
in function and variable names.  However, usual practice in C is to
distinguish case.  Normally GNU CC (by means of the assembler GAS)
implements usual C behavior by augmenting each name that is not all
lower-case.  A name is augmented by truncating it to at most 23
characters and then adding more characters at the end which encode the
case pattern the rest.

Name augmentation yields bad results for programs that use precompiled
libraries (such as Xlib) which were generated by another compiler.  You
can use the compiler option @samp{/NOCASE_HACK} to inhibit augmentation;
it makes external C functions and variables case-independent as is usual
on VMS.  Alternatively, you could write all references to the functions
and variables in such libraries using lower case; this will work on VMS,
but is not portable to other systems.

Function and variable names are handled somewhat differently with GNU
C++.  The GNU C++ compiler performs @dfn{name mangling} on function
names, which means that it adds information to the function name to
describe the data types of the arguments that the function takes. One
result of this is that the name of a function can become very long.
Since the VMS linker only recognizes the first 31 characters in a name,
special action is taken to ensure that each function and variable has a
unique name that can be represented in 31 characters.

If the name (plus a name augmentation, if required) is less than 32
characters in length, then no special action is performed. If the name
is longer than 31 characters, the assembler (GAS) will generate a
hash string based upon the function name, truncate the function name to
23 characters, and append the hash string to the truncated name.  If the
@samp{/VERBOSE} compiler option is used, the assembler will print both
the full and truncated names of each symbol that is truncated.

The @samp{/NOCASE_HACK} compiler option should not be used when you are
compiling programs that use libg++. libg++ has several instances of
objects (i.e.  @code{Filebuf} and @code{filebuf}) which become
indistinguishable in a case-insensitive environment.  This leads to
cases where you need to inhibit augmentation selectively (if you were
using libg++ and Xlib in the same program, for example).  There is no
special feature for doing this, but you can get the result by defining a
macro for each mixed case symbol for which you wish to inhibit
augmentation.  The macro should expand into the lower case equivalent of
itself.  For example:

@example
#define StuDlyCapS studlycaps
@end example

These macro definitions can be placed in a header file to minimize the
number of changes to your source code.

@ifset INTERNALS
@node Portability, Interface, VMS, Top
@chapter GNU CC and Portability
@cindex portability
@cindex GNU CC and portability

The main goal of GNU CC was to make a good, fast compiler for machines in
the class that the GNU system aims to run on: 32-bit machines that address
8-bit bytes and have several general registers.  Elegance, theoretical
power and simplicity are only secondary.

GNU CC gets most of the information about the target machine from a machine
description which gives an algebraic formula for each of the machine's
instructions.  This is a very clean way to describe the target.  But when
the compiler needs information that is difficult to express in this
fashion, I have not hesitated to define an ad-hoc parameter to the machine
description.  The purpose of portability is to reduce the total work needed
on the compiler; it was not of interest for its own sake.

@cindex endianness
@cindex autoincrement addressing, availability
@findex abort
GNU CC does not contain machine dependent code, but it does contain code
that depends on machine parameters such as endianness (whether the most
significant byte has the highest or lowest address of the bytes in a word)
and the availability of autoincrement addressing.  In the RTL-generation
pass, it is often necessary to have multiple strategies for generating code
for a particular kind of syntax tree, strategies that are usable for different
combinations of parameters.  Often I have not tried to address all possible
cases, but only the common ones or only the ones that I have encountered.
As a result, a new target may require additional strategies.  You will know
if this happens because the compiler will call @code{abort}.  Fortunately,
the new strategies can be added in a machine-independent fashion, and will
affect only the target machines that need them.
@end ifset

@ifset INTERNALS
@node Interface, Passes, Portability, Top
@chapter Interfacing to GNU CC Output
@cindex interfacing to GNU CC output
@cindex run-time conventions
@cindex function call conventions
@cindex conventions, run-time

GNU CC is normally configured to use the same function calling convention
normally in use on the target system.  This is done with the
machine-description macros described (@pxref{Machine Macros}).

@cindex unions, returning
@cindex structures, returning
@cindex returning structures and unions
However, returning of structure and union values is done differently on
some target machines.  As a result, functions compiled with PCC
returning such types cannot be called from code compiled with GNU CC,
and vice versa.  This does not cause trouble often because few Unix
library routines return structures or unions.

GNU CC code returns structures and unions that are 1, 2, 4 or 8 bytes
long in the same registers used for @code{int} or @code{double} return
values.  (GNU CC typically allocates variables of such types in
registers also.)  Structures and unions of other sizes are returned by
storing them into an address passed by the caller (usually in a
register).  The machine-description macros @code{STRUCT_VALUE} and
@code{STRUCT_INCOMING_VALUE} tell GNU CC where to pass this address.

By contrast, PCC on most target machines returns structures and unions
of any size by copying the data into an area of static storage, and then
returning the address of that storage as if it were a pointer value.
The caller must copy the data from that memory area to the place where
the value is wanted.  This is slower than the method used by GNU CC, and
fails to be reentrant.

On some target machines, such as RISC machines and the 80386, the
standard system convention is to pass to the subroutine the address of
where to return the value.  On these machines, GNU CC has been
configured to be compatible with the standard compiler, when this method
is used.  It may not be compatible for structures of 1, 2, 4 or 8 bytes.

@cindex argument passing
@cindex passing arguments
GNU CC uses the system's standard convention for passing arguments.  On
some machines, the first few arguments are passed in registers; in
others, all are passed on the stack.  It would be possible to use
registers for argument passing on any machine, and this would probably
result in a significant speedup.  But the result would be complete
incompatibility with code that follows the standard convention.  So this
change is practical only if you are switching to GNU CC as the sole C
compiler for the system.  We may implement register argument passing on
certain machines once we have a complete GNU system so that we can
compile the libraries with GNU CC.

On some machines (particularly the Sparc), certain types of arguments
are passed ``by invisible reference''.  This means that the value is
stored in memory, and the address of the memory location is passed to
the subroutine.

@cindex @code{longjmp} and automatic variables
If you use @code{longjmp}, beware of automatic variables.  ANSI C says that
automatic variables that are not declared @code{volatile} have undefined
values after a @code{longjmp}.  And this is all GNU CC promises to do,
because it is very difficult to restore register variables correctly, and
one of GNU CC's features is that it can put variables in registers without
your asking it to.

If you want a variable to be unaltered by @code{longjmp}, and you don't
want to write @code{volatile} because old C compilers don't accept it,
just take the address of the variable.  If a variable's address is ever
taken, even if just to compute it and ignore it, then the variable cannot
go in a register:

@example
@{
  int careful;
  &careful;
  @dots{}
@}
@end example

@cindex arithmetic libraries
@cindex math libraries
Code compiled with GNU CC may call certain library routines.  Most of
them handle arithmetic for which there are no instructions.  This
includes multiply and divide on some machines, and floating point
operations on any machine for which floating point support is disabled
with @samp{-msoft-float}.  Some standard parts of the C library, such as
@code{bcopy} or @code{memcpy}, are also called automatically.  The usual
function call interface is used for calling the library routines.

These library routines should be defined in the library @file{libgcc.a},
which GNU CC automatically searches whenever it links a program.  On
machines that have multiply and divide instructions, if hardware
floating point is in use, normally @file{libgcc.a} is not needed, but it
is searched just in case.

Each arithmetic function is defined in @file{libgcc1.c} to use the
corresponding C arithmetic operator.  As long as the file is compiled
with another C compiler, which supports all the C arithmetic operators,
this file will work portably.  However, @file{libgcc1.c} does not work if
compiled with GNU CC, because each arithmetic function would compile
into a call to itself!
@end ifset

@ifset INTERNALS
@node Passes, RTL, Interface, Top
@chapter Passes and Files of the Compiler
@cindex passes and files of the compiler
@cindex files and passes of the compiler
@cindex compiler passes and files

@cindex top level of compiler
The overall control structure of the compiler is in @file{toplev.c}.  This
file is responsible for initialization, decoding arguments, opening and
closing files, and sequencing the passes.

@cindex parsing pass
The parsing pass is invoked only once, to parse the entire input.  The RTL
intermediate code for a function is generated as the function is parsed, a
statement at a time.  Each statement is read in as a syntax tree and then
converted to RTL; then the storage for the tree for the statement is
reclaimed.  Storage for types (and the expressions for their sizes),
declarations, and a representation of the binding contours and how they nest,
remain until the function is finished being compiled; these are all needed
to output the debugging information.

@findex rest_of_compilation
@findex rest_of_decl_compilation
Each time the parsing pass reads a complete function definition or
top-level declaration, it calls the function
@code{rest_of_compilation} or @code{rest_of_decl_compilation} in
@file{toplev.c}, which are responsible for all further processing
necessary, ending with output of the assembler language.  All other
compiler passes run, in sequence, within @code{rest_of_compilation}.
When that function returns from compiling a function definition, the
storage used for that function definition's compilation is entirely
freed, unless it is an inline function (@pxref{Inline}).

Here is a list of all the passes of the compiler and their source files.
Also included is a description of where debugging dumps can be requested
with @samp{-d} options.

@itemize @bullet
@item
Parsing.  This pass reads the entire text of a function definition,
constructing partial syntax trees.  This and RTL generation are no longer
truly separate passes (formerly they were), but it is easier to think
of them as separate.

The tree representation does not entirely follow C syntax, because it is
intended to support other languages as well.

Language-specific data type analysis is also done in this pass, and every
tree node that represents an expression has a data type attached.
Variables are represented as declaration nodes.

@cindex constant folding
@cindex arithmetic simplifications
@cindex simplifications, arithmetic
Constant folding and some arithmetic simplifications are also done
during this pass.

The language-independent source files for parsing are
@file{stor-layout.c}, @file{fold-const.c}, and @file{tree.c}.
There are also header files @file{tree.h} and @file{tree.def}
which define the format of the tree representation.@refill

The source files for parsing C are @file{c-parse.y}, @file{c-decl.c},
@file{c-typeck.c}, @file{c-convert.c}, @file{c-lang.c}, and
@file{c-aux-info.c} along with header files @file{c-lex.h}, and
@file{c-tree.h}.

The source files for parsing C++ are @file{cp-parse.y},
@file{cp-class.c}, @file{cp-cvt.c},@*
@file{cp-decl.c}, @file{cp-decl.c}, @file{cp-decl2.c},
@file{cp-dem.c}, @file{cp-except.c},@*
@file{cp-expr.c}, @file{cp-init.c}, @file{cp-lex.c},
@file{cp-method.c}, @file{cp-ptree.c},@*
@file{cp-search.c}, @file{cp-tree.c}, @file{cp-type2.c}, and
@file{cp-typeck.c}, along with header files @file{cp-tree.def},
@file{cp-tree.h}, and @file{cp-decl.h}.

The special source files for parsing Objective C are
@file{objc-parse.y}, @file{objc-actions.c}, @file{objc-tree.def}, and
@file{objc-actions.h}.  Certain C-specific files are used for this as
well.

The file @file{c-common.c} is also used for all of the above languages.

@cindex RTL generation
@item
RTL generation.  This is the conversion of syntax tree into RTL code.
It is actually done statement-by-statement during parsing, but for
most purposes it can be thought of as a separate pass.

@cindex target-parameter-dependent code
This is where the bulk of target-parameter-dependent code is found,
since often it is necessary for strategies to apply only when certain
standard kinds of instructions are available.  The purpose of named
instruction patterns is to provide this information to the RTL
generation pass.

@cindex tail recursion optimization
Optimization is done in this pass for @code{if}-conditions that are
comparisons, boolean operations or conditional expressions.  Tail
recursion is detected at this time also.  Decisions are made about how
best to arrange loops and how to output @code{switch} statements.

The source files for RTL generation include @file{stmt.c},
@file{function.c}, @file{expr.c}, @file{calls.c}, @file{explow.c},
@file{expmed.c}, @file{optabs.c} and @file{emit-rtl.c}.  Also, the file
@file{insn-emit.c}, generated from the machine description by the
program @code{genemit}, is used in this pass.  The header file
@file{expr.h} is used for communication within this pass.@refill

@findex genflags
@findex gencodes
The header files @file{insn-flags.h} and @file{insn-codes.h},
generated from the machine description by the programs @code{genflags}
and @code{gencodes}, tell this pass which standard names are available
for use and which patterns correspond to them.@refill

Aside from debugging information output, none of the following passes
refers to the tree structure representation of the function (only
part of which is saved).

@cindex inline, automatic
The decision of whether the function can and should be expanded inline
in its subsequent callers is made at the end of rtl generation.  The
function must meet certain criteria, currently related to the size of
the function and the types and number of parameters it has.  Note that
this function may contain loops, recursive calls to itself
(tail-recursive functions can be inlined!), gotos, in short, all
constructs supported by GNU CC.  The file @file{integrate.c} contains
the code to save a function's rtl for later inlining and to inline that
rtl when the function is called.  The header file @file{integrate.h}
is also used for this purpose.

The option @samp{-dr} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.rtl} to
the input file name.

@cindex jump optimization
@cindex unreachable code
@cindex dead code
@item
Jump optimization.  This pass simplifies jumps to the following
instruction, jumps across jumps, and jumps to jumps.  It deletes
unreferenced labels and unreachable code, except that unreachable code
that contains a loop is not recognized as unreachable in this pass.
(Such loops are deleted later in the basic block analysis.)  It also
converts some code originally written with jumps into sequences of
instructions that directly set values from the results of comparisons,
if the machine has such instructions.

Jump optimization is performed two or three times.  The first time is
immediately following RTL generation.  The second time is after CSE,
but only if CSE says repeated jump optimization is needed.  The
last time is right before the final pass.  That time, cross-jumping
and deletion of no-op move instructions are done together with the
optimizations described above.

The source file of this pass is @file{jump.c}.

The option @samp{-dj} causes a debugging dump of the RTL code after
this pass is run for the first time.  This dump file's name is made by
appending @samp{.jump} to the input file name.

@cindex register use analysis
@item
Register scan.  This pass finds the first and last use of each
register, as a guide for common subexpression elimination.  Its source
is in @file{regclass.c}.

@cindex jump threading
@item
Jump threading.  This pass detects a condition jump that branches to an
identical or inverse test.  Such jumps can be @samp{threaded} through
the second conditional test.  The source code for this pass is in
@file{jump.c}.  This optimization is only performed if
@samp{-fthread-jumps} is enabled.

@cindex common subexpression elimination
@cindex constant propagation
@item
Common subexpression elimination.  This pass also does constant
propagation.  Its source file is @file{cse.c}.  If constant
propagation causes conditional jumps to become unconditional or to
become no-ops, jump optimization is run again when CSE is finished.

The option @samp{-ds} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.cse} to
the input file name.

@cindex loop optimization
@cindex code motion
@cindex strength-reduction
@item
Loop optimization.  This pass moves constant expressions out of loops,
and optionally does strength-reduction and loop unrolling as well.
Its source files are @file{loop.c} and @file{unroll.c}, plus the header
@file{loop.h} used for communication between them.  Loop unrolling uses
some functions in @file{integrate.c} and the header @file{integrate.h}.

The option @samp{-dL} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.loop} to
the input file name.

@item
If @samp{-frerun-cse-after-loop} was enabled, a second common
subexpression elimination pass is performed after the loop optimization
pass.  Jump threading is also done again at this time if it was specified.

The option @samp{-dt} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.cse2} to
the input file name.

@cindex register allocation, stupid
@cindex stupid register allocation
@item
Stupid register allocation is performed at this point in a
nonoptimizing compilation.  It does a little data flow analysis as
well.  When stupid register allocation is in use, the next pass
executed is the reloading pass; the others in between are skipped.
The source file is @file{stupid.c}.

@cindex data flow analysis
@cindex analysis, data flow
@cindex basic blocks
@item
Data flow analysis (@file{flow.c}).  This pass divides the program
into basic blocks (and in the process deletes unreachable loops); then
it computes which pseudo-registers are live at each point in the
program, and makes the first instruction that uses a value point at
the instruction that computed the value.

@cindex autoincrement/decrement analysis
This pass also deletes computations whose results are never used, and
combines memory references with add or subtract instructions to make
autoincrement or autodecrement addressing.

The option @samp{-df} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.flow} to
the input file name.  If stupid register allocation is in use, this
dump file reflects the full results of such allocation.

@cindex instruction combination
@item
Instruction combination (@file{combine.c}).  This pass attempts to
combine groups of two or three instructions that are related by data
flow into single instructions.  It combines the RTL expressions for
the instructions by substitution, simplifies the result using algebra,
and then attempts to match the result against the machine description.

The option @samp{-dc} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.combine}
to the input file name.

@cindex instruction scheduling
@cindex scheduling, instruction
@item
Instruction scheduling (@file{sched.c}).  This pass looks for
instructions whose output will not be available by the time that it is
used in subsequent instructions.  (Memory loads and floating point
instructions often have this behavior on RISC machines).  It re-orders
instructions within a basic block to try to separate the definition and
use of items that otherwise would cause pipeline stalls.

Instruction scheduling is performed twice.  The first time is immediately
after instruction combination and the second is immediately after reload.

The option @samp{-dS} causes a debugging dump of the RTL code after this
pass is run for the first time.  The dump file's name is made by
appending @samp{.sched} to the input file name.

@cindex register class preference pass
@item
Register class preferencing.  The RTL code is scanned to find out
which register class is best for each pseudo register.  The source
file is @file{regclass.c}.

@cindex register allocation
@cindex local register allocation
@item
Local register allocation (@file{local-alloc.c}).  This pass allocates
hard registers to pseudo registers that are used only within one basic
block.  Because the basic block is linear, it can use fast and
powerful techniques to do a very good job.

The option @samp{-dl} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.lreg} to
the input file name.

@cindex global register allocation
@item
Global register allocation (@file{global-alloc.c}).  This pass
allocates hard registers for the remaining pseudo registers (those
whose life spans are not contained in one basic block).

@cindex reloading
@item
Reloading.  This pass renumbers pseudo registers with the hardware
registers numbers they were allocated.  Pseudo registers that did not
get hard registers are replaced with stack slots.  Then it finds
instructions that are invalid because a value has failed to end up in
a register, or has ended up in a register of the wrong kind.  It fixes
up these instructions by reloading the problematical values
temporarily into registers.  Additional instructions are generated to
do the copying.

The reload pass also optionally eliminates the frame pointer and inserts
instructions to save and restore call-clobbered registers around calls.

Source files are @file{reload.c} and @file{reload1.c}, plus the header
@file{reload.h} used for communication between them.

The option @samp{-dg} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.greg} to
the input file name.

@cindex instruction scheduling
@cindex scheduling, instruction
@item
Instruction scheduling is repeated here to try to avoid pipeline stalls
due to memory loads generated for spilled pseudo registers.

The option @samp{-dR} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.sched2}
to the input file name.

@cindex cross-jumping
@cindex no-op move instructions
@item
Jump optimization is repeated, this time including cross-jumping
and deletion of no-op move instructions.

The option @samp{-dJ} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.jump2}
to the input file name.

@cindex delayed branch scheduling
@cindex scheduling, delayed branch
@item
Delayed branch scheduling.  This optional pass attempts to find
instructions that can go into the delay slots of other instructions,
usually jumps and calls.  The source file name is @file{reorg.c}.  

The option @samp{-dd} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.dbr}
to the input file name.

@cindex register-to-stack conversion
@item
Conversion from usage of some hard registers to usage of a register
stack may be done at this point.  Currently, this is supported only
for the floating-point registers of the Intel 80387 coprocessor.   The
source file name is @file{reg-stack.c}.

The options @samp{-dk} causes a debugging dump of the RTL code after
this pass.  This dump file's name is made by appending @samp{.stack}
to the input file name.

@cindex final pass
@cindex peephole optimization
@item
Final.  This pass outputs the assembler code for the function.  It is
also responsible for identifying spurious test and compare
instructions.  Machine-specific peephole optimizations are performed
at the same time.  The function entry and exit sequences are generated
directly as assembler code in this pass; they never exist as RTL.

The source files are @file{final.c} plus @file{insn-output.c}; the
latter is generated automatically from the machine description by the
tool @file{genoutput}.  The header file @file{conditions.h} is used
for communication between these files.

@cindex debugging information generation
@item
Debugging information output.  This is run after final because it must
output the stack slot offsets for pseudo registers that did not get
hard registers.  Source files are @file{dbxout.c} for DBX symbol table
format, @file{sdbout.c} for SDB symbol table format, and
@file{dwarfout.c} for DWARF symbol table format.
@end itemize

Some additional files are used by all or many passes:

@itemize @bullet
@item
Every pass uses @file{machmode.def} and @file{machmode.h} which define
the machine modes.

@item
Several passes use @file{real.h}, which defines the default
representation of floating point constants and how to operate on them.

@item
All the passes that work with RTL use the header files @file{rtl.h}
and @file{rtl.def}, and subroutines in file @file{rtl.c}.  The tools
@code{gen*} also use these files to read and work with the machine
description RTL.

@findex genconfig
@item
Several passes refer to the header file @file{insn-config.h} which
contains a few parameters (C macro definitions) generated
automatically from the machine description RTL by the tool
@code{genconfig}.

@cindex instruction recognizer
@item
Several passes use the instruction recognizer, which consists of
@file{recog.c} and @file{recog.h}, plus the files @file{insn-recog.c}
and @file{insn-extract.c} that are generated automatically from the
machine description by the tools @file{genrecog} and
@file{genextract}.@refill

@item
Several passes use the header files @file{regs.h} which defines the
information recorded about pseudo register usage, and @file{basic-block.h}
which defines the information recorded about basic blocks.

@item
@file{hard-reg-set.h} defines the type @code{HARD_REG_SET}, a bit-vector
with a bit for each hard register, and some macros to manipulate it.
This type is just @code{int} if the machine has few enough hard registers;
otherwise it is an array of @code{int} and some of the macros expand
into loops.

@item
Several passes use instruction attributes.  A definition of the
attributes defined for a particular machine is in file
@file{insn-attr.h}, which is generated from the machine description by
the program @file{genattr}.  The file @file{insn-attrtab.c} contains
subroutines to obtain the attribute values for insns.  It is generated
from the machine description by the program @file{genattrtab}.@refill
@end itemize
@end ifset

@include rtl.texi
@include md.texi
@include tm.texi

@ifset INTERNALS
@node Config, Index, Machine Macros, Top
@chapter The Configuration File
@cindex configuration file
@cindex @file{xm-@var{machine}.h}

The configuration file @file{xm-@var{machine}.h} contains macro
definitions that describe the machine and system on which the compiler
is running, unlike the definitions in @file{@var{machine}.h}, which
describe the machine for which the compiler is producing output.  Most
of the values in @file{xm-@var{machine}.h} are actually the same on all
machines that GNU CC runs on, so large parts of all configuration files
are identical.  But there are some macros that vary:

@table @code
@findex USG
@item USG
Define this macro if the host system is System V.

@findex VMS
@item VMS
Define this macro if the host system is VMS.

@findex FAILURE_EXIT_CODE
@item FAILURE_EXIT_CODE
A C expression for the status code to be returned when the compiler
exits after serious errors.

@findex SUCCESS_EXIT_CODE
@item SUCCESS_EXIT_CODE
A C expression for the status code to be returned when the compiler
exits without serious errors.

@findex HOST_WORDS_BIG_ENDIAN
@item HOST_WORDS_BIG_ENDIAN
Defined if the host machine stores words of multi-word values in
big-endian order.  (GNU CC does not depend on the host byte ordering
within a word.)

@findex HOST_FLOAT_FORMAT
@item HOST_FLOAT_FORMAT
A numeric code distinguishing the floating point format for the host
machine.  See @code{TARGET_FLOAT_FORMAT} in @ref{Storage Layout} for the
alternatives and default.

@findex HOST_BITS_PER_CHAR
@item HOST_BITS_PER_CHAR
A C expression for the number of bits in @code{char} on the host
machine.

@findex HOST_BITS_PER_SHORT
@item HOST_BITS_PER_SHORT
A C expression for the number of bits in @code{short} on the host
machine.

@findex HOST_BITS_PER_INT
@item HOST_BITS_PER_INT
A C expression for the number of bits in @code{int} on the host
machine.

@findex HOST_BITS_PER_LONG
@item HOST_BITS_PER_LONG
A C expression for the number of bits in @code{long} on the host
machine.

@findex ONLY_INT_FIELDS
@item ONLY_INT_FIELDS
Define this macro to indicate that the host compiler only supports
@code{int} bit fields, rather than other integral types, including
@code{enum}, as do most C compilers.

@findex EXECUTABLE_SUFFIX
@item EXECUTABLE_SUFFIX
Define this macro if the host system uses a naming convention for
executable files that involves a common suffix (such as, in some
systems, @samp{.exe}) that must be mentioned explicitly when you run
the program.

@findex OBSTACK_CHUNK_SIZE
@item OBSTACK_CHUNK_SIZE
A C expression for the size of ordinary obstack chunks.
If you don't define this, a usually-reasonable default is used.

@findex OBSTACK_CHUNK_ALLOC
@item OBSTACK_CHUNK_ALLOC
The function used to allocate obstack chunks.
If you don't define this, @code{xmalloc} is used.

@findex OBSTACK_CHUNK_FREE
@item OBSTACK_CHUNK_FREE
The function used to free obstack chunks.
If you don't define this, @code{free} is used.

@findex USE_C_ALLOCA
@item USE_C_ALLOCA
Define this macro to indicate that the compiler is running with the
@code{alloca} implemented in C.  This version of @code{alloca} can be
found in the file @file{alloca.c}; to use it, you must also alter the
@file{Makefile} variable @code{ALLOCA}.  (This is done automatically
for the systems on which we know it is needed.)

If you do define this macro, you should probably do it as follows:

@example
#ifndef __GNUC__
#define USE_C_ALLOCA
#else
#define alloca __builtin_alloca
#endif
@end example

@noindent
so that when the compiler is compiled with GNU CC it uses the more
efficient built-in @code{alloca} function.

@item FUNCTION_CONVERSION_BUG
@findex FUNCTION_CONVERSION_BUG
Define this macro to indicate that the host compiler does not properly
handle converting a function value to a pointer-to-function when it is
used in an expression.
@end table

@findex bzero
@findex bcmp
In addition, configuration files for system V define @code{bcopy},
@code{bzero} and @code{bcmp} as aliases.  Some files define @code{alloca}
as a macro when compiled with GNU CC, in order to take advantage of the
benefit of GNU CC's built-in @code{alloca}.


@node Index,, Config, Top
@unnumbered Index
@end ifset

@ifclear INTERNALS
@node Index,, VMS, Top
@unnumbered Index
@end ifclear

@printindex cp
@contents
@bye
