First cleanup after importation from CVS and misc setup.

* Cleanup: Remove long time unused tools <pcbs>, <grog>, <gcp>, <genview>,
    <growstk>, <ocr> and <vst2xnf>. They may still be recovered by
    reverting to the original 'v5.1' tag.
* Change: In <attila>, remove the CVS checkout part and adapt to the
    slightly different source tree organisation (alliance/alliance/src).
* Setup: Added .gitignore to exclude the files generated "in source" by
    automake (when tools are built).
* New: Small script to perform a complete cppcheck on the whole source
    tree.
This commit is contained in:
Jean-Paul Chaput 2014-02-07 14:08:53 +01:00
parent 06181a9f1d
commit 43da04a7e4
775 changed files with 70 additions and 296784 deletions

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
Linux.*/
Darwin/
Solaris/
Makefile.in
aclocal.m4
autom4te.cache/
config.guess
config.sub
configure
install-sh
ltmain.sh
missing
depcomp
dev/scripts/cppcheck/*

View File

@ -1,11 +1,7 @@
#!/bin/sh
#
# $Id: attila.conf,v 1.16 2012/04/11 13:30:18 alliance Exp $
#
# -*- Mode: Shell-script -*-
#
# /------------------------------------------------------------------\
# | |
# +------------------------------------------------------------------+
# | A l l i a n c e C A D S y s t e m |
# | T o o l I n s t a l l e r |
# | |
@ -13,15 +9,10 @@
# | E-mail : alliance-users@asim.lip6.fr |
# | ================================================================ |
# | sh script : "./attila" |
# | **************************************************************** |
# | U p d a t e s |
# | |
# \------------------------------------------------------------------/
# +------------------------------------------------------------------+
#
# --------------------------------------------------------------------
# Linux Configuration Variables.
@ -55,8 +46,6 @@
LINUX_RH71_CXX="g++3"
# --------------------------------------------------------------------
# Solaris Configuration Variables.
@ -66,8 +55,6 @@
SOLARIS_CXX="/usr/local/bin/g++"
# --------------------------------------------------------------------
# Darwin Configuration Variables.
@ -77,8 +64,6 @@
DARWIN_CXX="g++"
# --------------------------------------------------------------------
# Miscellaneous.

View File

@ -1,76 +1,25 @@
#!/bin/sh
#
# $Id: attila.sh,v 1.27 2012/04/11 13:30:29 alliance Exp $
#
# /------------------------------------------------------------------\
# | |
# +------------------------------------------------------------------+
# | A l l i a n c e C A D S y s t e m |
# | T o o l I n s t a l l e r |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : alliance-users@asim.lip6.fr |
# | E-mail : alliance-users@asim.lip6.fr |
# | ================================================================ |
# | sh script : "./attila" |
# | **************************************************************** |
# | U p d a t e s |
# | $Log: attila.sh,v $
# | Revision 1.27 2012/04/11 13:30:29 alliance
# | Small adjustments.
# |
# | Revision 1.26 2012/01/02 22:30:19 jpc
# | Added support for Scientific Linux 6.
# |
# | Revision 1.25 2008/07/15 16:45:28 xtof
# | do not use Solaris anymore
# |
# | Revision 1.24 2008/07/15 16:34:04 xtof
# | nausicaa -> bip
# |
# | Revision 1.23 2007/11/20 17:51:21 alliance
# |
# | Added support for SLSoC5x (32 & 64 bits).
# |
# | Revision 1.22 2005/10/03 14:44:41 jpc
# |
# | Added support for SLA4x.
# |
# | Revision 1.21 2004/09/06 16:15:31 jpc
# | Added support for Darwin (MacOS X).
# | Added "--devel" argument.
# |
# | Revision 1.20 2004/08/31 08:44:45 jpc
# | Be less strict in the OS guessing : Fedora Core can change the kernel revision
# | number...
# |
# | Revision 1.19 2004/07/29 07:50:31 alliance
# | Adding the dynamic link flag for Alliance libraries when installing for
# | ASIM, since this is required in any case for this type of install
# |
# | Revision 1.18 2004/07/24 22:40:33 jpc
# | La nouvelle config a trois architectures : Linux.FC2, Linux.RH71 et Solaris.
# |
# | Revision 1.17 2003/10/29 16:08:54 xtof
# | changing target machine for installations
# |
# | Revision 1.16 2003/10/03 11:36:00 fred
# | Adding fa: in front of the ATTILA_CVS_ROOT, in order to be able to
# | retrieve Alliance form machines that do not mount the usual disks.
# | |
# \------------------------------------------------------------------/
#
# +------------------------------------------------------------------+
# /------------------------------------------------------------------\
# | |
# +------------------------------------------------------------------+
# | Functions Definitions |
# | |
# \------------------------------------------------------------------/
# +------------------------------------------------------------------+
# --------------------------------------------------------------------
# Function : `print_usage()'.
# Function : "print_usage()".
print_usage ()
{
@ -134,10 +83,8 @@
}
# --------------------------------------------------------------------
# Function : `alc_banner()'.
# Function : "alc_banner()".
alc_banner ()
{
@ -165,9 +112,8 @@
}
# --------------------------------------------------------------------
# Function : `find_self()'.
# Function : "find_self()".
#
# Usage : find_self <program> <tool> <args>
#
@ -184,7 +130,7 @@
# In case of self install, switch to the CVS script.
if [ "$TOOL" = "attila" ]; then
if [ "`basename $PROG`" != "attila.sh" ]; then
SELF="$HOME/alliance/src/attila/src/attila.sh"
SELF="$HOME/alliance/alliance/src/attila/src/attila.sh"
if [ ! -x "$SELF" ]; then
echo "attila: Self install problem, cannot find source file :"
@ -207,9 +153,8 @@
}
# --------------------------------------------------------------------
# Function : `guess_os()'.
# Function : "guess_os()".
guess_os ()
{
@ -234,10 +179,8 @@
}
# --------------------------------------------------------------------
# Function : `guess_gcc()'.
# Function : "guess_gcc()".
guess_gcc ()
{
@ -294,7 +237,7 @@
# --------------------------------------------------------------------
# Function : `switch_os()'.
# Function : "switch_os()".
switch_os ()
{
@ -375,8 +318,6 @@
}
# --------------------------------------------------------------------
# Function : `get_string()'.
@ -388,10 +329,8 @@
}
# --------------------------------------------------------------------
# Function : `norm_dir()'.
# Function : "norm_dir()".
norm_dir()
{
@ -399,7 +338,7 @@
if [ -z "$DIR" ]; then
case "$1" in
"SRC") DIR="$HOME/alliance/src";;
"SRC") DIR="$HOME/alliance/alliance/src";;
"INSTALL") DIR="$HOME/alliance/$ALLIANCE_OS/install";;
*) DIR="$HOME/alliance/$ALLIANCE_OS/build" ;;
esac
@ -416,10 +355,8 @@
}
# --------------------------------------------------------------------
# Function : `make_dir()'.
# Function : "make_dir()".
make_dir()
{
@ -428,71 +365,41 @@
}
# --------------------------------------------------------------------
# Function : `cvs_check()'.
# Function : "source_check()".
cvs_check ()
source_check ()
{
echo " o Checking CVSROOT."
# Check the CVROOT variable.
if [ -z "$CVSROOT" ]; then
echo " - CVROOT is not set. Using defaut $ATTILA_CVSROOT."
CVSROOT="$ATTILA_CVSROOT"; export CVSROOT
else
echo " - Trusting user supplied \$CVSROOT ($CVSROOT)."
fi
cd $HOME
# Check out minimal set of files if needed.
for file in $CVS_STARTUP_FILES; do
if [ ! -f $HOME/alliance/src/$file ]; then
cvs co alliance/src/$file
fi
done
echo " o Checking Sources."
MISSING_TOOLS=""
# Checks for tools sources.
echo " o Checking tools sources."
for TOOL in $TOOLS; do
echo " - $HOME/alliance/src/$TOOL."
echo -n " - $HOME/alliance/alliance/src/$TOOL "
if [ ! -d $HOME/alliance/src/$TOOL ]; then
echo " > The tool directory $TOOL doesn't exist."
echo -n " > Do you want to check it out from the CVS tree ? [y]/n "
LOOP="y"
while [ "$LOOP" = "y" ]; do
read ANSWER
case "$ANSWER" in
"y"|"") ANSWER="y"; LOOP="n";;
"n") LOOP="n";;
*) echo -n " > ";;
esac
done
case "$ANSWER" in
"y") cvs co alliance/src/$TOOL;;
"n") exit 1;;
esac
if [ ! -d $HOME/alliance/alliance/src/$TOOL ]; then
echo "[Not Found]"
MISSING_TOOLS="$MISSING_TOOLS $TOOL"
else
echo "[Found]"
fi
done
if [ ! -z "$MISSING_TOOLS" ]; then
echo " Some tools are missing their sources, please check your git checkout."
exit 1
fi
echo ""
}
# --------------------------------------------------------------------
# Function : `compile_tool()'.
# Function : "compile_tool()".
compile_tool ()
{
# ----------------------------------------------------------------
# Check environment.
@ -547,14 +454,11 @@
echo " - INSTALL_DIR := $INSTALL_DIR"
echo ""
# ------------------------------------------------------------------
# Do the work.
cd $HOME/alliance/src
cd $HOME/alliance/alliance/src
if [ "$ASIM" = "y" ]; then
if [ "$ALLIANCE_OS" = "Linux" ]; then
echo " o For ASIM install, removing $BUILD_DIR & configure"
@ -588,15 +492,15 @@
echo " o Building & installing requested tools."
for TOOL in $TOOLS; do
cd $HOME/alliance/src
cd $HOME/alliance/alliance/src
if [ ! -f "$TOOL/Makefile.in" -o ! -f "$TOOL/configure" ]; then
echo " - Running autostools for $TOOL."
#./autostuff $TOOL
cd $TOOL
aclocal -I . -I ..
if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
#if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
libtoolize --force --copy --automake
fi
#fi
automake --add-missing --copy --foreign
autoconf
cd ..
@ -633,13 +537,9 @@
}
# /------------------------------------------------------------------\
# | |
# +------------------------------------------------------------------+
# | Main Part of the Shell Script |
# | |
# \------------------------------------------------------------------/
# +------------------------------------------------------------------+
ATTILA_ALLIANCE_TOP="__ALLIANCE_INSTALL_DIR__"
@ -649,8 +549,6 @@
# Variables sets in "attila.conf".
CVS_STARTUP_FILES=""
LINUX_slsoc6x_64_TARGET="coriolis"
LINUX_slsoc6x_64_CC="gcc"
LINUX_slsoc6x_64_CXX="g++"
@ -699,7 +597,7 @@
RSH="rsh"
SRC_DIR="alliance/src"
SRC_DIR="alliance/alliance/src"
BUILD_DIR=""
INSTALL_DIR=""
@ -845,7 +743,7 @@
load_conf
cvs_check
source_check
if [ "$FULL" = "y" ]; then
# Recursive call.

View File

@ -1 +0,0 @@
SUBDIRS = src

View File

@ -1,47 +0,0 @@
dnl
/*
dnl This file is part of the Alliance CAD System
dnl Copyright (C) Laboratoire LIP6 - Département ASIM
dnl Universite Pierre et Marie Curie
dnl
dnl Home page : http://www-asim.lip6.fr/alliance/
dnl E-mail : mailto:alliance-users@asim.lip6.fr
dnl
dnl This library is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU Library General Public License as published
dnl by the Free Software Foundation; either version 2 of the License, or (at
dnl your option) any later version.
dnl
dnl Alliance VLSI CAD System is distributed in the hope that it will be
dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
dnl Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with the GNU C Library; see the file COPYING. If not, write to the Free
dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl Purpose : Auto stuffing Alliance
dnl Almost ten years since I wrote this stuff, I just can't
dnl believe it
dnl Date : 01/02/2002
dnl Author : Frederic Petrot <Frederic.Petrot@lip6.fr>
dnl $Id: configure.in,v 1.2 2002/09/30 16:20:18 czo Exp $
dnl
dnl
AC_INIT(src/gcp.h)
AM_INIT_AUTOMAKE(gcp, 1.1)
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_YACC
AM_PROG_LEX
AC_HEADER_STDC
AC_C_CONST
AC_PROG_RANLIB
AM_ALLIANCE
AC_OUTPUT([
Makefile
src/Makefile
])

View File

@ -1,21 +0,0 @@
AM_CFLAGS = @ALLIANCE_CFLAGS@ -I$(top_srcdir)/mbk/src -I$(top_srcdir)/aut/src
lib_LTLIBRARIES = libGcp.la
include_HEADERS = gcp.h
libGcp_la_SOURCES = c_ccomp.y \
c_cdecl.c c_cdecl.h c_clex.c c_clex.h c_common.c c_common.h c_convert.c \
c_convert.h c_ctypeck.c c_ctypeck.h c_debug.c c_debug.h c_expand.c c_expand.h \
c_flags.c c_flags.h c_foldconst.c c_foldconst.h c_gperf.h c_parse.c c_parse.h \
c_stmt.c c_stmt.h c_tree.c c_treecompat.h c_tree.h gcp.h
CLEANFILES = c_ccomp.c c_ccomp.h vbl_bcomp_l.c
EXTRA_DIST = c_ccomp.h
c_ccomp.c c_ccomp.h : $(srcdir)/c_ccomp.y
$(YACC) -d $(YFLAGS) $(srcdir)/c_ccomp.y && sed -e "s/yy/c_y_/g" -e "s/YY/C_Y_/g" y.tab.c > c_ccomp.c && sed -e "s/yy/c_y_/g" -e "s/YY/C_Y_/g" y.tab.h > c_ccomp.h
LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,201 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_cdecl.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_CDECL_H
# define C_CDECL_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
# define C_INT_TYPE_SIZE (sizeof(int )*8)
# define C_CHAR_TYPE_SIZE (sizeof(char)*8)
# define C_LONG_TYPE_SIZE (sizeof(long)*8)
# define C_LONG_LONG_TYPE_SIZE (sizeof(long long int)*8)
# define C_SHORT_TYPE_SIZE (sizeof(short)*8)
# define C_FLOAT_TYPE_SIZE (sizeof(float)*8)
# define C_DOUBLE_TYPE_SIZE (sizeof(double)*8)
# define C_LONG_DOUBLE_TYPE_SIZE (sizeof(long double)*8)
# define C_POINTER_TYPE_SIZE (sizeof(char *)*8)
# define C_POINTER_SIZE C_POINTER_TYPE_SIZE
# define C_HOST_BITS_PER_WIDE_INT (int)C_INT_TYPE_SIZE
# define C_HOST_BITS_PER_LONG (int)C_LONG_TYPE_SIZE
# define C_HOST_BITS_PER_INT (int)C_INT_TYPE_SIZE
# define C_HOST_BITS_PER_CHAR (int)C_CHAR_TYPE_SIZE
# define C_HOST_WIDE_INT int
# define C_WCHAR_TYPE_SIZE C_INT_TYPE_SIZE
# define C_BITS_PER_UNIT C_CHAR_TYPE_SIZE
# define C_WCHAR_BYTES 1
# define C_BYTES_BIG_ENDIAN 0
# define C_BITS_PER_WORD (int)C_INT_TYPE_SIZE
/*------------------------------------------------------------\
| |
| Declar |
| |
\------------------------------------------------------------*/
# define C_CDECL_NORMAL 1
# define C_CDECL_FUNCDEF 2
# define C_CDECL_PARAM 3
# define C_CDECL_FIELD 4
# define C_CDECL_BIT_FIELD 5
# define C_CDECL_TYPENAME 6
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
# define c_resume_momentary(N)
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
typedef struct c_binding_level
{
struct c_binding_level *LEVEL_CHAIN;
c_tree_node *NAME_LIST;
c_tree_node *TAG_LIST;
c_tree_node *SHADOWED_LIST;
c_tree_node *BLOCK_LIST;
c_tree_node *THIS_BLOCK;
c_tree_node *PARAM_LIST;
char PARAM_FLAG;
char KEEP;
char KEEP_IF_SUBBLOCKS;
char TAG_TRANSPARENT;
char N_INCOMPLETE;
char SUBBLOCKS_TAG_TRANSPARENT;
} c_binding_level;
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern c_tree_node *c_tree_program_node;
extern c_tree_node *c_pending_invalid_xref;
extern char *c_pending_invalid_xref_file;
extern int c_pending_invalid_xref_line;
extern c_tree_node *c_current_function_decl;
extern int c_current_function_returns_value;
extern int c_current_function_returns_null;
extern c_tree_node *c_lastiddecl;
extern int c_skip_evaluation;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern c_binding_level * c_alloc_binding_level __P(());
extern int c_global_bindings_p __P(());
extern void c_view_binding __P((c_binding_level *Binding));
extern void c_view_current_binding __P(());
extern void c_clear_parm_order __P(());
extern void c_push_level __P((int tag_transparent));
extern c_tree_node * c_pop_level __P((int keep, int reverse, int functionbody));
extern c_tree_node * c_lookup_name __P((c_tree_node *TreeName));
extern c_tree_node * c_lookup_name_current_level __P((c_tree_node *TreeName));
extern int c_is_self_promoting_args_p __P((c_tree_node *parms));
extern int c_is_chain_member __P((c_tree_node *elem, c_tree_node *chain));
extern c_tree_node * c_push_decl __P((c_tree_node *TreeDecl));
extern void c_push_parm_decl __P((c_tree_node *parm));
extern void c_init_decl_processing __P(());
extern void c_decl_attributes __P((c_tree_node *Node, c_tree_node *Attributes, c_tree_node *Prefix_attributes));
extern c_tree_node * c_grokfield __P((char *Filename, int Line, c_tree_node *Declarator, c_tree_node *Declspecs, c_tree_node *Width));
extern c_tree_node * c_groktypename __P((c_tree_node *Typename));
extern c_tree_node * c_start_decl __P((c_tree_node *Declarator, c_tree_node *Declspecs, int Initialized, c_tree_node *Attributes, c_tree_node *Prefix_attributes));
extern void c_finish_decl __P((c_tree_node *decl, c_tree_node *init, c_tree_node *asmspec_tree));
extern void c_split_specs_attrs __P((c_tree_node *Specs_attrs, c_tree_node **Declspecs, c_tree_node **Prefix_attributes));
extern c_tree_node * c_round_up __P((c_tree_node *value, int divisor));
extern void c_layout_decl __P((c_tree_node *decl, unsigned known_align));
extern void c_layout_type __P((c_tree_node *type));
extern void c_parmlist_tags_warning __P(());
extern void c_declare_parm_level __P((int definition_flag));
extern int c_in_parm_level_p __P(());
extern int c_kept_level_p __P(());
extern void c_push_tag __P((c_tree_node *name, c_tree_node *type));
extern c_tree_node * c_start_struct __P((int code_type, c_tree_node *name));
extern c_tree_node * c_finish_struct __P((c_tree_node *t, c_tree_node *fieldlist, c_tree_node *attributes));
extern c_tree_node * c_xref_tag __P((int code, c_tree_node *name));
extern void c_shadow_tag_warned __P((c_tree_node *declspecs, int warned));
extern void c_shadow_tag __P((c_tree_node *declspecs));
extern c_tree_node * c_shadow_label __P((c_tree_node *name));
extern c_tree_node * c_lookup_label __P((c_tree_node *id));
extern c_tree_node * c_define_label __P((char *filename, int line, c_tree_node *name));
extern c_tree_node * c_start_enum __P((c_tree_node *name));
extern c_tree_node * c_finish_enum __P((c_tree_node *enumtype, c_tree_node *values, c_tree_node *attributes));
extern c_tree_node * c_build_enumerator __P((c_tree_node *name, c_tree_node *value));
extern int c_start_function __P((c_tree_node *declarator, c_tree_node *declspecs, c_tree_node *prefix_attributes, c_tree_node *attributes, int nested));
extern c_tree_node * c_finish_function __P((int nested, c_tree_node *body));
extern c_tree_node * c_get_tags __P(());
extern c_tree_node * c_get_decls __P(());
extern c_tree_node * c_get_parm_info __P((int void_at_end));
extern void c_store_parm_decls __P(());
extern int c_complete_array_type __P((c_tree_node *type, c_tree_node *initial_value, int do_default));
extern c_tree_node * c_implicitly_declare __P((c_tree_node *functionid));
extern void c_c_mark_varargs __P(());
extern void c_mark_varargs __P(());
extern void c_finish_file __P((c_tree_node *TreeNode ));
# endif

File diff suppressed because it is too large Load Diff

View File

@ -1,120 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/* Define constants for communication with c-parse.y.
Copyright (C) 1987, 1992 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
enum rid
{
RID_UNUSED,
RID_INT,
RID_CHAR,
RID_FLOAT,
RID_DOUBLE,
RID_VOID,
RID_UNUSED1,
RID_UNSIGNED,
RID_SHORT,
RID_LONG,
RID_AUTO,
RID_STATIC,
RID_EXTERN,
RID_REGISTER,
RID_TYPEDEF,
RID_SIGNED,
RID_CONST,
RID_VOLATILE,
RID_INLINE,
RID_NOALIAS,
RID_ITERATOR,
RID_COMPLEX,
RID_IN,
RID_OUT,
RID_INOUT,
RID_BYCOPY,
RID_ONEWAY,
RID_ID,
RID_MAX
};
typedef struct c_stmt_or_label
{
c_tree_node *stmt;
int ends_in_label;
} c_stmt_or_label;
#define NORID RID_UNUSED
#define RID_FIRST_MODIFIER RID_UNSIGNED
/* The elements of `ridpointers' are identifier nodes
for the reserved type names and storage classes.
It is indexed by a RID_... value. */
extern c_tree_node *c_ridpointers[(int) RID_MAX];
/* the declaration found for the last IDENTIFIER token read in.
yylex must look this up to detect typedefs, which get token type TYPENAME,
so it is left around in case the identifier is not a typedef but is
used in a context which makes it a reference to a variable. */
extern c_tree_node *c_lastiddecl;
extern char *token_buffer; /* Pointer to token buffer. */
# ifdef LUDO_NO_SKIP
extern tree make_pointer_declarator();
extern int yylex ();
# else
extern int c_y_lex __P(());
# endif
extern void c_reinit_parse_for_function __P(());
extern void c_position_after_white_space __P(());
extern void c_init_lex __P(( char *InputFileName ));
extern char *get_directive_line ();

View File

@ -1,527 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_common.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_flags.h"
# include "c_tree.h"
# include "c_treecompat.h"
# include "c_cdecl.h"
# include "c_convert.h"
# include "c_ctypeck.h"
# include "c_common.h"
# include "c_foldconst.h"
# include "c_debug.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/* Print a warning if a constant expression had overflow in folding.
Invoke this function on every expression that the language
requires to be a constant expression.
Note the ANSI C standard says it is erroneous for a
constant expression to overflow. */
void c_constant_expression_warning (value)
c_tree_node *value;
{
if (( CTreeNodeFirstCode(value) == C_INT_CST_NODE || CTreeNodeFirstCode(value) == C_REAL_CST_NODE
|| CTreeNodeFirstCode(value) == C_COMPLEX_NODE)
&& CIsTreeNodeStatic(value) && c_pedantic)
{
pedwarn ("overflow in constant expression");
}
}
/* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
If X is 0, return -1.
This should be used via the floor_log2 macro. */
int
c_floor_log2_wide (x)
register unsigned C_HOST_WIDE_INT x;
{
register int log = -1;
while (x != 0)
log++,
x >>= 1;
return log;
}
/* Return the minimum number of bits needed to represent VALUE in a
signed or unsigned type, UNSIGNEDP says which. */
int c_min_precision (value, unsignedp)
c_tree_node *value;
int unsignedp;
{
int log;
/* If the value is negative, compute its negative minus 1. The latter
adjustment is because the absolute value of the largest negative value
is one larger than the largest positive value. This is equivalent to
a bit-wise negation, so use that operation instead. */
if (c_tree_is_int_cst_sgn(value) < 0)
value = c_fold (c_tree_build_unary_typed_expr(C_BIT_NOT_EXPR, CTreeType(value), value));
/* Return the number of bits needed, taking into account the fact
that we need one more bit for a signed than unsigned type. */
if (c_tree_is_integer_zerop (value))
log = 0;
else if (CTreeIntCstHigh(value) != 0)
log = C_HOST_BITS_PER_WIDE_INT + c_floor_log2_wide (CTreeIntCstHigh(value));
else
log = c_floor_log2_wide (CTreeIntCstLow(value));
return log + 1 + ! unsignedp;
}
/* Validate the expression after `case' and apply default promotions. */
c_tree_node *c_check_case_value(value)
c_tree_node *value;
{
if (value == NULL)
return value;
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
CStripTypeNops(value);
if ( CTreeNodeFirstCode(value) != C_INT_CST_NODE
&& value != c_error_mark_node)
{
error ("case label does not reduce to an integer constant");
value = c_error_mark_node;
}
else
/* Promote char or short to int. */
value = c_default_conversion(value);
c_constant_expression_warning(value);
return value;
}
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type.
This function is also responsible for converting the two operands
to the proper common type for comparison.
The arguments of this function are all pointers to local variables
of build_binary_op: OP0_PTR is &OP0, OP1_PTR is &OP1,
RESTYPE_PTR is &RESULT_TYPE and RESCODE_PTR is &RESULTCODE.
If this function returns nonzero, it means that the comparison has
a constant value. What this function returns is an expression for
that value. */
c_tree_node *c_shorten_compare(op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
c_tree_node **op0_ptr;
c_tree_node **op1_ptr;
c_tree_node **restype_ptr;
int *rescode_ptr;
{
c_tree_node *type;
c_tree_node *op0 = *op0_ptr;
c_tree_node *op1 = *op1_ptr;
int unsignedp0, unsignedp1;
int real1, real2;
c_tree_node *primop0;
c_tree_node *primop1;
int code = *rescode_ptr;
/* Throw away any conversions to wider types
already present in the operands. */
primop0 = c_get_narrower(op0, &unsignedp0);
primop1 = c_get_narrower(op1, &unsignedp1);
/* Handle the case that OP0 does not *contain* a conversion
but it *requires* conversion to FINAL_TYPE. */
if (op0 == primop0 && CTreeType(op0) != *restype_ptr)
unsignedp0 = CIsTreeNodeUnsigned(CTreeType(op0));
if (op1 == primop1 && CTreeType(op1) != *restype_ptr)
unsignedp1 = CIsTreeNodeUnsigned(CTreeType(op1));
/* If one of the operands must be floated, we cannot optimize. */
real1 = CTreeTypeCode(CTreeType(primop0)) == C_REAL_TYPE;
real2 = CTreeTypeCode(CTreeType(primop1)) == C_REAL_TYPE;
/* If first arg is constant, swap the args (changing operation
so value is preserved), for canonicalization. Don't do this if
the second arg is 0. */
if ( CIsTreeNodeConstant(primop0)
&& ! c_tree_is_integer_zerop(primop1) && !
c_tree_is_real_zerop(primop1))
{
c_tree_node *tem = primop0;
int temi = unsignedp0;
primop0 = primop1;
primop1 = tem;
tem = op0;
op0 = op1;
op1 = tem;
*op0_ptr = op0;
*op1_ptr = op1;
unsignedp0 = unsignedp1;
unsignedp1 = temi;
temi = real1;
real1 = real2;
real2 = temi;
switch (code)
{
case C_LT_EXPR:
code = C_GT_EXPR;
break;
case C_GT_EXPR:
code = C_LT_EXPR;
break;
case C_LE_EXPR:
code = C_GE_EXPR;
break;
case C_GE_EXPR:
code = C_LE_EXPR;
break;
default:
break;
}
*rescode_ptr = code;
}
/* If comparing an integer against a constant more bits wide,
maybe we can deduce a value of 1 or 0 independent of the data.
Or else truncate the constant now
rather than extend the variable at run time.
This is only interesting if the constant is the wider arg.
Also, it is not safe if the constant is unsigned and the
variable arg is signed, since in this case the variable
would be sign-extended and then regarded as unsigned.
Our technique fails in this case because the lowest/highest
possible unsigned results don't follow naturally from the
lowest/highest possible values of the variable operand.
For just EQ_EXPR and NE_EXPR there is another technique that
could be used: see if the constant can be faithfully represented
in the other operand's type, by truncating it and reextending it
and see if that preserves the constant's value. */
if (!real1 && !real2
&& CTreeNodeFirstCode(primop1) == C_INT_CST_NODE
&& CTreeTypePrecision(CTreeType(primop0)) < CTreeTypePrecision(*restype_ptr))
{
int min_gt, max_gt, min_lt, max_lt;
c_tree_node *maxval;
c_tree_node *minval;
/* 1 if comparison is nominally unsigned. */
int unsignedp = CIsTreeNodeUnsigned(*restype_ptr);
c_tree_node *val;
type = c_get_signed_or_unsigned_type(unsignedp0, CTreeType(primop0));
maxval = CTreeTypeMaxValue(type);
minval = CTreeTypeMinValue(type);
if (unsignedp && !unsignedp0)
*restype_ptr = c_get_signed_type(*restype_ptr);
if (CTreeType(primop1) != *restype_ptr)
primop1 = c_convert_expr(*restype_ptr, primop1);
if (type != *restype_ptr)
{
minval = c_convert_expr(*restype_ptr, minval);
maxval = c_convert_expr(*restype_ptr, maxval);
}
if (unsignedp && unsignedp0)
{
min_gt = INT_CST_LT_UNSIGNED (primop1, minval);
max_gt = INT_CST_LT_UNSIGNED (primop1, maxval);
min_lt = INT_CST_LT_UNSIGNED (minval, primop1);
max_lt = INT_CST_LT_UNSIGNED (maxval, primop1);
}
else
{
min_gt = INT_CST_LT (primop1, minval);
max_gt = INT_CST_LT (primop1, maxval);
min_lt = INT_CST_LT (minval, primop1);
max_lt = INT_CST_LT (maxval, primop1);
}
val = 0;
/* This used to be a switch, but Genix compiler can't handle that. */
if (code == C_NE_EXPR)
{
if (max_lt || min_gt)
val = c_boolean_true_node;
}
else if (code == C_EQ_EXPR)
{
if (max_lt || min_gt)
val = c_boolean_false_node;
}
else if (code == C_LT_EXPR)
{
if (max_lt)
val = c_boolean_true_node;
if (!min_lt)
val = c_boolean_false_node;
}
else if (code == C_GT_EXPR)
{
if (min_gt)
val = c_boolean_true_node;
if (!max_gt)
val = c_boolean_false_node;
}
else if (code == C_LE_EXPR)
{
if (!max_gt)
val = c_boolean_true_node;
if (min_gt)
val = c_boolean_false_node;
}
else if (code == C_GE_EXPR)
{
if (!min_lt)
val = c_boolean_true_node;
if (max_lt)
val = c_boolean_false_node;
}
/* If primop0 was sign-extended and unsigned comparison specd,
we did a signed comparison above using the signed type bounds.
But the comparison we output must be unsigned.
Also, for inequalities, VAL is no good; but if the signed
comparison had *any* fixed result, it follows that the
unsigned comparison just tests the sign in reverse
(positive values are LE, negative ones GE).
So we can generate an unsigned comparison
against an extreme value of the signed type. */
if (unsignedp && !unsignedp0)
{
if (val != 0)
switch (code)
{
case C_LT_EXPR:
case C_GE_EXPR:
primop1 = CTreeTypeMinValue(type);
val = 0;
break;
case C_LE_EXPR:
case C_GT_EXPR:
primop1 = CTreeTypeMaxValue(type);
val = 0;
break;
default:
break;
}
type = c_get_unsigned_type(type);
}
if (!max_gt && !unsignedp0 && CTreeNodeFirstCode(primop0) != C_INT_CST_NODE)
{
/* This is the case of (char)x >?< 0x80, which people used to use
expecting old C compilers to change the 0x80 into -0x80. */
if (val == c_boolean_false_node)
{
warning ("comparison is always 0 due to limited range of data type");
}
if (val == c_boolean_true_node)
{
warning ("comparison is always 1 due to limited range of data type");
}
}
if (!min_lt && unsignedp0 && CTreeNodeFirstCode(primop0) != C_INT_CST_NODE)
{
/* This is the case of (unsigned char)x >?< -1 or < 0. */
if (val == c_boolean_false_node)
{
warning ("comparison is always 0 due to limited range of data type");
}
if (val == c_boolean_true_node)
{
warning ("comparison is always 1 due to limited range of data type");
}
}
if (val != 0)
{
/* Don't forget to evaluate PRIMOP0 if it has side effects. */
if ( CIsTreeNodeSideEffect(primop0))
return c_tree_build_binary_typed_expr(
C_COMPOUND_EXPR, CTreeType(val), primop0, val);
return val;
}
/* Value is not predetermined, but do the comparison
in the type of the operand that is not constant.
TYPE is already properly set. */
}
else if (real1 && real2
&& (CTreeTypePrecision(CTreeType(primop0))
== CTreeTypePrecision(CTreeType(primop1))))
type = CTreeType(primop0);
/* If args' natural types are both narrower than nominal type
and both extend in the same manner, compare them
in the type of the wider arg.
Otherwise must actually extend both to the nominal
common type lest different ways of extending
alter the result.
(eg, (short)-1 == (unsigned short)-1 should be 0.) */
else if (unsignedp0 == unsignedp1 && real1 == real2
&& CTreeTypePrecision(CTreeType(primop0)) < CTreeTypePrecision(*restype_ptr)
&& CTreeTypePrecision(CTreeType(primop1)) < CTreeTypePrecision(*restype_ptr))
{
type = c_get_common_type(CTreeType(primop0), CTreeType(primop1));
type = c_get_signed_or_unsigned_type(unsignedp0
|| CIsTreeNodeUnsigned(*restype_ptr),
type);
/* Make sure shorter operand is extended the right way
to match the longer operand. */
primop0 = c_convert_expr(
c_get_signed_or_unsigned_type(unsignedp0, CTreeType(primop0)), primop0);
primop1 = c_convert_expr(
c_get_signed_or_unsigned_type(unsignedp1, CTreeType(primop1)), primop1);
}
else
{
/* Here we must do the comparison on the nominal type
using the args exactly as we received them. */
type = *restype_ptr;
primop0 = op0;
primop1 = op1;
if (!real1 && !real2 && c_tree_is_integer_zerop(primop1)
&& CIsTreeNodeUnsigned(*restype_ptr))
{
c_tree_node *value = 0;
switch (code)
{
case C_GE_EXPR:
/* All unsigned values are >= 0, so we warn if extra warnings
are requested. However, if OP0 is a constant that is
>= 0, the signedness of the comparison isn't an issue,
so suppress the warning. */
if (c_extra_warnings
&& ! ( CTreeNodeFirstCode(primop0) == C_INT_CST_NODE
&& ! CIsTreeNodeOverflow(
c_convert_expr(c_get_signed_type(type), primop0))))
{
warning ("unsigned value >= 0 is always 1");
}
value = c_boolean_true_node;
break;
case C_LT_EXPR:
if (c_extra_warnings
&& ! ( CTreeNodeFirstCode(primop0) == C_INT_CST_NODE
&& ! CIsTreeNodeOverflow(
c_convert_expr(c_get_signed_type(type), primop0))))
{
warning ("unsigned value < 0 is always 0");
}
value = c_boolean_false_node;
break;
default:
break;
}
if (value != 0)
{
/* Don't forget to evaluate PRIMOP0 if it has side effects. */
if ( CIsTreeNodeSideEffect(primop0))
return c_tree_build_binary_typed_expr(
C_COMPOUND_EXPR, CTreeType(value), primop0, value);
return value;
}
}
}
*op0_ptr = c_convert_expr(type, primop0);
*op1_ptr = c_convert_expr(type, primop1);
*restype_ptr = c_boolean_type_node;
return 0;
}

View File

@ -1,75 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_common.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_COMMON_H
# define C_COMMON_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern void c_constant_expression_warning __P((c_tree_node *value));
extern int c_min_precision __P((c_tree_node *value, int unsignedp));
extern c_tree_node * c_check_case_value __P((c_tree_node *value));
extern c_tree_node * c_check_case_value __P((c_tree_node *value));
extern c_tree_node * c_shorten_compare __P(( c_tree_node **op0_ptr, c_tree_node **op1_ptr, c_tree_node **restype_ptr, int *rescode_ptr ));
# endif

File diff suppressed because it is too large Load Diff

View File

@ -1,82 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_convert.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_CONVERT_H
# define C_CONVERT_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern c_tree_node * c_convert_to_pointer __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_convert_to_real __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_convert_to_complex __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_convert_to_integer __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_convert_expr __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_default_conversion __P((c_tree_node *exp));
extern c_tree_node * c_truthvalue_conversion __P((c_tree_node *expr));
extern c_tree_node * c_convert_and_check __P((c_tree_node *type, c_tree_node *expr));
extern int c_is_staticp __P((c_tree_node *arg));
c_tree_node *arg;
# endif

File diff suppressed because it is too large Load Diff

View File

@ -1,116 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_ctypeck.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_CTYPECK_H
# define C_CTYPECK_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern int c_is_comptypes __P((c_tree_node *type1, c_tree_node *type2));
extern c_tree_node * c_parser_build_indirect_ref __P((c_tree_node *ptr, char *errorstring));
extern c_tree_node * c_parser_build_conditional_expr __P((c_tree_node *TreeIf, c_tree_node *TreeArg1, c_tree_node *TreeArg2));
extern c_tree_node * c_parser_build_modify_expr __P(( c_tree_node *lhs, int modifycode, c_tree_node *rhs));
extern c_tree_node * c_get_non_lvalue __P((c_tree_node *x));
extern c_tree_node * c_parser_build_compound_expr __P((c_tree_node *list));
extern c_tree_node * c_is_initializer_constant_valid_p __P((c_tree_node *value, c_tree_node *endtype));
extern void c_store_init_value __P((c_tree_node *decl, c_tree_node *init));
extern c_tree_node * c_get_signed_or_unsigned_type __P((int unsignedp, c_tree_node *type));
extern c_tree_node * c_get_signed_type __P((c_tree_node *type));
extern c_tree_node * c_get_unsigned_type __P((c_tree_node *type));
extern int c_int_fits_type_p __P((c_tree_node *c, c_tree_node *type));
extern int c_is_tree_int_cst_lt __P((c_tree_node *t1, c_tree_node *t2));
extern c_tree_node * c_get_type_for_size __P((unsigned bits, int unsignedp));
extern int c_type_precision __P((c_tree_node *type));
extern c_tree_node * c_c_build_type_variant __P((c_tree_node *type, int constp, int volatilep));
extern void c_set_init_label __P((c_tree_node *fieldname));
extern void c_set_init_index __P((c_tree_node *first, c_tree_node *last));
extern c_tree_node * c_build_c_cast __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_get_c_sizeof __P((c_tree_node *type));
extern c_tree_node * c_get_c_alignof __P((c_tree_node *type));
extern c_tree_node * c_get_c_alignof_expr __P((c_tree_node *expr));
extern int c_get_int_size_in_bytes __P((c_tree_node *type));
extern c_tree_node * c_parser_build_function_call __P((c_tree_node *function, c_tree_node *params));
extern void c_incomplete_type_error __P((c_tree_node *value, c_tree_node *type));
extern c_tree_node * c_require_complete_type __P((c_tree_node *value));
extern int c_is_lvalue_p __P((c_tree_node *ref));
extern c_tree_node * c_parser_build_array_ref __P((c_tree_node *array, c_tree_node *index));
extern c_tree_node * c_parser_build_component_ref __P((c_tree_node *datum, c_tree_node *component));
extern c_tree_node * c_get_size_in_bytes __P((c_tree_node *type));
extern c_tree_node * c_build_binary_op __P(( int code, c_tree_node *orig_op0, c_tree_node *orig_op1, int convert_p));
extern c_tree_node * c_parser_build_binary_op __P(( int code, c_tree_node *arg1, c_tree_node *arg2));
extern c_tree_node * c_parser_build_unary_op __P((int code, c_tree_node *xarg, int noconvert));
extern c_tree_node * c_get_narrower __P((c_tree_node *op, int *unsignedp_ptr));
extern c_tree_node * c_get_unwidened __P((c_tree_node *op, c_tree_node *for_type));
extern int c_mark_addressable __P((c_tree_node *exp));
extern void c_process_init_element __P((c_tree_node *value));
extern c_tree_node * c_pop_init_level __P((int implicit));
extern void c_push_init_level __P((int implicit));
extern void c_really_start_incremental_init __P((c_tree_node *type));
extern c_tree_node * c_finish_init __P(());
extern void c_start_init __P((c_tree_node *decl, c_tree_node *asmspec_tree, int top_level));
extern c_tree_node * c_get_common_type __P((c_tree_node *t1, c_tree_node *t2));
extern int c_force_fit_type __P((c_tree_node *t, int overflow ));
# endif

View File

@ -1,711 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_debug.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include <stdarg.h>
# include <ctype.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_tree.h"
# include "c_treecompat.h"
# include "c_flags.h"
# include "c_cdecl.h"
# include "c_ctypeck.h"
# include "c_convert.h"
# include "c_debug.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
#ifndef VPROTO
#ifdef __STDC__
#define PVPROTO(ARGS) ARGS
#define VPROTO(ARGS) ARGS
#define VA_START(va_list,var) va_start(va_list,var)
#else
#define PVPROTO(ARGS) ()
#define VPROTO(ARGS) (va_alist) va_dcl
#define VA_START(va_list,var) va_start(va_list)
#endif
#endif
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
static int c_need_error_newline;
/* Function of last error message;
more generally, function such that if next error message is in it
then we don't have to mention the function name. */
static c_tree_node *c_last_error_function = NULL;
/* Used to detect when input_file_stack has changed since last described. */
static int c_last_error_tick;
/* Called when the start of a function definition is parsed,
this function prints on stdout the name of the function. */
/* Number of error messages and warning messages so far. */
int c_errorcount = 0;
int c_warningcount = 0;
int c_sorrycount = 0;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/* Count an error or warning. Return 1 if the message should be printed. */
int c_count_error(warningp)
int warningp;
{
if (warningp && c_inhibit_warnings)
return 0;
if (warningp && !c_warnings_are_errors)
c_warningcount++;
else
{
static int warning_message = 0;
if (warningp && !warning_message)
{
fprintf (stdout, "warnings being treated as errors\n" );
warning_message = 1;
}
c_errorcount++;
}
return 1;
}
static char *c_print_decl_name(decl, verbosity)
c_tree_node *decl;
int verbosity;
{
return CTreeIdentPointer( CTreeDeclName(decl));
}
static void c_default_print_error_function(file)
char *file;
{
if (c_last_error_function != c_current_function_decl)
{
char *kind = "function";
if (c_current_function_decl != 0
&& CTreeTypeCode( CTreeType(c_current_function_decl)) == C_METHOD_TYPE)
{
kind = "method";
}
if (file)
{
fprintf (stdout, "%s: ", file);
}
if (c_current_function_decl == NULL)
{
fprintf (stdout, "At top level:\n");
}
else
{
char *name = c_print_decl_name(c_current_function_decl, 2);
fprintf (stdout, "In %s `%s':\n", kind, name);
}
c_last_error_function = c_current_function_decl;
}
}
/* Prints out, if necessary, the name of the current function
that caused an error. Called from all error and warning functions. */
void c_report_error_function(file)
char *file;
{
c_file_stack *p;
if (c_need_error_newline)
{
fprintf (stdout, "\n");
c_need_error_newline = 0;
}
c_default_print_error_function(file);
if (c_input_file_stack && c_input_file_stack->NEXT != 0
&& c_input_file_stack_tick != c_last_error_tick
&& file == c_input_filename)
{
fprintf (stdout, "In file included");
for (p = c_input_file_stack->NEXT; p; p = p->NEXT)
{
fprintf (stdout, " from %s:%d", p->NAME, p->LINE);
if (p->NEXT)
fprintf (stdout, ",\n ");
}
fprintf (stdout, ":\n");
c_last_error_tick = c_input_file_stack_tick;
}
}
/* Print a message. */
static void
c_vmessage(prefix, s, ap)
char *prefix;
char *s;
va_list ap;
{
if (prefix)
fprintf (stdout, "%s: ", prefix);
#ifdef HAVE_VPRINTF
vfprintf (stdout, s, ap);
#else
{
int v1 = va_arg(ap, int);
int v2 = va_arg(ap, int);
int v3 = va_arg(ap, int);
int v4 = va_arg(ap, int);
fprintf (stdout, s, v1, v2, v3, v4);
}
#endif
}
/* Print a message relevant to line LINE of file FILE. */
static void
c_v_message_with_file_and_line(file, line, prefix, s, ap)
char *file;
int line;
char *prefix;
char *s;
va_list ap;
{
if (file)
fprintf (stdout, "%s:%d: ", file, line);
c_vmessage(prefix, s, ap);
fputc('\n', stdout);
}
/* Print a message relevant to the given DECL. */
static void
c_v_message_with_decl(decl, prefix, s, ap)
c_tree_node *decl;
char *prefix;
char *s;
va_list ap;
{
char *p;
fprintf (stdout, "%s:%d: ",
CTreeDeclFileName(decl), CTreeDeclLineNum(decl));
if (prefix)
fprintf (stdout, "%s: ", prefix);
/* Do magic to get around lack of varargs support for insertion
of arguments into existing list. We know that the decl is first;
we ass_u_me that it will be printed with "%s". */
for (p = s; *p; ++p)
{
if (*p == '%')
{
if (*(p + 1) == '%')
++p;
else
break;
}
}
if (p > s) /* Print the left-hand substring. */
{
char fmt[sizeof "%.255s"];
long width = p - s;
if (width > 255L) width = 255L; /* arbitrary */
sprintf (fmt, "%%.%lds", width);
fprintf (stdout, fmt, s);
}
if (*p == '%') /* Print the name. */
{
char *n = (CTreeDeclName(decl)
? c_print_decl_name(decl, 2)
: "((anonymous))");
fputs (n, stdout);
while (*p)
{
++p;
if (isalpha (*(p - 1) & 0xFF))
break;
}
}
if (*p) /* Print the rest of the message. */
c_vmessage((char *)NULL, p, ap);
fputc ('\n', stdout);
}
/* Report an error at line LINE of file FILE. */
static void
c_v_error_with_file_and_line(file, line, s, ap)
char *file;
int line;
char *s;
va_list ap;
{
c_count_error(0);
c_report_error_function(file);
c_v_message_with_file_and_line(file, line, (char *)NULL, s, ap);
}
void
c_error_with_file_and_line(char *file, int line, char *s, ...)
{
#ifndef __STDC__
char *file;
int line;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
file = va_arg (ap, char *);
line = va_arg (ap, int);
s = va_arg (ap, char *);
#endif
c_v_error_with_file_and_line (file, line, s, ap);
va_end (ap);
}
/* Report an error at the declaration DECL.
S is a format string which uses %s to substitute the declaration
name; subsequent substitutions are a la printf. */
static void c_v_error_with_decl (decl, s, ap)
c_tree_node *decl;
char *s;
va_list ap;
{
c_count_error(0);
c_report_error_function( CTreeDeclFileName(decl));
c_v_message_with_decl(decl, (char *)NULL, s, ap);
}
void
c_error_with_decl (tree decl, char *s, ...)
{
#ifndef __STDC__
c_tree_node *decl;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
decl = va_arg (ap, tree);
s = va_arg (ap, char *);
#endif
c_v_error_with_decl (decl, s, ap);
va_end (ap);
}
/* Report an error at the line number of the insn INSN.
This is used only when INSN is an `asm' with operands,
and each ASM_OPERANDS records its own source file and line. */
static void
c_verror (s, ap)
char *s;
va_list ap;
{
c_v_error_with_file_and_line(c_input_filename, c_lineno, s, ap);
}
void c_error(char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_verror(s, ap);
va_end (ap);
}
/* Report a fatal error at the current line number. */
static void
c_vfatal (s, ap)
char *s;
va_list ap;
{
c_verror (s, ap);
gcpexit( 1 );
}
void
c_fatal (char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_vfatal (s, ap);
va_end (ap);
}
/* Report a warning at line LINE of file FILE. */
static void
c_v_warning_with_file_and_line (file, line, s, ap)
char *file;
int line;
char *s;
va_list ap;
{
if (c_count_error(1))
{
c_report_error_function(file);
c_v_message_with_file_and_line(file, line, "warning", s, ap);
}
}
void
c_warning_with_file_and_line (char *file, int line, char *s, ...)
{
#ifndef __STDC__
char *file;
int line;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
file = va_arg (ap, char *);
line = va_arg (ap, int);
s = va_arg (ap, char *);
#endif
c_v_warning_with_file_and_line (file, line, s, ap);
va_end (ap);
}
/* Report a warning at the declaration DECL.
S is a format string which uses %s to substitute the declaration
name; subsequent substitutions are a la printf. */
static void c_v_warning_with_decl (decl, s, ap)
c_tree_node *decl;
char *s;
va_list ap;
{
if (c_count_error(1))
{
c_report_error_function ( CTreeDeclFileName(decl));
c_v_message_with_decl(decl, "warning", s, ap);
}
}
void c_warning_with_decl (tree decl, char *s, ...)
{
#ifndef __STDC__
c_tree_node *decl;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
decl = va_arg (ap, tree);
s = va_arg (ap, char *);
#endif
c_v_warning_with_decl (decl, s, ap);
va_end (ap);
}
/* Report a warning at the current line number. */
static void
c_vwarning (s, ap)
char *s;
va_list ap;
{
c_v_warning_with_file_and_line(c_input_filename, c_lineno, s, ap);
}
void
c_warning (char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_vwarning(s, ap);
va_end (ap);
}
/* These functions issue either warnings or errors depending on
-pedantic-errors. */
static void
c_vpedwarn (s, ap)
char *s;
va_list ap;
{
if (c_flag_pedantic_errors)
c_verror (s, ap);
else
c_vwarning (s, ap);
}
void c_pedwarn (char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_vpedwarn (s, ap);
va_end (ap);
}
static void
c_v_pedwarn_with_decl(decl, s, ap)
c_tree_node *decl;
char *s;
va_list ap;
{
/* We don't want -pedantic-errors to cause the compilation to fail from
"errors" in system header files. Sometimes fixincludes can't fix what's
broken (eg: unsigned char bitfields - fixing it may change the alignment
which will cause programs to mysteriously fail because the C library
or kernel uses the original layout). There's no point in issuing a
warning either, it's just unnecessary noise. */
if (! CIsTreeDeclSystemHeader(decl))
{
if (c_flag_pedantic_errors)
c_v_error_with_decl(decl, s, ap);
else
c_v_warning_with_decl(decl, s, ap);
}
}
void
c_pedwarn_with_decl (tree decl, char *s, ...)
{
#ifndef __STDC__
c_tree_node *decl;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
decl = va_arg (ap, tree);
s = va_arg (ap, char *);
#endif
c_v_pedwarn_with_decl (decl, s, ap);
va_end (ap);
}
static void
c_v_pedwarn_with_file_and_line (file, line, s, ap)
char *file;
int line;
char *s;
va_list ap;
{
if (c_flag_pedantic_errors)
c_v_error_with_file_and_line (file, line, s, ap);
else
c_v_warning_with_file_and_line (file, line, s, ap);
}
void
c_pedwarn_with_file_and_line (char *file, int line, char *s, ...)
{
#ifndef __STDC__
char *file;
int line;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
file = va_arg (ap, char *);
line = va_arg (ap, int);
s = va_arg (ap, char *);
#endif
c_v_pedwarn_with_file_and_line (file, line, s, ap);
va_end (ap);
}
/* Apologize for not implementing some feature. */
static void c_vsorry(s, ap)
char *s;
va_list ap;
{
c_sorrycount++;
if (c_input_filename)
fprintf (stdout, "%s:%d: ", c_input_filename, c_lineno);
else
c_vmessage ("sorry, not implemented", s, ap);
fputc ('\n', stdout);
}
void c_sorry(char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_vsorry (s, ap);
va_end (ap);
}
/* Apologize for not implementing some feature, then quit. */
static void
c_v_really_sorry (s, ap)
char *s;
va_list ap;
{
c_sorrycount++;
if (c_input_filename)
fprintf (stdout, "%s:%d: ", c_input_filename, c_lineno);
else
c_vmessage ("sorry, not implemented", s, ap);
c_fatal (" (fatal)\n");
}
void c_really_sorry (char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_v_really_sorry (s, ap);
va_end (ap);
}

View File

@ -1,82 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_debug.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_DEBUG_H
# define C_DEBUG_H
# define c_header_debug() fprintf( stdout, "%s:%d: *%s*\n", \
basename(__FILE__),__LINE__, __FUNCTION__)
# define c_fprintf c_header_debug(); fprintf
# define loc_c_tree_view_node c_header_debug(); fprintf( stdout, "\n" ); c_tree_view_node
# define loc_c_tree_view_node_list c_header_debug(); fprintf( stdout, "\n" ); c_tree_view_node_list
# define loc_c_view_binding c_header_debug(); fprintf( stdout, "\n" ); c_view_binding
# define warning c_header_debug(); c_warning
# define pedwarn c_header_debug(); c_pedwarn
# define error c_header_debug(); c_error
# define warning_with_decl c_header_debug(); c_warning_with_decl
# define error_with_decl c_header_debug(); c_error_with_decl
# define pedwarn_with_decl c_header_debug(); c_pedwarn_with_decl
# define warning_with_file_and_line c_header_debug(); c_warning_with_file_and_line
# define error_with_file_and_line c_header_debug(); c_error_with_file_and_line
# define pedwarn_with_file_and_line c_header_debug(); c_pedwarn_with_file_and_line
# define warning_init c_header_debug(); c_warning_init
# define pedwarn_init c_header_debug(); c_pedwarn_init
# define error_init c_header_debug(); c_error_init
# define warn_for_assignment c_header_debug(); c_warn_for_assignment
extern void c_error __P((char *s, ...));
extern void c_pedwarn __P((char *s, ...));
extern void c_warning __P((char *s, ...));
extern void c_warning_with_file_and_line __P((char *file, int line, char *s, ...));
extern void c_pedwarn_with_file_and_line __P((char *file, int line, char *s, ...));
extern void c_error_with_file_and_line __P((char *file, int line, char *s, ...));
extern void c_error_with_decl __P((c_tree_node *decl, char *s, ...));
extern void c_warning_with_decl __P((c_tree_node *decl, char *s, ...));
extern void c_pedwarn_with_decl __P((c_tree_node *decl, char *s, ...));
# endif

View File

@ -1,106 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_expand.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_flags.h"
# include "c_tree.h"
# include "c_treecompat.h"
# include "c_cdecl.h"
# include "c_convert.h"
# include "c_ctypeck.h"
# include "c_expand.h"
# include "c_debug.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/*
ITERATOR RTL EXPANSIONS
Expanding simple statements with iterators is straightforward:
collect the list of all free iterators in the statement, and
generate a loop for each of them.
An iterator is "free" if it has not been "bound" by a FOR
operator. The DECL_RTL of the iterator is the loop counter. */
/* Expand a statement STMT, possibly containing iterator usage, into RTL. */
void c_iterator_expand (stmt)
c_tree_node *stmt;
{
# ifdef LUDO_NO_SKIP
c_tree_node *iter_list;
save_exprs = NULL_TREE;
iter_list = collect_iterators (stmt, NULL_TREE);
expand_stmt_with_iterators_1 (stmt, iter_list);
istack_sublevel_to_current ();
# endif
/*
loc_c_tree_view_node( stmt );
*/
}

View File

@ -1,72 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_expand.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_EXPAND_H
# define C_EXPAND_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern void c_iterator_expand __P((c_tree_node *stmt));
# endif

View File

@ -1,740 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_flags.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_flags.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/* Nonzero for -pedantic switch: warn about anything that standard C forbids. */
int c_pedantic = 0;
/* Nonzero means try to imitate old fashioned non-ANSI preprocessor. */
int c_flag_traditional = 0;
/* Nonzero means `$' can be in an identifier. */
int c_dollars_in_ident = 0;
/* Nonzero enables objc features. */
int c_doing_objc_thang = 0;
/* Nonzero means don't recognize the keyword `asm'. */
int c_flag_no_asm = 0;
/* Nonzero means warn about any identifiers that match in the first N
characters. The value N is in `id_clash_len'. */
int c_warn_id_clash;
unsigned c_id_clash_len;
/* Nonzero for -fwritable-strings:
store string constants in data segment and don't uniquize them. */
int c_flag_writable_strings;
/* Nonzero means `char' should be signed. */
int c_flag_signed_char;
/* Nonzero means give an enum type only as many bytes as it needs. */
int c_flag_short_enums;
/* Nonzero means warn about function definitions that default the return type
or that use a null return and have a return-type other than void. */
int c_warn_return_type;
/* Nonzero to warn about variables used before they are initialized. */
int c_warn_uninitialized;
/* Nonzero to warn about unused local variables. */
int c_warn_unused;
/* Warn if a switch on an enum fails to have a case for every enum value. */
int c_warn_switch;
/* Nonzero means warn about all declarations which shadow others. */
int c_warn_shadow;
/* Nonzero means don't place uninitialized global data in common storage
by default. */
int c_flag_no_common;
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes. Also want about function definitions whose returned
values are larger than N bytes. The value N is in `larger_than_size'. */
int c_warn_larger_than;
unsigned c_larger_than_size;
/* Nonzero means change certain warnings into errors.
Usually these are warnings about failure to conform to some standard. */
int c_flag_pedantic_errors = 0;
/* Tag all structures with __attribute__(packed) */
int c_flag_pack_struct = 0;
/* Warn about traditional constructs whose meanings changed in ANSI C. */
int c_warn_traditional;
/* Nonzero means that we have builtin functions, and main is an int */
int c_flag_hosted = 1;
/* Nonzero means don't recognize any builtin functions. */
int c_flag_no_builtin;
/* Nonzero means to allow single precision math even if we're generally
being traditional. */
int flag_allow_single_precision = 0;
/* Warn if main is suspicious. */
int c_warn_main;
/* Nonzero means to treat bitfields as signed unless they say `unsigned'. */
int c_flag_signed_bitfields = 1;
int c_explicit_flag_signed_bitfields = 0;
/* Nonzero means allow type mismatches in conditional expressions;
just make their values `void'. */
int c_flag_cond_mismatch;
/* Nonzero means give `double' the same size as `float'. */
int c_flag_short_double;
/* Nonzero means handle `#ident' directives. 0 means ignore them. */
int c_flag_no_ident = 0;
/* Nonzero means don't recognize the non-ANSI builtin functions.
-ansi sets this. */
int c_flag_no_nonansi_builtin;
/* Nonzero means message about use of implicit function declarations;
1 means warning; 2 means error. */
int c_mesg_implicit_function_declaration;
/* Nonzero means warn about use of implicit int. */
int c_warn_implicit_int;
/* Nonzero means to allow single precision math even if we're generally
being traditional. */
int c_flag_allow_single_precision = 0;
/* Nonzero means give string constants the type `const char *'
to get extra warnings from them. These warnings will be too numerous
to be useful, except in thoroughly ANSIfied programs. */
int c_warn_write_strings;
/* Nonzero means warn about pointer casts that can drop a type qualifier
from the pointer target type. */
int c_warn_cast_qual;
/* Nonzero means warn when casting a function call to a type that does
not match the return type (e.g. (float)sqrt() or (anything*)malloc()
when there is no previous declaration of sqrt or malloc. */
int c_warn_bad_function_cast;
/* Nonzero means warn about sizeof(function) or addition/subtraction
of function pointers. */
int c_warn_pointer_arith;
/* Nonzero means warn for non-prototype function decls
or non-prototyped defs without previous prototype. */
int c_warn_strict_prototypes;
/* Nonzero means warn for any global function def
without separate previous prototype decl. */
int c_warn_missing_prototypes;
/* Nonzero means warn for any global function def
without separate previous decl. */
int c_warn_missing_declarations;
/* Nonzero means warn about multiple (redundant) decls for the same single
variable or function. */
int c_warn_redundant_decls = 0;
/* Nonzero means warn about extern declarations of objects not at
file-scope level and about *all* declarations of functions (whether
extern or static) not at file-scope level. Note that we exclude
implicit function declarations. To get warnings about those, use
-Wimplicit. */
int c_warn_nested_externs = 0;
/* Warn about *printf or *scanf format/argument anomalies. */
int c_warn_format;
/* Warn about a subscript that has type char. */
int c_warn_char_subscripts = 0;
/* Warn if a type conversion is done that might have confusing results. */
int c_warn_conversion;
/* Warn if adding () is suggested. */
int c_warn_parentheses;
/* Warn if initializer is not completely bracketed. */
int c_warn_missing_braces;
/* Warn about comparison of signed and unsigned values.
If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified. */
int c_warn_sign_compare = -1;
/* Temporarily suppress certain warnings.
This is set while reading code from a system header file. */
int c_in_system_header = 0;
/* Name of current original source file (what was input to cpp).
This comes from each #-command in the actual input. */
char *c_input_filename;
/* Name of top-level original source file (what was input to cpp).
This comes from the #-command at the beginning of the actual input.
If there isn't any there, then this is the cc1 input file name. */
char *c_main_input_filename;
/* Stack of currently pending input files. */
c_file_stack *c_input_file_stack;
/* Incremented on each change to input_file_stack. */
int c_input_file_stack_tick;
/* Nonzero for -ffloat-store: don't allocate floats and doubles
in extended-precision registers. */
int c_flag_float_store = 0;
/* Nonzero means all references through pointers are volatile. */
int c_flag_volatile;
/* Don't print warning messages. -w. */
int c_inhibit_warnings = 0;
/* Print various extra warnings. -W. */
int c_extra_warnings = 0;
/* Treat warnings as errors. -Werror. */
int c_warnings_are_errors = 0;
/* Nonzero means we should be saving declaration info into a .X file. */
int c_flag_gen_aux_info = 0;
/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
operations in the interest of optimization. For example it allows
GCC to assume arguments to sqrt are nonnegative numbers, allowing
faster code for sqrt to be generated. */
int c_flag_fast_math = 0;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
static void c_init_flags()
{
/* Nonzero for -pedantic switch: warn about anything that standard C forbids. */
c_pedantic = 0;
/* Nonzero means try to imitate old fashioned non-ANSI preprocessor. */
c_flag_traditional = 0;
/* Nonzero means `$' can be in an identifier. */
c_dollars_in_ident = 0;
/* Nonzero enables objc features. */
c_doing_objc_thang = 0;
/* Nonzero means don't recognize the keyword `asm'. */
c_flag_no_asm = 0;
/* Nonzero means warn about any identifiers that match in the first N
characters. The value N is in `id_clash_len'. */
c_warn_id_clash = 0;
c_id_clash_len = 0;
/* Nonzero for -fwritable-strings:
store string constants in data segment and don't uniquize them. */
c_flag_writable_strings = 0;
/* Nonzero means `char' should be signed. */
c_flag_signed_char = 0;
/* Nonzero means give an enum type only as many bytes as it needs. */
c_flag_short_enums = 0;
/* Nonzero means warn about function definitions that default the return type
or that use a null return and have a return-type other than void. */
c_warn_return_type = 0;
/* Nonzero to warn about variables used before they are initialized. */
c_warn_uninitialized = 0;
/* Nonzero to warn about unused local variables. */
c_warn_unused = 0;
/* Warn if a switch on an enum fails to have a case for every enum value. */
c_warn_switch = 0;
/* Nonzero means warn about all declarations which shadow others. */
c_warn_shadow = 0;
/* Nonzero means don't place uninitialized global data in common storage
by default. */
c_flag_no_common = 0;
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes. Also want about function definitions whose returned
values are larger than N bytes. The value N is in `larger_than_size'. */
c_warn_larger_than = 0;
c_larger_than_size = 0;
/* Nonzero means change certain warnings into errors.
Usually these are warnings about failure to conform to some standard. */
c_flag_pedantic_errors = 0;
/* Tag all structures with __attribute__(packed) */
c_flag_pack_struct = 0;
/* Warn about traditional constructs whose meanings changed in ANSI C. */
c_warn_traditional = 0;
/* Nonzero means that we have builtin functions, and main is an*/
c_flag_hosted = 1;
/* Nonzero means don't recognize any builtin functions. */
c_flag_no_builtin = 0;
/* Nonzero means to allow single precision math even if we're generally
being traditional. */
flag_allow_single_precision = 0;
/* Warn if main is suspicious. */
c_warn_main = 0;
/* Nonzero means to treat bitfields as signed unless they say `unsigned'. */
c_flag_signed_bitfields = 1;
c_explicit_flag_signed_bitfields = 0;
/* Nonzero means allow type mismatches in conditional expressions = 0;
just make their values `void'. */
c_flag_cond_mismatch = 0;
/* Nonzero means give `double' the same size as `float'. */
c_flag_short_double = 0;
/* Nonzero means handle `#ident' directives. 0 means ignore them. */
c_flag_no_ident = 0;
/* Nonzero means don't recognize the non-ANSI builtin functions.
-ansi sets this. */
c_flag_no_nonansi_builtin = 0;
/* Nonzero means message about use of implicit function declarations = 0;
1 means warning; 2 means error. */
c_mesg_implicit_function_declaration = 0;
/* Nonzero means warn about use of implicit int. */
c_warn_implicit_int = 0;
/* Nonzero means to allow single precision math even if we're generally
being traditional. */
c_flag_allow_single_precision = 0;
/* Nonzero means give string constants the type `const char *'
to get extra warnings from them. These warnings will be too numerous
to be useful, except in thoroughly ANSIfied programs. */
c_warn_write_strings = 0;
/* Nonzero means warn about pointer casts that can drop a type qualifier
from the pointer target type. */
c_warn_cast_qual = 0;
/* Nonzero means warn when casting a function call to a type that does
not match the return type (e.g. (float)sqrt() or (anything*)malloc()
when there is no previous declaration of sqrt or malloc. */
c_warn_bad_function_cast = 0;
/* Nonzero means warn about sizeof(function) or addition/subtraction
of function pointers. */
c_warn_pointer_arith = 0;
/* Nonzero means warn for non-prototype function decls
or non-prototyped defs without previous prototype. */
c_warn_strict_prototypes = 0;
/* Nonzero means warn for any global function def
without separate previous prototype decl. */
c_warn_missing_prototypes = 0;
/* Nonzero means warn for any global function def
without separate previous decl. */
c_warn_missing_declarations = 0;
/* Nonzero means warn about multiple (redundant) decls for the same single
variable or function. */
c_warn_redundant_decls = 0;
/* Nonzero means warn about extern declarations of objects not at
file-scope level and about *all* declarations of functions (whether
extern or static) not at file-scope level. Note that we exclude
implicit function declarations. To get warnings about those, use
-Wimplicit. */
c_warn_nested_externs = 0;
/* Warn about *printf or *scanf format/argument anomalies. */
c_warn_format = 0;
/* Warn about a subscript that has type char. */
c_warn_char_subscripts = 0;
/* Warn if a type conversion is done that might have confusing results. */
c_warn_conversion = 0;
/* Warn if adding () is suggested. */
c_warn_parentheses = 0;
/* Warn if initializer is not completely bracketed. */
c_warn_missing_braces = 0;
/* Warn about comparison of signed and unsigned values.
If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified. */
c_warn_sign_compare = -1;
/* Temporarily suppress certain warnings.
This is set while reading code from a system header file. */
c_in_system_header = 0;
/* Name of current original source file (what was input to cpp).
This comes from each #-command in the actual input. */
c_input_filename = 0;
/* Name of top-level original source file (what was input to cpp).
This comes from the #-command at the beginning of the actual input.
If there isn't any there, then this is the cc1 input file name. */
c_main_input_filename = 0;
/* Stack of currently pending input files. */
c_input_file_stack = 0;
/* Incremented on each change to input_file_stack. */
c_input_file_stack_tick = 0;
/* Nonzero for -ffloat-store: don't allocate floats and doubles
in extended-precision registers. */
c_flag_float_store = 0;
/* Nonzero means all references through pointers are volatile. */
c_flag_volatile = 0;
/* Don't print warning messages. -w. */
c_inhibit_warnings = 0;
/* Print various extra warnings. -W. */
c_extra_warnings = 0;
/* Treat warnings as errors. -Werror. */
c_warnings_are_errors = 0;
/* Nonzero means we should be saving declaration info into a .X file. */
c_flag_gen_aux_info = 0;
/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
operations in the interest of optimization. For example it allows
GCC to assume arguments to sqrt are nonnegative numbers, allowing
faster code for sqrt to be generated. */
c_flag_fast_math = 0;
}
static int c_parse_one_flags( p )
char *p;
{
c_init_flags();
if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
{
c_flag_traditional = 1;
c_flag_writable_strings = 1;
}
else if (!strcmp (p, "-fallow-single-precision"))
c_flag_allow_single_precision = 1;
else if (!strcmp (p, "-fhosted") || !strcmp (p, "-fno-freestanding"))
{
c_flag_hosted = 1;
c_flag_no_builtin = 0;
}
else if (!strcmp (p, "-ffreestanding") || !strcmp (p, "-fno-hosted"))
{
c_flag_hosted = 0;
c_flag_no_builtin = 1;
/* warn_main will be 2 if set by -Wall, 1 if set by -Wmain */
if (c_warn_main == 2)
c_warn_main = 0;
}
else if (!strcmp (p, "-fnotraditional") || !strcmp (p, "-fno-traditional"))
{
c_flag_traditional = 0;
c_flag_writable_strings = 0;
}
else if (!strcmp (p, "-fdollars-in-identifiers"))
c_dollars_in_ident = 1;
else if (!strcmp (p, "-fno-dollars-in-identifiers"))
c_dollars_in_ident = 0;
else if (!strcmp (p, "-fsigned-char"))
c_flag_signed_char = 1;
else if (!strcmp (p, "-funsigned-char"))
c_flag_signed_char = 0;
else if (!strcmp (p, "-fno-signed-char"))
c_flag_signed_char = 0;
else if (!strcmp (p, "-fno-unsigned-char"))
c_flag_signed_char = 1;
else if (!strcmp (p, "-fsigned-bitfields")
|| !strcmp (p, "-fno-unsigned-bitfields"))
{
c_flag_signed_bitfields = 1;
c_explicit_flag_signed_bitfields = 1;
}
else if (!strcmp (p, "-funsigned-bitfields")
|| !strcmp (p, "-fno-signed-bitfields"))
{
c_flag_signed_bitfields = 0;
c_explicit_flag_signed_bitfields = 1;
}
else if (!strcmp (p, "-fshort-enums"))
c_flag_short_enums = 1;
else if (!strcmp (p, "-fno-short-enums"))
c_flag_short_enums = 0;
else if (!strcmp (p, "-fcond-mismatch"))
c_flag_cond_mismatch = 1;
else if (!strcmp (p, "-fno-cond-mismatch"))
c_flag_cond_mismatch = 0;
else if (!strcmp (p, "-fshort-double"))
c_flag_short_double = 1;
else if (!strcmp (p, "-fno-short-double"))
c_flag_short_double = 0;
else if (!strcmp (p, "-fasm"))
c_flag_no_asm = 0;
else if (!strcmp (p, "-fno-asm"))
c_flag_no_asm = 1;
else if (!strcmp (p, "-fbuiltin"))
c_flag_no_builtin = 0;
else if (!strcmp (p, "-fno-builtin"))
c_flag_no_builtin = 1;
else if (!strcmp (p, "-fno-ident"))
c_flag_no_ident = 1;
else if (!strcmp (p, "-fident"))
c_flag_no_ident = 0;
else if (!strcmp (p, "-ansi"))
c_flag_no_asm = 1, c_flag_no_nonansi_builtin = 1;
else if (!strcmp (p, "-Werror-implicit-function-declaration"))
c_mesg_implicit_function_declaration = 2;
else if (!strcmp (p, "-Wimplicit-function-declaration"))
c_mesg_implicit_function_declaration = 1;
else if (!strcmp (p, "-Wno-implicit-function-declaration"))
c_mesg_implicit_function_declaration = 0;
else if (!strcmp (p, "-Wimplicit-int"))
c_warn_implicit_int = 1;
else if (!strcmp (p, "-Wno-implicit-int"))
c_warn_implicit_int = 0;
else if (!strcmp (p, "-Wimplicit"))
{
c_warn_implicit_int = 1;
if (c_mesg_implicit_function_declaration != 2)
c_mesg_implicit_function_declaration = 1;
}
else if (!strcmp (p, "-Wno-implicit"))
c_warn_implicit_int = 0, c_mesg_implicit_function_declaration = 0;
else if (!strcmp (p, "-Wwrite-strings"))
c_warn_write_strings = 1;
else if (!strcmp (p, "-Wno-write-strings"))
c_warn_write_strings = 0;
else if (!strcmp (p, "-Wcast-qual"))
c_warn_cast_qual = 1;
else if (!strcmp (p, "-Wno-cast-qual"))
c_warn_cast_qual = 0;
else if (!strcmp (p, "-Wbad-function-cast"))
c_warn_bad_function_cast = 1;
else if (!strcmp (p, "-Wno-bad-function-cast"))
c_warn_bad_function_cast = 0;
else if (!strcmp (p, "-Wpointer-arith"))
c_warn_pointer_arith = 1;
else if (!strcmp (p, "-Wno-pointer-arith"))
c_warn_pointer_arith = 0;
else if (!strcmp (p, "-Wstrict-prototypes"))
c_warn_strict_prototypes = 1;
else if (!strcmp (p, "-Wno-strict-prototypes"))
c_warn_strict_prototypes = 0;
else if (!strcmp (p, "-Wmissing-prototypes"))
c_warn_missing_prototypes = 1;
else if (!strcmp (p, "-Wno-missing-prototypes"))
c_warn_missing_prototypes = 0;
else if (!strcmp (p, "-Wmissing-declarations"))
c_warn_missing_declarations = 1;
else if (!strcmp (p, "-Wno-missing-declarations"))
c_warn_missing_declarations = 0;
else if (!strcmp (p, "-Wredundant-decls"))
c_warn_redundant_decls = 1;
else if (!strcmp (p, "-Wno-redundant-decls"))
c_warn_redundant_decls = 0;
else if (!strcmp (p, "-Wnested-externs"))
c_warn_nested_externs = 1;
else if (!strcmp (p, "-Wno-nested-externs"))
c_warn_nested_externs = 0;
else if (!strcmp (p, "-Wtraditional"))
c_warn_traditional = 1;
else if (!strcmp (p, "-Wno-traditional"))
c_warn_traditional = 0;
else if (!strcmp (p, "-Wformat"))
c_warn_format = 1;
else if (!strcmp (p, "-Wno-format"))
c_warn_format = 0;
else if (!strcmp (p, "-Wchar-subscripts"))
c_warn_char_subscripts = 1;
else if (!strcmp (p, "-Wno-char-subscripts"))
c_warn_char_subscripts = 0;
else if (!strcmp (p, "-Wconversion"))
c_warn_conversion = 1;
else if (!strcmp (p, "-Wno-conversion"))
c_warn_conversion = 0;
else if (!strcmp (p, "-Wparentheses"))
c_warn_parentheses = 1;
else if (!strcmp (p, "-Wno-parentheses"))
c_warn_parentheses = 0;
else if (!strcmp (p, "-Wreturn-type"))
c_warn_return_type = 1;
else if (!strcmp (p, "-Wno-return-type"))
c_warn_return_type = 0;
else if (!strcmp (p, "-Wcomment"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-comment"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wcomments"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-comments"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wtrigraphs"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-trigraphs"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wundef"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-undef"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wimport"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-import"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wmissing-braces"))
c_warn_missing_braces = 1;
else if (!strcmp (p, "-Wno-missing-braces"))
c_warn_missing_braces = 0;
else if (!strcmp (p, "-Wmain"))
c_warn_main = 1;
else if (!strcmp (p, "-Wno-main"))
c_warn_main = 0;
else if (!strcmp (p, "-Wsign-compare"))
c_warn_sign_compare = 1;
else if (!strcmp (p, "-Wno-sign-compare"))
c_warn_sign_compare = 0;
else if (!strcmp (p, "-Wall"))
{
/* We save the value of warn_uninitialized, since if they put
-Wuninitialized on the command line, we need to generate a
warning about not using it without also specifying -O. */
if (c_warn_uninitialized != 1)
c_warn_uninitialized = 2;
c_warn_implicit_int = 1;
c_mesg_implicit_function_declaration = 1;
c_warn_return_type = 1;
c_warn_unused = 1;
c_warn_switch = 1;
c_warn_format = 1;
c_warn_char_subscripts = 1;
c_warn_parentheses = 1;
c_warn_missing_braces = 1;
/* We set this to 2 here, but 1 in -Wmain, so -ffreestanding can turn
it off only if it's not explicit. */
c_warn_main = 2;
}
else
return 0;
return 1;
}
int c_parse_flags( Argc, Argv )
int Argc;
char **Argv;
{
int Index;
int Error;
Error = 0;
for ( Index = 0; Index < Argc; Index++ )
{
if ( ! c_parse_one_flags( Argv[ Index ] ) ) Error = 1;
}
return( Error );
}

View File

@ -1,303 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_flags.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_FLAGS_H
# define C_FLAGS_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
typedef struct c_file_stack
{
struct c_file_stack *NEXT;
char *NAME;
int LINE;
int INDENT_LEVEL;
} c_file_stack;
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/* Nonzero for -pedantic switch: warn about anything that standard C forbids. */
int c_pedantic;
/* Nonzero means try to imitate old fashioned non-ANSI preprocessor. */
int c_flag_traditional;
/* Nonzero means `$' can be in an identifier. */
extern int c_dollars_in_ident;
/* Nonzero enables objc features. */
extern int c_doing_objc_thang;
/* Nonzero means don't recognize the keyword `asm'. */
extern int c_flag_no_asm;
/* Temporarily suppress certain warnings.
extern This is set while reading code from a system header file. */
extern int c_in_system_header;
/* Nonzero means warn about any identifiers that match in the first N
extern characters. The value N is in `id_clash_len'. */
extern int c_warn_id_clash;
extern unsigned c_id_clash_len;
/* Nonzero for -fwritable-strings:
extern store string constants in data segment and don't uniquize them. */
extern int c_flag_writable_strings;
/* Nonzero means `char' should be signed. */
extern int c_flag_signed_char;
/* Nonzero means give an enum type only as many bytes as it needs. */
extern int c_flag_short_enums;
/* Nonzero means warn about function definitions that default the return type
extern or that use a null return and have a return-type other than void. */
extern int c_warn_return_type;
/* Nonzero to warn about variables used before they are initialized. */
extern int c_warn_uninitialized;
/* Nonzero to warn about unused local variables. */
extern int c_warn_unused;
/* Warn if a switch on an enum fails to have a case for every enum value. */
extern int c_warn_switch;
/* Nonzero means warn about all declarations which shadow others. */
extern int c_warn_shadow;
/* Nonzero means don't place uninitialized global data in common storage
extern by default. */
extern int c_flag_no_common;
/* Nonzero means warn about any objects definitions whose size is larger
extern than N bytes. Also want about function definitions whose returned
extern values are larger than N bytes. The value N is in `larger_than_size'. */
extern int c_warn_larger_than;
extern unsigned c_larger_than_size;
/* Nonzero means change certain warnings into errors.
extern Usually these are warnings about failure to conform to some standard. */
extern int c_flag_pedantic_errors;
/* Tag all structures with __attribute__(packed) */
extern int c_flag_pack_struct;
/* Warn about traditional constructs whose meanings changed in ANSI C. */
extern int c_warn_traditional;
/* Nonzero means that we have builtin functions, and main is an int */
extern int c_flag_hosted;
/* Nonzero means don't recognize any builtin functions. */
extern int c_flag_no_builtin;
/* Nonzero means to allow single precision math even if we're generally
extern being traditional. */
extern int flag_allow_single_precision;
/* Warn if main is suspicious. */
extern int c_warn_main;
/* Nonzero means to treat bitfields as signed unless they say `unsigned'. */
extern int c_flag_signed_bitfields;
extern int c_explicit_flag_signed_bitfields;
/* Nonzero means allow type mismatches in conditional expressions;
extern just make their values `void'. */
extern int c_flag_cond_mismatch;
/* Nonzero means give `double' the same size as `float'. */
extern int c_flag_short_double;
/* Nonzero means handle `#ident' directives. 0 means ignore them. */
extern int c_flag_no_ident;
/* Nonzero means don't recognize the non-ANSI builtin functions.
extern -ansi sets this. */
extern int c_flag_no_nonansi_builtin;
/* Nonzero means message about use of implicit function declarations;
1 means warning; 2 means error. */
extern int c_mesg_implicit_function_declaration;
/* Nonzero means warn about use of implicit int. */
extern int c_warn_implicit_int;
/* Nonzero means to allow single precision math even if we're generally
extern being traditional. */
extern int c_flag_allow_single_precision;
/* Nonzero means give string constants the type `const char *'
extern to get extra warnings from them. These warnings will be too numerous
extern to be useful, except in thoroughly ANSIfied programs. */
extern int c_warn_write_strings;
/* Nonzero means warn about pointer casts that can drop a type qualifier
extern from the pointer target type. */
extern int c_warn_cast_qual;
/* Nonzero means warn when casting a function call to a type that does
extern not match the return type (e.g. (float)sqrt() or (anything*)malloc()
extern when there is no previous declaration of sqrt or malloc. */
extern int c_warn_bad_function_cast;
/* Nonzero means warn about sizeof(function) or addition/subtraction
extern of function pointers. */
extern int c_warn_pointer_arith;
/* Nonzero means warn for non-prototype function decls
extern or non-prototyped defs without previous prototype. */
extern int c_warn_strict_prototypes;
/* Nonzero means warn for any global function def
extern without separate previous prototype decl. */
extern int c_warn_missing_prototypes;
/* Nonzero means warn for any global function def
extern without separate previous decl. */
extern int c_warn_missing_declarations;
/* Nonzero means warn about multiple (redundant) decls for the same single
extern variable or function. */
extern int c_warn_redundant_decls;
/* Nonzero means warn about extern declarations of objects not at
extern file-scope level and about *all* declarations of functions (whether
extern extern or static) not at file-scope level. Note that we exclude
extern implicit function declarations. To get warnings about those, use
extern -Wimplicit. */
extern int c_warn_nested_externs;
/* Warn about *printf or *scanf format/argument anomalies. */
extern int c_warn_format;
/* Warn about a subscript that has type char. */
extern int c_warn_char_subscripts;
/* Warn if a type conversion is done that might have confusing results. */
extern int c_warn_conversion;
/* Warn if adding () is suggested. */
extern int c_warn_parentheses;
/* Warn if initializer is not completely bracketed. */
extern int c_warn_missing_braces;
/* Warn about comparison of signed and unsigned values.
extern If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified. */
extern int c_warn_sign_compare;
/* Temporarily suppress certain warnings.
This is set while reading code from a system header file. */
extern int c_in_system_header;
/* Name of current original source file (what was input to cpp).
This comes from each #-command in the actual input. */
extern char *c_input_filename;
/* Name of top-level original source file (what was input to cpp).
This comes from the #-command at the beginning of the actual input.
If there isn't any there, then this is the cc1 input file name. */
extern char *c_main_input_filename;
/* Current line number in real source file. */
extern int c_lineno;
/* Stack of currently pending input files. */
extern c_file_stack *c_input_file_stack;
/* Incremented on each change to input_file_stack. */
extern int c_input_file_stack_tick;
/* Nonzero for -ffloat-store: don't allocate floats and doubles
in extended-precision registers. */
extern int c_flag_float_store;
/* Nonzero means all references through pointers are volatile. */
extern int c_flag_volatile;
/* Don't print warning messages. -w. */
extern int c_inhibit_warnings;
/* Print various extra warnings. -W. */
extern int c_extra_warnings;
/* Treat warnings as errors. -Werror. */
extern int c_warnings_are_errors;
/* Nonzero means we should be saving declaration info into a .X file. */
extern int c_flag_gen_aux_info;
/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
operations in the interest of optimization. For example it allows
GCC to assume arguments to sqrt are nonnegative numbers, allowing
faster code for sqrt to be generated. */
extern int c_flag_fast_math;
extern int c_parse_flags __P((int Argc, char **Argv));
# endif

File diff suppressed because it is too large Load Diff

View File

@ -1,87 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_foldconst.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_FOLD_CONST_H
# define C_FOLD_CONST_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
Zero means allow extended lvalues. */
extern int c_pedantic_lvalues;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern c_tree_node *c_invert_truthvalue __P((c_tree_node *arg));
extern c_tree_node *c_non_lvalue __P(( c_tree_node *x));
extern c_tree_node *c_build_size_binop __P(( int code, c_tree_node *arg0, c_tree_node *arg1));
extern c_tree_node *c_fold __P((c_tree_node *expr));
extern int c_is_operand_equal_p __P((c_tree_node *arg0, c_tree_node *arg1, int only_const));
extern c_tree_node *c_get_pedantic_non_lvalue __P((c_tree_node *x));
# endif

View File

@ -1,219 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/* C code produced by gperf version 2.5 (GNU C++ version) */
/* Command-line: gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ ./c-parse.gperf */
/* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
struct resword { char *name; short token; enum rid rid; };
#define TOTAL_KEYWORDS 79
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 20
#define MIN_HASH_VALUE 10
#define MAX_HASH_VALUE 144
/* maximum key range = 135, duplicates = 0 */
#ifdef __GNUC__
inline
#endif
static unsigned int
hash (str, len)
register char *str;
register int unsigned len;
{
static unsigned char asso_values[] =
{
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 25, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 1, 145, 46, 8, 15,
61, 6, 36, 48, 3, 5, 145, 18, 63, 25,
29, 76, 1, 145, 13, 2, 1, 51, 37, 9,
9, 1, 3, 145, 145, 145, 145, 145,
};
register int hval = len;
switch (hval)
{
default:
case 3:
hval += asso_values[(unsigned int)str[2]];
case 2:
case 1:
hval += asso_values[(unsigned int)str[0]];
break;
}
return hval + asso_values[(unsigned int)str[len - 1]];
}
static struct resword wordlist[] =
{
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",},
{"int", tok_TYPESPEC, RID_INT},
{"",}, {"",},
{"__typeof__", tok_TYPEOF, NORID},
{"__signed__", tok_TYPESPEC, RID_SIGNED},
{"__imag__", tok_IMAGPART, NORID},
{"switch", tok_SWITCH, NORID},
{"__inline__", tok_SCSPEC, RID_INLINE},
{"else", tok_ELSE, NORID},
{"__iterator__", tok_SCSPEC, RID_ITERATOR},
{"__inline", tok_SCSPEC, RID_INLINE},
{"__extension__", tok_EXTENSION, NORID},
{"struct", tok_STRUCT, NORID},
{"__real__", tok_REALPART, NORID},
{"__const", tok_TYPE_QUAL, RID_CONST},
{"while", tok_WHILE, NORID},
{"__const__", tok_TYPE_QUAL, RID_CONST},
{"case", tok_CASE, NORID},
{"__complex__", tok_TYPESPEC, RID_COMPLEX},
{"__iterator", tok_SCSPEC, RID_ITERATOR},
{"bycopy", tok_TYPE_QUAL, RID_BYCOPY},
{"",}, {"",}, {"",},
{"__complex", tok_TYPESPEC, RID_COMPLEX},
{"",},
{"in", tok_TYPE_QUAL, RID_IN},
{"break", tok_BREAK, NORID},
{"@defs", tok_DEFS, NORID},
{"",}, {"",}, {"",},
{"extern", tok_SCSPEC, RID_EXTERN},
{"if", tok_IF, NORID},
{"typeof", tok_TYPEOF, NORID},
{"typedef", tok_SCSPEC, RID_TYPEDEF},
{"__typeof", tok_TYPEOF, NORID},
{"sizeof", tok_SIZEOF, NORID},
{"",},
{"return", tok_RETURN, NORID},
{"const", tok_TYPE_QUAL, RID_CONST},
{"__volatile__", tok_TYPE_QUAL, RID_VOLATILE},
{"@private", tok_PRIVATE, NORID},
{"@selector", tok_SELECTOR, NORID},
{"__volatile", tok_TYPE_QUAL, RID_VOLATILE},
{"__asm__", tok_ASM_KEYWORD, NORID},
{"",}, {"",},
{"continue", tok_CONTINUE, NORID},
{"__alignof__", tok_ALIGNOF, NORID},
{"__imag", tok_IMAGPART, NORID},
{"__attribute__", tok_ATTRIBUTE, NORID},
{"",}, {"",},
{"__attribute", tok_ATTRIBUTE, NORID},
{"for", tok_FOR, NORID},
{"",},
{"@encode", tok_ENCODE, NORID},
{"id", tok_OBJECTNAME, RID_ID},
{"static", tok_SCSPEC, RID_STATIC},
{"@interface", tok_INTERFACE, NORID},
{"",},
{"__signed", tok_TYPESPEC, RID_SIGNED},
{"",},
{"__label__", tok_LABEL, NORID},
{"",}, {"",},
{"__asm", tok_ASM_KEYWORD, NORID},
{"char", tok_TYPESPEC, RID_CHAR},
{"",},
{"inline", tok_SCSPEC, RID_INLINE},
{"out", tok_TYPE_QUAL, RID_OUT},
{"register", tok_SCSPEC, RID_REGISTER},
{"__real", tok_REALPART, NORID},
{"short", tok_TYPESPEC, RID_SHORT},
{"",},
{"enum", tok_ENUM, NORID},
{"inout", tok_TYPE_QUAL, RID_INOUT},
{"",},
{"oneway", tok_TYPE_QUAL, RID_ONEWAY},
{"union", tok_UNION, NORID},
{"",},
{"__alignof", tok_ALIGNOF, NORID},
{"",},
{"@implementation", tok_IMPLEMENTATION, NORID},
{"",},
{"@class", tok_CLASS, NORID},
{"",},
{"@public", tok_PUBLIC, NORID},
{"asm", tok_ASM_KEYWORD, NORID},
{"",}, {"",}, {"",}, {"",}, {"",},
{"default", tok_DEFAULT, NORID},
{"",},
{"void", tok_TYPESPEC, RID_VOID},
{"",},
{"@protected", tok_PROTECTED, NORID},
{"@protocol", tok_PROTOCOL, NORID},
{"",}, {"",}, {"",},
{"volatile", tok_TYPE_QUAL, RID_VOLATILE},
{"",}, {"",},
{"signed", tok_TYPESPEC, RID_SIGNED},
{"float", tok_TYPESPEC, RID_FLOAT},
{"@end", tok_END, NORID},
{"",}, {"",},
{"unsigned", tok_TYPESPEC, RID_UNSIGNED},
{"@compatibility_alias", tok_ALIAS, NORID},
{"double", tok_TYPESPEC, RID_DOUBLE},
{"",}, {"",},
{"auto", tok_SCSPEC, RID_AUTO},
{"",},
{"goto", tok_GOTO, NORID},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"do", tok_DO, NORID},
{"",}, {"",}, {"",}, {"",},
{"long", tok_TYPESPEC, RID_LONG},
};
#ifdef __GNUC__
inline
#endif
struct resword *
c_is_reserved_word (str, len)
register char *str;
register unsigned int len;
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register char *s = wordlist[key].name;
if (*s == *str && !strcmp (str + 1, s + 1))
return &wordlist[key];
}
}
return 0;
}

View File

@ -1,172 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : VBL |
| |
| File : c_parse.c |
| |
| Author : Jacomme Ludovic |
| |
| Date : 01.01.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include <unistd.h>
# include <sys/stat.h>
# include <errno.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include "c_tree.h"
# include "c_cdecl.h"
# include "c_clex.h"
# include "c_debug.h"
# include "c_flags.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern FILE *c_y_in;
extern int c_y_parse();
static char BuffTmpFile[ 64 ];
static int UnlinkTmpFile = 0;
void gcpexit( Code )
int Code;
{
if ( UnlinkTmpFile )
{
unlink( BuffTmpFile );
}
autexit( Code );
}
/*------------------------------------------------------------\
| |
| c_tree_parse_file |
| |
\------------------------------------------------------------*/
c_tree_node *c_tree_parse_file( InputFileName, Argc, Argv )
char *InputFileName;
int Argc;
char **Argv;
{
struct stat Stat;
char BuffExec[ 2048 ];
char *ScanArg;
int Index;
int Error;
if ( stat( InputFileName, &Stat ) )
{
fprintf( stdout, "Error unable to open file %s\n", InputFileName );
gcpexit( 1 );
}
sprintf( BuffTmpFile, "/tmp/gcp%d", getpid() );
ScanArg = BuffExec;
sprintf( ScanArg, "gcc -E %s ", InputFileName );
ScanArg += strlen( ScanArg );
for ( Index = 0; Index < Argc; Index++ )
{
strcpy( ScanArg, "'" );
ScanArg += 1;
strcpy( ScanArg, Argv[ Index ] );
ScanArg += strlen( ScanArg );
strcpy( ScanArg, "' " );
ScanArg += 2;
}
sprintf( ScanArg, "-o %s", BuffTmpFile );
UnlinkTmpFile = 1;
errno = 0;
Error = system( BuffExec );
if ( ( Error ) &&
( Error != -1 ) )
{
fprintf( stdout,
"An error occured while preprocessing %s, exit code %d (errno %d)\n",
InputFileName, Error, errno );
gcpexit( 2 );
}
c_y_in = fopen( BuffTmpFile, "r" );
if ( c_y_in == (FILE *)0 )
{
fprintf( stdout, "Error unable to open file %s\n", BuffTmpFile );
gcpexit( 3 );
}
c_parse_flags( Argc, Argv );
c_init_lex( InputFileName );
c_init_decl_processing();
Error = c_y_parse();
fclose( c_y_in );
unlink( BuffTmpFile );
UnlinkTmpFile = 0;
return( c_tree_program_node );
}

View File

@ -1,52 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_cparse.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_CPARSE_H
# define C_CPARSE_H
extern void gcpexit __P(( int Code ));
# endif

View File

@ -1,93 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_stmt.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_flags.h"
# include "c_tree.h"
# include "c_treecompat.h"
# include "c_cdecl.h"
# include "c_convert.h"
# include "c_ctypeck.h"
# include "c_stmt.h"
# include "c_debug.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/* Filename and line number of last line-number note,
whether we actually emitted it or not. */
char *c_emit_filename;
int c_emit_lineno;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
void c_emit_line_note(file, line)
char *file;
int line;
{
c_emit_filename = file;
c_emit_lineno = line;
}

View File

@ -1,81 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_stmt.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_STMT_H
# define C_STMT_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern char *c_emit_filename;
extern int c_emit_lineno;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern void c_emit_line_note __P((char *file, int line));
# endif

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_tree.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_TREE_H
# define C_TREE_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
# endif

View File

@ -1,109 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_treecompat.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_TREE_COMPAT_H
# define C_TREE_COMPAT_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
# define C_NULL_TREE (c_tree_node *)0
# define TREE_TYPE(N) CTreeType(N)
# define TREE_CHAIN(N) CTreeChain(N)
# define TREE_INT_CST_LOW(N) CTreeIntCstLow(N)
# define TREE_INT_CST_HIGH(N) CTreeIntCstHigh(N)
# define TYPE_MIN_VALUE(N) CTreeTypeMinValue( N )
# define TYPE_MAX_VALUE(N) CTreeTypeMaxValue( N )
typedef union c_tree_node *tree;
# define NULL_TREE (tree)0
#define INT_CST_LT(A, B) \
(CTreeIntCstHigh(A) < CTreeIntCstHigh(B) \
|| ( CTreeIntCstHigh(A) == CTreeIntCstHigh(B) \
&& ((unsigned int) CTreeIntCstLow(A) \
< (unsigned int) CTreeIntCstLow(B))))
#define INT_CST_LT_UNSIGNED(A, B) \
(((unsigned int) CTreeIntCstHigh(A) \
< (unsigned int) CTreeIntCstHigh(B)) \
|| (((unsigned int) CTreeIntCstHigh(A) \
== (unsigned int ) CTreeIntCstHigh(B)) \
&& (((unsigned int) CTreeIntCstLow(A) \
< (unsigned int) CTreeIntCstLow(B)))))
# define INTEGRAL_TYPE_P(TYPE) \
( CTreeTypeCode(TYPE) == C_INTEGER_TYPE || \
CTreeTypeCode(TYPE) == C_ENUMERAL_TYPE || \
CTreeTypeCode(TYPE) == C_BOOLEAN_TYPE || \
CTreeTypeCode(TYPE) == C_CHAR_TYPE)
#define POINTER_TYPE_P(TYPE) \
(CTreeTypeCode(TYPE) == C_POINTER_TYPE || \
CTreeTypeCode(TYPE) == C_REFERENCE_TYPE)
# define REAL_VALUE_TYPE double
#define REAL_VALUE_NEGATE(N) (double)(-N)
#define REAL_VALUE_NEGATIVE(N) ((N) < 0.0)
#define REAL_VALUES_EQUAL(A,B) ((A) == (B))
#define REAL_VALUES_LESS(A,B) ((A) < (B))
#define FLOAT_TYPE_P(TYPE) \
( CTreeTypeCode(TYPE) == C_REAL_TYPE \
|| ( CTreeTypeCode(TYPE) == C_COMPLEX_TYPE \
&& CTreeTypeCode( CTreeType(TYPE)) == C_REAL_TYPE))
# define REAL_VALUES_IDENTICAL(A, B) (A == B)
# endif

File diff suppressed because it is too large Load Diff

View File

@ -1,187 +0,0 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail : mailto:alliance-users@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
/*------------------------------------------------------------\
| |
| Usage |
| |
\------------------------------------------------------------*/
void CUsage()
{
fprintf( stderr, "\t\tgcptest --[Options] Input_name_1 ... Input_name_N -[GCC Options]\n\n" );
fprintf( stdout, "\t\tOptions : --V Sets Verbose mode on\n" );
fprintf( stdout, "\t\t --D Sets Debug mode on\n" );
fprintf( stdout, "\t\t --F Sets Force display\n" );
fprintf( stdout, "\t\t --T Sets display Types\n" );
fprintf( stdout, "\t\t --S Sets display Sizes\n" );
fprintf( stdout, "\n" );
exit( 1 );
}
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern int c_y_debug;
int main( argc, argv )
int argc;
char **argv;
{
c_tree_node *TreeNode;
char *InputFileName[ 10 ];
int Last;
int Number;
int Index;
char Option;
char *Extention;
char **Argv;
int Argc;
int FlagVerbose = 0;
int FlagDebug = 0;
int NoMoreFileName = 0;
mbkenv();
autenv();
if ( argc < 2 ) CUsage();
InputFileName[ 0 ] = (char *)0;
Last = 0;
Argc = 0;
Argv = (char **)0;
for ( Number = 1; Number < argc; Number++ )
{
if ( argv[ Number ][ 0 ] == '-' )
{
if ( argv[ Number ][ 1 ] == '-' )
{
for ( Index = 2; argv[ Number ][ Index ] != '\0'; Index++ )
{
Option = argv[ Number ][ Index ];
if ( Option == 'I' )
{
Number++;
if ( Number < argc ) Extention = argv[ Number ];
else CUsage();
break;
}
switch ( Option )
{
case 'V' : FlagVerbose = 1;
break;
case 'D' : FlagDebug |= 1;
break;
case 'F' : FlagDebug |= 2;
break;
case 'T' : FlagDebug |= 4;
break;
case 'S' : FlagDebug |= 8;
break;
default : CUsage();
}
}
}
else
if ( ! NoMoreFileName )
{
NoMoreFileName = 1;
Argv = &argv[ Number ];
Argc = argc - Number;
}
}
else
if ( ! NoMoreFileName )
{
InputFileName[ Last ] = argv[ Number ];
Last++;
if ( Last >= 10 ) NoMoreFileName = 1;
else InputFileName[ Last ] = (char *)0;
}
else
CUsage();
}
if ( InputFileName[ 0 ] == (char *)0 ) CUsage();
if ( FlagDebug & 1 )
{
c_y_debug = 1;
}
if ( FlagDebug & 2 )
{
C_TREE_FORCE_VIEW_NODE = 1;
}
if ( FlagDebug & 4 )
{
C_TREE_VIEW_TYPE_NODE = 1;
}
if ( FlagDebug & 8 )
{
C_TREE_VIEW_SIZE_NODE = 1;
}
for ( Index = 0; Index < Last; Index++ )
{
if ( FlagVerbose )
{
fprintf( stdout, "--> Processing file %s\n", InputFileName[ Index ] );
}
TreeNode = c_tree_parse_file( InputFileName[ Index ], Argc, Argv );
if ( FlagVerbose )
{
fprintf( stdout, "<-- done\n\n" );
c_tree_view_node( TreeNode );
}
}
c_tree_free_all_node();
return( 0 );
}

View File

@ -1,249 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 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.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our 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. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, 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 a 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 tell them 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.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement 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 work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. 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
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual 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 General
Public License.
d) 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.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying 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.
6. 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.
7. 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 the 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
the license, you may choose any version ever published by the Free Software
Foundation.
8. 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.
NO WARRANTY
9. 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.
10. 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 OF TERMS AND CONDITIONS
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 humanity, 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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <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 1, 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.
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:
Gnomovision version 69, Copyright (C) 19xx 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.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `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 a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
That's all there is to it!

File diff suppressed because it is too large Load Diff

View File

@ -1,888 +0,0 @@
This is a copy of one node from the Info file gcc.info-3.
For full information on installing and porting GCC, refer to the
GCC manual:
Info file gcc.info
TeX output gcc.dvi
TeX source gcc.texinfo
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.
* SCO Install:: See below for installation on SCO System V 3.2. (Or ESIX.)
* VMS Install:: See below for installation on VMS.
* HPUX Install:: See below for installation on HPUX.
* Tower Install:: See below for installation on an NCR Tower.
1. Edit `Makefile'. If you are using HPUX, or any form of system V,
you must make a few changes described in comments at the beginning
of the file. Genix requires changes also, and so does the Pyramid.
2. On a Sequent system, go to the Berkeley universe.
3. Choose configuration files. The easy way to do this is to run the
command file `config.gcc' with a single argument, which specifies
the type of machine (and in some cases which operating system).
Here is a list of the possible arguments:
`vax'
Vaxes running BSD.
`vms'
Vaxes running VMS.
`vax-sysv'
Vaxes running system V.
`i386-sysv'
Intel 386 PCs running system V.
`i386-sysv-gas'
Intel 386 PCs running system V, using the GNU assembler and
GNU linker.
`i386-sysv4'
Intel 386 PCs running system V.4. You must run the shell
script `fixincludes-V4' in order for GNU CC to work properly.
You must also uncomment some lines in `Makefile'.
`sequent-i386'
Sequent with Intel 386 processors.
`i386-aix'
Intel 386 PCs or PS/2s running AIX.
`sun2'
Sun 2 running system version 2 or 3.
`sun3'
Sun 3 running system version 4, with 68881. Note there we do
not provide a configuration file to use an FPA by default,
because programs that establish signal handlers for floating
point traps inherently cannot work with the FPA.
`sun3-nfp'
Sun 3 running system version 4, without 68881.
`sun4'
Sun 4 running system version 4. *Note Incompatibilities::,
for calling convention incompatibilities on the Sun 4 (sparc).
`sun2-os4'
Sun 2 running system version 4.
`sun3-os3'
Sun 3 running system version 2 or 3, with 68881.
`sun3-nfp-os3'
Sun 3 running system version 2 or 3, without 68881.
`sun4-os3'
Sun 4 running system version 2 or 3. *Note
Incompatibilities::, for calling convention incompatibilities
on the Sun 4 (sparc).
`sun386'
Sun 386 ("roadrunner").
`alliant'
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:
cp /bin/pcc ./pcc
adb -w ./pcc - << EOF
15f6?w 6610
EOF
Then you must use the `-ip12' option when compiling GNU CC
with the patched compiler, as shown here:
make CC="./pcc -ip12" CFLAGS=-w
Note also that Alliant's version of DBX does not manage to
work with the output from GNU CC.
`tahoe'
The tahoe computer (running BSD, and using DBX).
`decstation'
The DEC 3100 Mips machine ("pmax"). Note that GNU CC cannot
generate debugging information in the unusual format used on
the Mips.
`mips-sysv-os5'
The Mips computer, RS series, with the System V environment
running on revision 5.00 of RISC-OS as default. Note that GNU
CC cannot generate debugging information in the unusual
format used on the Mips, and also cannot be used to create
programs that use shared libraries.
`mips-sysv'
The Mips computer, RS series, with the System V environment
as default. Note that GNU CC cannot generate debugging
information in the unusual format used on the Mips.
`mips-bsd43-os5'
The Mips computer, RS series, with the BSD 4.3 environment
running revision 5.00 of RISC-OS as default. Note that GNU CC
cannot generate debugging information in the unusual format
used on the Mips, and also cannot be used to create programs
that use shared libraries.
`mips-bsd43'
The Mips computer, RS series, with the BSD 4.3 environment as
default. Note that GNU CC cannot generate debugging
information in the unusual format used on the Mips.
`mips-os5'
The Mips computer, M series running revision 5.00 of RISC-OS.
Note that GNU CC cannot generate debugging information in the
unusual format used on the Mips, and also cannot be used to
create programs that use shared libraries.
`mips'
The Mips computer, M series. Note that GNU CC cannot
generate debugging information in the unusual format used on
the Mips.
`iris'
Another variant of the Mips computer, the Silicon Graphics
Iris 4D. Note that GNU CC cannot generate debugging
information in the unusual format used on the Mips.
`convex-c1'
Convex C1 computer. With operating system version 9, use `cc
-pcc' as the compilation command when building stage 1 of GNU
CC.
`convex-c2'
Convex C2 computer. With operating system version 9, use `cc
-pcc' as the compilation command when building stage 1 of GNU
CC.
`pyramid'
Pyramid computer.
`hp9k320'
HP 9000 series 300 using HPUX assembler. Note there is no
support in GNU CC for HP's debugger; thus, `-g' is not
available in this configuration.
`hp9k320-gas'
HP 9000 series 300 using GNU assembler, linker and debugger.
This requires the HP-adapt package, which is available along
with the GNU linker as part of the "binutils" distribution.
This is on the GNU CC distribution tape.
`hp9k320-old'
HP 9000 series 300 using HPUX assembler, in operating system
versions older than 6.5. Note there is no support in GNU CC
for HP's debugger; thus, `-g' is not available in this
configuration.
`hp9k320-bsd'
HP 9000 series 300 running BSD.
`hp9k200-bsd'
HP 9000 series 200 running BSD. Note that the C compiler
that comes with this system cannot compile GNU CC; contact
`law@super.org' to get binaries of GNU CC for bootstrapping.
Additionally, a minor patch is necessary if you wish to build
kernels with GNU CC; contact `law@super.org' to get a copy of
the patch.
`isi68'
ISI 68000 or 68020 system with a 68881.
`isi68-nfp'
ISI 68000 or 68020 system without a 68881.
`news800'
Sony NEWS 68020 system.
`next'
NeXT system.
`tower'
NCR Tower 32 system.
`altos'
Altos 3068. Note that you must use the GNU assembler, linker
and debugger, with COFF-encapsulation. Also, you must fix a
kernel bug. Details in the file `ALTOS-README'.
`3b1'
AT&T 3b1, a.k.a. 7300 PC. Note that special procedures are
needed to compile GNU CC with this machine's standard C
compiler, due to bugs in that compiler. *Note 3b1 Install::.
You can bootstrap it more easily with previous versions of
GNU CC if you have them.
`3b1-gas'
AT&T 3b1 using the GNU assembler.
`sequent-ns32k'
Sequent containing ns32000 processors.
`encore'
Encore ns32000 system.
`genix'
National Semiconductor ns32000 system.
`88000'
Motorola 88000 processor. This port is not finished.
Here we spell out what files need to be set up:
* Make a symbolic link named `config.h' to the top-level config
file for the machine you are using (*note Config::.). This
file is responsible for defining information about the host
machine. It includes `tm.h'.
The file is located in the subdirectory `config'. Its name
should be `xm-MACHINE.h', with these exceptions:
`xm-vms.h'
for vaxen running VMS.
`xm-vaxv.h'
for vaxen running system V.
`xm-i386v.h'
for Intel 80386's running system V.
`xm-sun386i.h'
for Sun roadrunner running any version of the operating
system.
`xm-hp9k320.h'
for the HP 9000 series 300.
`xm-genix.h'
for the ns32000 running Genix
If your system does not support symbolic links, you might
want to set up `config.h' to contain a `#include' command
which refers to the appropriate file.
* Make a symbolic link named `tm.h' to the machine-description
macro file for your machine. It should be in the subdirectory
`config' and its name should be `tm-MACHINE.h'.
If your system is a 68000, don't use the file `tm-m68k.h'
directly. Instead, use one of these files:
`tm-sun3.h'
for Sun 3 machines with 68881.
`tm-sun3-nfp.h'
for Sun 3 machines with no hardware floating point.
`tm-sun3os3.h'
for Sun 3 machines with 68881, running Sunos version 3.
`tm-sun3os3nf.h'
for Sun 3 machines with no hardware floating point,
running Sunos version 3.
`tm-sun2.h'
for Sun 2 machines.
`tm-3b1.h'
for AT&T 3b1 (aka 7300 Unix PC).
`tm-isi68.h'
for Integrated Solutions systems. This file assumes you
use the GNU assembler.
`tm-isi68-nfp.h'
for Integrated Solutions systems without a 68881. This
file assumes you use the GNU assembler.
`tm-news800.h'
for Sony NEWS systems.
`tm-hp9k320.h'
for HPUX systems, if you are using GNU CC with the
system's assembler and linker.
`tm-hp9k320g.h'
for HPUX systems, if you are using the GNU assembler,
linker and other utilities. Not all of the pieces of
GNU software needed for this mode of operation are as
yet in distribution; full instructions will appear here
in the future.
`tm-tower-as.h'
for NCR Tower 32 systems, using the standard system
assembler.
For the vax, use `tm-vax.h' on BSD Unix, `tm-vaxv.h' on
system V, or `tm-vms.h' on VMS.
For the Motorola 88000, use `tm-m88k.h'. The support for the
88000 does not currently work; it requires extensive changes
which we hope to reconcile in version 2.
For the 80386, don't use `tm-i386.h' directly. Use
`tm-i386v.h' if the target machine is running system V,
`tm-i386gas.h' if it is running system V but you are using the
GNU assembler and linker, `tm-seq386.h' for a Sequent 386
system, or `tm-compaq.h' for a Compaq, or `tm-sun386i.h' for
a Sun 386 system.
For the Mips computer, there are five choices: `tm-mips.h'
for the M series, `tm-mips-bsd.h' for the RS series with BSD,
`tm-mips-sysv.h' for the RS series with System V, `tm-iris.h'
for the Iris version of the machine, and `tm-decstatn.h' for
the Decstation.
For the 32000, use `tm-sequent.h' if you are using a Sequent
machine, or `tm-encore.h' for an Encore machine, or
`tm-genix.h' if you are using Genix version 3; otherwise,
perhaps `tm-ns32k.h' will work for you.
Note that Genix has bugs in `alloca' and `malloc'; you must
get the compiled versions of these from GNU Emacs and edit
GNU CC's `Makefile' to use them.
Note that Encore systems are supported only under BSD.
For Sparc (Sun 4) machines, use `tm-sparc.h' with operating
system version 4, and `tm-sun4os3.h' with system version 3.
For Convex systems before version 8.1, use `tm-conv1os7.h' or
`tm-conv2os7.h'. For versions 8.1 and greater, use
`tm-convex1.h' or `tm-convex2.h'. You should also bootstrap
GCC with `pcc' rather than `cc'; one way to do this is with
the following commands.
ln -s /bin/pcc ./cc
set path = (. $path)
* Make a symbolic link named `md' to the machine description
pattern file. It should be in the `config' subdirectory and
its name should be `MACHINE.md'; but MACHINE is often not the
same as the name used in the `tm.h' file because the `md'
files are more general.
* Make a symbolic link named `aux-output.c' to the output
subroutine file for your machine. It should be in the
`config' subdirectory and its name should be `out-MACHINE.c'.
4. Make sure the Bison parser generator is installed. (This is
unnecessary if the Bison output files `c-parse.tab.c' and `cexp.c'
are more recent than `c-parse.y' and `cexp.y' and you do not plan
to change the `.y' files.)
Bison versions older than Sept 8, 1988 will produce incorrect
output for `c-parse.tab.c'.
5. If you have a previous version of GCC installed, then chances are
you can compile the new version with that. Do the following:
make CC="gcc -O"
Since this produces an optimized executable right away, there is
no need to bootstrap the result with itself except to test it.
Therefore, you can skip directly to the `make install' step below.
6. Build the compiler. Just type `make' in the compiler directory.
Ignore any warnings you may see about "statement not reached" in
the `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 (*note 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.
7. If you are using COFF-encapsulation, you must convert `gnulib' to
a GNU-format library at this point. See the file `README-ENCAP'
in the directory containing the GNU binary file utilities, for
directions.
8. Move the first-stage object files and executables into a
subdirectory with this command:
make stage1
The files are moved into a subdirectory named `stage1'. Once
installation is complete, you may wish to delete these files with
`rm -r stage1'.
9. Recompile the compiler with itself, with this command:
make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
This is called making the stage 2 compiler.
On a 68000 or 68020 system lacking floating point hardware, unless
you have selected a `tm.h' file that expects by default that there
is no such hardware, do this instead:
make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float"
10. If you wish to test the compiler by compiling it with itself one
more time, do this (in C shell):
make stage2
make CC=stage2/gcc CFLAGS="-g -O -Bstage2/"
foreach file (*.o)
cmp $file stage2/$file
end
This is called making the stage 3 compiler. Aside from the `-B'
option, the options should be the same as when you made the stage 2
compiler.
The `foreach' command (written in C shell) will notify you if any
of these stage 3 object files differs from those of stage 2. On
BSD systems, 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 (*note 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):
for file in *.o; do
echo $file
tail +10c $file > foo1
tail +10c stage2/$file > foo2
cmp foo1 foo2
done
On MIPS machines, you should use the shell script `ecoff-cmp' to
compare two object files.
11. Install the compiler driver, the compiler's passes and run-time
support. You can use the following command:
make install
On some machines, you will find that starts to recompile the `.c'
files, due to a bug in Make. If that happens, cancel it and try
again specifying the same values for Make variables that you used
in the last compilation; that may not prevent the spurious
recompilation, but will at least do it properly. For example:
make CC=stage2/gcc CFLAGS="-g -O -Bstage2/" install
The `install' target copies the files `cc1', `cpp' and `gnulib' to
files `gcc-cc1', `gcc-cpp' and `gcc-gnulib' in directory
`/usr/local/lib', which is where the compiler driver program looks
for them. It also copies the driver program `gcc' into the
directory `/usr/local/bin', so that it appears in typical
execution search paths.
*Warning: there is a bug in `alloca' in the Sun library. To avoid
this bug, install the binaries of GNU CC that were compiled by GNU
CC. They use `alloca' as a built-in function and never the one in
the library.*
*Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h' and
other system header files unless the `-traditional' option is
used.* The bug is in the header files: at least on some machines,
they rely on behavior that is incompatible with ANSI C. This
behavior consists of substituting for macro argument names when
they appear inside of character constants. The `-traditional'
option tells GNU CC to behave the way these headers expect.
Because of this problem, you might prefer to configure GNU CC to
use the system's own C preprocessor. To do so, make the file
`/usr/local/lib/gcc-cpp' a link to `/lib/cpp'.
Alternatively, on Sun systems and 4.3BSD at least, you can correct
the include files by running the shell script `fixincludes'. This
installs modified, corrected copies of the files `ioctl.h',
`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:
make includes
If you selected a different directory for GNU CC installation when
you installed it, by specifying the Make variable `prefix' or
`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 `fixincludes'; it may
not work, and is certainly not necessary.
*Warning:* `fixincludes' does not work on many MIPS systems,
because those systems come with circular symbolic links which cause
`ls -lR' to go into an infinite loop. The same problem may occur
on some versions of SunOS. If you encounter this problem, try
using `fixinc.new' instead opf `fixincludes'.
If you cannot install the compiler's passes and run-time support in
`/usr/local/lib', you can alternatively use the `-B' option to specify
a prefix by which they may be found. The compiler concatenates the
prefix with the names `cpp', `cc1' and `gnulib'. Thus, you can put the
files in a directory `/usr/foo/gcc' and specify `-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 `libdir' when you make GNU CC.

File: gcc.info, Node: Other Dir, Next: Sun Install, Prev: Installation, Up: Installation
Compilation in a Separate Directory
===================================
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:
1. Go to that directory before running `config.gcc':
mkdir gcc-sun3
cd gcc-sun3
On systems that do not support symbolic links, this directory must
be on the same file system as the source code directory.
2. Specify where to find `config.gcc' when you run it:
../gcc-1.36/config.gcc ...
3. Specify where to find the sources, as an argument to `config.gcc':
../gcc-1.36/config.gcc -srcdir=../gcc-1.36 sun3
The `-srcdir=DIR' option is not needed when the source directory
is the parent of the current directory, because `config.gcc'
detects that case automatically.
Now, you can run `make' in that directory. You need not repeat the
configuration steps shown above, when ordinary source files change. You
must, however, run `config.gcc' again when the configuration files
change, if your system does not support symbolic links.

File: gcc.info, Node: Sun Install, Next: 3b1 Install, Prev: Other Dir, Up: Installation
Installing GNU CC on the Sun
============================
Make sure the environment variable `FLOAT_OPTION' is not set when
you compile `gnulib'. If this option were set to `f68881' when
`gnulib' is compiled, the resulting code would demand to be linked with
a special startup file and would not link properly without special
pains.
There is a bug in `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 `alloca' as a built-in function and never the one in
the library.
Some versions of the Sun compiler crash when compiling GNU CC, with a
segmentation fault in cpp. This can sometimes 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:
make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
Another problem that often happens on Suns is that you get a crash
when building stage 2, when `genflags' is run.
One reason for such as crash is if you configured GNU CC for the
wrong version of SunOS. Starting with version 1.38, configurations
`sun3' and `sun4' are for SunOS 4, so this problem should no longer
happen.
Another cause of the same symptom is having installed the GNU linker
with an earlier version of SunOS. The version that worked before
stopped working due to a change in the format of executables in SunOS
4.1. Many sites have installed the GNU linker as
`/usr/local/lib/gcc-ld', often as part of installing GNU C++. So if
you get such crashes and you have used the proper configuration, try
deleting `/usr/local/lib/gcc-ld'.
The current version of the GNU linker, found in the current binutils
release, does work with SunOS 4.1.

File: gcc.info, Node: 3b1 Install, Next: SCO Install, Prev: Sun Install, Up: Installation
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.
1. Comment out the `#include "config.h"' line on line 37 of `cccp.c'
and do `make cpp'. This makes a preliminary version of GNU cpp.
2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to that
file name.
3. Undo your change in `cccp.c', or reinstall the original version,
and do `make cpp' again.
4. Copy this final version of GNU cpp into `/lib/cpp'.
5. Replace every occurrence of `obstack_free' in `tree.c' with
`_obstack_free'.
6. Run `make' to get the first-stage GNU CC.
7. Reinstall the original version of `/lib/cpp'.
8. Now you can compile GNU CC with itself and install it in the normal
fashion.
If you have installed an earlier version of GCC, you can compile the
newer version with that. However, you will run into trouble compiling
`gnulib', since that is normally compiled with CC. To solve the
problem, uncomment this line in `Makefile':
CCLIBFLAGS = -B/usr/local/lib/gcc- -tp -Wp,-traditional

File: gcc.info, Node: SCO Install, Next: VMS Install, Prev: 3B1 Install, Up: Installation
Installing GNU CC on SCO System V 3.2
=====================================
The compiler that comes with this system does not work properly with
`-O'. Therefore, you should redefine the Make variable `CCLIBFLAGS'
not to use `-O'.
You should also edit `Makefile' to enable the lines that set `CLIB'
to `-lPW', and the ones specifically labeled as being for SCO, that set
`RANLIB', and that set `CC' and `OLDCC' to `rcc -Di386 -DM_UNIX
-DM_I386 -DM_SYSV -DM_COFF'.
Also, edit the definition of `USER_H' to remove the file `limits.h'.
Then you can run `config.gcc i386-sco' and finish building GNU CC
normally.
Note that the function `memmove' is broken in 3.2v2; it clobbers
register `%ebx'. See the file `sco-memmove.s'.
The same recipe should work on ESIX, but use `config.gcc i386-esix'
instead.

File: gcc.info, Node: VMS Install, Next: HPUX Install, Prev: SCO Install, Up: Installation
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 `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:
1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
point to the directories where the GNU CC executables (`gcc-cpp',
`gcc-cc1', etc.) and the C include files are kept. This should be
done with the commands:
$ assign /super /system disk:[gcc.] gnu_cc
$ assign /super /system disk:[gcc.include.] gnu_cc_include
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 `GCC_INSTALL.COM' script in the `[GCC]' directory.
2. Install the `GCC' command with the command line:
$ set command /table=sys$library:dcltables gnu_cc:[000000]gcc
3. To install the help file, do the following:
$ lib/help sys$library:helplib.hlb gcc.hlp
Now you can invoke the compiler with a command like `gcc /verbose
file.c', which is equivalent to the command `gcc -v -c file.c' in
Unix.
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 `/verbose' option to determine the version number of
the binaries and compare it with the source 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:
1. Copy the file `tm-vms.h' to `tm.h', `xm-vms.h' to `config.h',
`vax.md' to `md.' and `out-vax.c' to `aux-output.c'. The files to
be copied are found in the subdirectory named `config'; they
should be copied to the main directory of GNU CC.
2. Setup the logical names and command tables as defined above. In
addition, define the vms logical name `GNU_BISON' to point at the
to the directories where the Bison executable is kept. This
should be done with the command:
$ assign /super /system disk:[bison.] gnu_bison
You may, if you choose, use the `INSTALL_BISON.COM' script in the
`[BISON]' directory.
3. Install the `BISON' command with the command line:
$ set command /table=sys$library:dcltables gnu_bison:[000000]bison
4. Type `@make' to do recompile everything.
If you are compiling with a version of GNU CC older than 1.33,
specify `/DEFINE=("inline=")' as an option in all the
compilations. This requires editing all the `gcc' commands in
`make-cc1.com'. (The older versions had problems supporting
`inline'.) Once you have a working 1.33 or newer GNU CC, you can
change this file back.
Due to the differences between the filesystems of Unix and VMS, the
preprocessor attempts to translate the names of include files into
something 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. The
preprocessor tries various prefixes until one of them succeeds.
The first prefix is the `GNU_CC_INCLUDE:' logical name: this is
where GNU_C header files are traditionally stored. If a header file is
not found there, `SYS$SYSROOT:[SYSLIB.]' is tried next. If the
preprocessor is still unable to locate the file, it then assumes that
the include file specification is a valid VMS filename all by itself,
and it uses this filename to attempt to open the include file. If none
of these strategies succeeds, the preprocessor reports an error.
If you wish to store header files in non-standard locations, then you
can assign the logical `GNU_CC_INCLUDE' to be a search list, where each
element of the list is suitable for use with a rooted logical.
With this version of GNU CC, `const' global variables now work
properly. Unless, however, the `const' modifier is also specified in
every external declaration of the variable in all of the source files
that use that variable, the linker will issue warnings about conflicting
attributes for the variable, since the linker does not know if the
variable should be read-only. The program will still work, but the
variable will be placed in writable storage.
Due to an assembler bug, offsets to static constants are sometimes
incorrectly evaluated. This bug is present in GAS 1.38.1, and should be
fixed in the next version.
Under previous versions of GNU CC, the generated code would
occasionally give strange results when linked to the sharable `VAXCRTL'
library. Now this should work.
Even with this version, however, GNU CC itself should not be linked
to the sharable `VAXCRTL'. The `qsort' routine supplied with `VAXCRTL'
has a bug which can cause a compiler crash.
Similarly, the preprocessor should not be linked to the sharable
`VAXCRTL'. The `strncat' routine supplied with `VAXCRTL' has a bug
which can cause the preprocessor to go into an infinite loop.
It should be pointed out that if you attempt to link to the sharable
`VAXCRTL', the VMS linker will strongly resist any effort to force it
to use the `qsort' and `strncat' routines from `gcclib'. Until the
bugs in `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 `qsort' and `strncat' in
`gcclib' under different names, and patching the compiler sources to
use these routines). Both of the bugs in `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 `make-cc1.com' and
`make-cccp.com' use the non-shared version of `VAXCRTL' (and thus use
the `qsort' and `strncat' routines from `gcclib.olb').
Note that GNU CC on VMS now generates debugging information to
describe the programs symbols to the VMS debugger. However, you need
version 1.37 or later of GAS in order to output them properly in the
object file.
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 C (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. Use the compiler option `/NOCASE_HACK' to inhibits
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. In cases where you need to selectively inhibit augmentation,
you can define a macro for each mixed case symbol for which you wish to
inhibit augmentation, where the macro expands into the lower case
equivalent of the name.

File: gcc.info, Node: HPUX Install, Next: Tower Install, Prev: VMS Install, Up: Installation
Installing GNU CC on HPUX
=========================
To install GNU CC on HPUX, you must start by editing the file
`Makefile'. Search for the string `HPUX' to find comments saying what
to change. You need to change some variable definitions and (if you
are using GAS) some lines in the rule for the target `gnulib'.
To avoid errors when linking programs with `-g', create an empty
library named `libg.a'. An easy way to do this is:
ar rc /usr/local/lib/libg.a
To compile with the HPUX C compiler, you must specify get the file
`alloca.c' from GNU Emacs. Then, when you run `make', use this
argument:
make ALLOCA=alloca.o
When recompiling GNU CC with itself, do not define `ALLOCA'.
Instead, an `-I' option needs to be added to `CFLAGS' as follows:
make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -I../binutils/hp-include"

File: gcc.info, Node: Tower Install, Prev: HPUX Install, Up: Installation
Installing GNU CC on an NCR Tower
=================================
On an NCR Tower model 4x0 or 6x0, you may have trouble because the
default maximum virtual address size of a process is just 1 Mb. Most
often you will find this problem while compiling GNU CC with itself.
The only way to solve the problem is to reconfigure the kernel. Add
a line such as this to the configuration file:
MAXUMEM = 4096
and then relink the kernel and reboot the machine.

View File

@ -1,475 +0,0 @@
#
# This file is part of the Alliance CAD System
# Copyright (C) Laboratoire LIP6 - Département ASIM
# Universite Pierre et Marie Curie
#
# Home page : http://www-asim.lip6.fr/alliance/
# E-mail : mailto:alliance-users@asim.lip6.fr
#
# This progam 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.
#
# Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Makefile for GNU C compiler.
# Copyright (C) 1987, 1988 Free Software Foundation, Inc.
#This file is part of GNU CC.
#GNU CC 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 1, or (at your option)
#any later version.
#GNU CC 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 GNU CC; see the file COPYING. If not, write to
#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#Notice :
#for genview, this Makefile has been modified in order not to need bison or
#whatever, as the actual state is what genview expects.
#This is a minimized makefile for genview only, is this clear? :-(
#Modified by Fr\'ed\'eric P\'etrot, 11 april 1993
include $(ALLIANCE_TOP)/etc/$(ALLIANCE_OS).mk
CC = gcc
# Variables that exist for you to override.
# See below for how to change them for certain systems.
# Compiler to use for compiling gnulib.
# OLDCC should not be the GNU C compiler.
OLDCC = cc
CFLAGS=-D$(ALLIANCE_OS)
# CFLAGS for use with OLDCC, for compiling gnulib.
# NOTE: -O does not work on some Unix systems!
# On them, you must take it out.
CCLIBFLAGS=-O
# This should be the version of ar to use with output from $(OLDCC).
OLDAR = ar
# CFLAGS for use with OLDCC, for compiling hard-params.
HARD_PARAMS_FLAGS=
# Directory where sources are, from where we are.
srcdir = .
# Directory in which to put the executable for the command `gcc'
libdir = $(prefix)/usr/local/lib
# Additional system libraries to link with.
CLIB=
# Change this to a null string if obstacks are installed in the
# system library.
OBSTACK=obstack.o
# End of variables for you to override.
# If you are making gcc for the first time, and if you are compiling it with
# a non-gcc compiler, and if your system doesn't have a working alloca() in any
# of the standard libraries (as is true for HP/UX or Genix),
# then un-comment the following line when compiling with the system's cc:
# ALLOCA = alloca.o
# But don't do that if compiling using GCC.
# Dependency on obstack, alloca, malloc or whatever library facilities
# are not installed in the system libraries.
LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(OBSTACK) $(ALLOCA) $(MALLOC) $(CLIB)
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
# subdirectory rather than in the source directory.
INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config
# Always use -I$(srcdir)/config when compiling.
.c.o:
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
# Language-specific object files for C.
C_OBJS = c-parse.tab.o c-decl.o c-typeck.o c-convert.o
# Language-specific object files for C++.
# (These are not yet released.)
CPLUS_OBJS = cplus-parse.o cplus-decl.o cplus-typeck.o \
cplus-cvt.o cplus-search.o cplus-lex.o \
cplus-class.o cplus-init.o cplus-method.o
# Language-independent object files.
OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
rtl.o rtlanal.o expr.o stmt.o expmed.o explow.o optabs.o varasm.o \
symout.o dbxout.o sdbout.o emit-rtl.o insn-emit.o \
integrate.o jump.o cse.o loop.o flow.o stupid.o combine.o \
regclass.o local-alloc.o global-alloc.o reload.o reload1.o caller-save.o \
insn-peep.o final.o recog.o insn-recog.o insn-extract.o insn-output.o
# Files to be copied away after each stage in building.
STAGE_GCC=genview_gcc
STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
stamp-flags stamp-config stamp-codes \
stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \
genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
genview_cc1
# Members of gnulib.
LIBFUNCS = _eprintf _builtin_new _builtin_New _builtin_del _bb \
_umulsi3 _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
_lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \
_divdf3 _muldf3 _negdf2 _adddf3 _subdf3 _cmpdf2 \
_fixunsdfsi _fixdfsi _floatsidf _truncdfsf2 _extendsfdf2 \
_addsf3 _negsf2 _subsf3 _cmpsf2 _mulsf3 _divsf3
# Library members defined in gnulib2.c.
LIB2FUNCS = _adddi3 _subdi3 _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
_anddi3 _iordi3 _xordi3 _lshrdi3 _lshldi3 _ashldi3 _ashrdi3 _one_cmpldi2 \
_bdiv _cmpdi2 _ucmpdi2 _fixunsdfdi _fixdfdi _floatdidf _varargs
# Header files that are made available to programs compiled with gcc.
USER_H = stddef.h assert.h va-i860.h va-mips.h va-pyr.h va-sparc.h \
va-spur.h limits.h proto.h
# The files that "belong" in CONFIG_H are deliberately omitted
# because having them there would not be useful in actual practice.
# All they would do is cause complete recompilation every time
# one of the machine description files is edited.
# That may or may not be what one wants to do.
# If it is, rm *.o is an easy way to do it.
# CONFIG_H = config.h tm.h
CONFIG_H =
RTL_H = rtl.h rtl.def machmode.def
TREE_H = tree.h real.h tree.def machmode.def
CPLUS_TREE_H = $(TREE_H) cplus-tree.h c-tree.h
# Note that dependencies on obstack.h are not written
# because that file is not part of GCC.
# Dependencies on gvarargs.h are not written
# because all that file does, when not compiling with GCC,
# is include the system varargs.h.
#all: config.status gnulib genview_gcc genview_cc1
all: config.status genview_gcc genview_cc1
# Use this instead of `all' if you need to convert the libraries
# before you can use the compiler.
# Don't forget to do `make gnulib2' before installation.
#all-libconvert: config.status gnulib genview_gcc genview_cc1 float.h
all-libconvert: config.status genview_gcc genview_cc1
#lang-c: config.status gnulib genview_gcc genview_cc1
lang-c: config.status genview_gcc genview_cc1
config.status:
@echo You must configure genview_gcc. Look at the INSTALL file for details.
@false
compilations: ${OBJS}
genview_gcc: gcc.o version.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o gccnew gcc.o version.o $(LIBS)
# Go via `gccnew' to avoid `file busy' if $(CC) is `gcc'.
mv gccnew$(PROGRAM_SUFFIX) genview_gcc$(PROGRAM_SUFFIX)
genview_cc1: $(C_OBJS) $(OBJS) $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o genview_cc1 $(C_OBJS) $(OBJS) $(LIBS)
#Library of arithmetic subroutines
# Don't compile this with gcc!
# (That would cause most arithmetic functions to call themselves.)
gnulib: gnulib.c $(CONFIG_H) config.status
-rm -f stamp-gnulib2
rm -f tmpgnulib gnulib; \
for name in $(LIBFUNCS); \
do \
echo $${name}; \
rm -f $${name}.c; \
cp $(srcdir)/gnulib.c $${name}.c; \
$(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $${name}.c; \
$(OLDAR) qc tmpgnulib $${name}.o; \
rm -f $${name}.[co]; \
done
-if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ;then $(RANLIB) tmpgnulib; else true; fi
# Actually build it in tmpgnulib above, then rename now,
# so that gnulib itself remains nonexistent if compilation is aborted.
mv tmpgnulib gnulib
# On HPUX, if you are working with the GNU assembler and linker,
# the previous two command lines must be replaced with the following line.
# No change is needed here if you are using the HPUX assembler and linker.
# ../hp-bin/hpxt tmpgnulib gnulib
gnulib2: stamp-gnulib2;
stamp-gnulib2: gnulib2.c gnulib genview_cc1 genview_gcc cpp $(CONFIG_H)
for name in $(LIB2FUNCS); \
do \
echo $${name}; \
./gcc -B./ -fstrength-reduce -O $(INCLUDES) $(GNULIB2_CFLAGS) -c -DL$${name} $(srcdir)/gnulib2.c -o $${name}.o; \
$(AR) rc gnulib $${name}.o; \
rm -f $${name}.o; \
done
-if [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ; then $(RANLIB) gnulib; else true; fi
# On HPUX, if you are working with the GNU assembler and linker,
# the previous line must be commented out.
# No change is needed here if you are using the HPUX assembler and linker.
touch stamp-gnulib2
float.h:
# Originally, we used `make' rather than $(MAKE), to avoid propagating
# a CC=gcc command option. However, since hard-params is now made
# with $(OLDCC) explicitly, this is no longer important.
# However, $(MAKE) fails on some systems where it isn't defined.
# `make' has the disadvantage of sometimes running the system's make,
# instead of GNU make. And the system's make might not support VPATH.
# However, the compilation of hard-params should not need to use VPATH,
# due to the explicit use of `$(srcdir)'.
make hard-params \
HARD_PARAMS_FLAGS="$(HARD_PARAMS_FLAGS)" \
CPPFLAGS="$(CPPFLAGS)" \
LDFLAGS="$(LDFLAGS)"
-./hard-params -f > float.h
# Compile hard-params with standard cc. It avoids some headaches.
hard-params: hard-params.o
$(OLDCC) $(HARD_PARAMS_FLAGS) $(LDFLAGS) hard-params.o -o $@
hard-params.o: $(srcdir)/hard-params.c
-cp $(srcdir)/hard-params.c . > /dev/null 2>&1
$(OLDCC) $(HARD_PARAMS_FLAGS) $(CPPFLAGS) -DNO_SC -c hard-params.c
# C language specific files.
c-parse.tab.o : $(srcdir)/c-parse.tab.c $(CONFIG_H) $(TREE_H) c-parse.h c-tree.h input.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -D$(ALLIANCE_OS) -c $(srcdir)/c-parse.tab.c
c-parse.tab.c : c-parse.y
bison c-parse.y
c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-parse.h flags.h
c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H)
# Language-independent files.
gcc.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h
$(CC) $(CFLAGS) $(INCLUDES) \
-DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
-DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-\" -c \
`echo $(srcdir)/gcc.c | sed 's,^\./,,'`
version.o: version.c
obstack.o: obstack.c
tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h
print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) $(RTL_H)
fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H)
toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h
rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h expr.h \
insn-codes.h hard-reg-set.h
stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
insn-flags.h insn-config.h insn-codes.h expr.h regs.h hard-reg-set.h recog.h
expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
insn-flags.h insn-codes.h expr.h insn-config.h recog.h typeclass.h
expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
insn-flags.h insn-codes.h expr.h insn-config.h recog.h
explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h
optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
insn-flags.h insn-codes.h expr.h insn-config.h recog.h
symout.o : symout.c $(CONFIG_H) $(TREE_H) $(RTL_H) symseg.h gdbfiles.h
dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h
sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H)
emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) regs.h insn-config.h real.h
integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h \
insn-flags.h insn-codes.h
jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h regs.h
stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h
cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h
loop.o : loop.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
regs.h hard-reg-set.h recog.h flags.h expr.h
flow.o : flow.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h
combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h \
insn-config.h regs.h basic-block.h recog.h
regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
basic-block.h regs.h insn-config.h recog.h
local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h regs.h \
hard-reg-set.h insn-config.h recog.h
global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) flags.h \
basic-block.h regs.h hard-reg-set.h insn-config.h
reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \
reload.h recog.h hard-reg-set.h insn-config.h regs.h
reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h \
reload.h regs.h hard-reg-set.h insn-config.h basic-block.h recog.h
caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
reload.h regs.h hard-reg-set.h insn-config.h basic-block.h recog.h
final.o : final.c $(CONFIG_H) $(RTL_H) flags.h regs.h recog.h conditions.h \
gdbfiles.h insn-config.h real.h output.h
recog.o : recog.c $(CONFIG_H) $(RTL_H) \
regs.h recog.h hard-reg-set.h insn-config.h real.h
# Normally this target is not used; but it is used if you
# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
# from the GNU Emacs distribution.
# Note some machines won't allow $(CC) without -S on this source file.
alloca.o: alloca.c
$(CC) $(CFLAGS) -S `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
as alloca.s -o alloca.o
# Now the source files that are generated from the machine description.
.PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c
# The following pair of rules has this effect:
# genconfig is run only if the md has changed since genconfig was last run;
# but the file insn-config.h is touched only when its contents actually change.
# Each of the other insn-* files is handled by a similar pair of rules.
insn-config.h: stamp-config ;
stamp-config : md genconfig $(srcdir)/move-if-change
./genconfig md > tmp-config.h
$(srcdir)/move-if-change tmp-config.h insn-config.h
touch stamp-config
insn-flags.h: stamp-flags ;
stamp-flags : md genflags $(srcdir)/move-if-change
./genflags md > tmp-flags.h
$(srcdir)/move-if-change tmp-flags.h insn-flags.h
touch stamp-flags
insn-codes.h: stamp-codes ;
stamp-codes : md gencodes $(srcdir)/move-if-change
./gencodes md > tmp-codes.h
$(srcdir)/move-if-change tmp-codes.h insn-codes.h
touch stamp-codes
insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h insn-codes.h \
insn-config.h insn-flags.h
$(CC) $(CFLAGS) $(INCLUDES) -c insn-emit.c
insn-emit.c: stamp-emit ;
stamp-emit : md genemit $(srcdir)/move-if-change
./genemit md > tmp-emit.c
$(srcdir)/move-if-change tmp-emit.c insn-emit.c
touch stamp-emit
insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h real.h recog.h
$(CC) $(CFLAGS) $(INCLUDES) -c insn-recog.c
insn-recog.c: stamp-recog ;
stamp-recog : md genrecog $(srcdir)/move-if-change
./genrecog md > tmp-recog.c
$(srcdir)/move-if-change tmp-recog.c insn-recog.c
touch stamp-recog
insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
$(CC) $(CFLAGS) $(INCLUDES) -c insn-extract.c
insn-extract.c: stamp-extract ;
stamp-extract : md genextract $(srcdir)/move-if-change
./genextract md > tmp-extract.c
$(srcdir)/move-if-change tmp-extract.c insn-extract.c
touch stamp-extract
insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h real.h
$(CC) $(CFLAGS) $(INCLUDES) -c insn-peep.c
insn-peep.c: stamp-peep ;
stamp-peep : md genpeep $(srcdir)/move-if-change
./genpeep md > tmp-peep.c
$(srcdir)/move-if-change tmp-peep.c insn-peep.c
touch stamp-peep
insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
hard-reg-set.h insn-config.h insn-flags.h output.h aux-output.c
$(CC) $(CFLAGS) $(INCLUDES) -c insn-output.c
insn-output.c: stamp-output ;
stamp-output : md genoutput $(srcdir)/move-if-change
./genoutput md > tmp-output.c
$(srcdir)/move-if-change tmp-output.c insn-output.c
touch stamp-output
# Now the programs that generate those files.
# $(CONFIG_H) is omitted from the deps of the gen*.o
# because these programs don't really depend on anything
# about the target machine. They do depend on config.h itself,
# since that describes the host machine.
genconfig : genconfig.o rtl.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o genconfig genconfig.o rtl.o $(LIBS)
genconfig.o : genconfig.c $(RTL_H) config.h
genflags : genflags.o rtl.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o genflags genflags.o rtl.o $(LIBS)
genflags.o : genflags.c $(RTL_H) config.h
gencodes : gencodes.o rtl.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o gencodes gencodes.o rtl.o $(LIBS)
gencodes.o : gencodes.c $(RTL_H) config.h
genemit : genemit.o rtl.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o genemit genemit.o rtl.o $(LIBS)
genemit.o : genemit.c $(RTL_H) config.h
genrecog : genrecog.o rtl.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o genrecog genrecog.o rtl.o $(LIBS)
genrecog.o : genrecog.c $(RTL_H) config.h
genextract : genextract.o rtl.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o genextract genextract.o rtl.o $(LIBS)
genextract.o : genextract.c $(RTL_H) config.h
genpeep : genpeep.o rtl.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o genpeep genpeep.o rtl.o $(LIBS)
genpeep.o : genpeep.c $(RTL_H) config.h
genoutput : genoutput.o rtl.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o genoutput genoutput.o rtl.o $(LIBS)
genoutput.o : genoutput.c $(RTL_H) config.h
# gnulib is not deleted because deleting it would be inconvenient
# for most uses of this target.
realclean clean:
-rm -f $(STAGESTUFF) $(STAGE_GCC)
# Delete the temp files made in the course of building gnulib.
-rm -f tmpgnulib
for name in $(LIBFUNCS); do rm -f $${name}.c; done
-rm -f stamp-*.[ch] tmp-*
-rm -f *.s *.s[0-9] *.co *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop *.dbr *.jump2
-rm -f core float.h hard-params

File diff suppressed because it is too large Load Diff

View File

@ -1,128 +0,0 @@
3. When find_reloads is used to count number of spills needed
it does not take into account the fact that a reload may
turn out to be a dummy.
I'm not sure this really happens any more. Doesn't it find
all the dummies on both passes?
10. movl a3@,a0
movl a3@(16),a1
clrb a0@(a1:l)
is generated and may be worse than
movl a3@,a0
addl a3@(16),a0
clrb a0@
If ordering of operands is improved, many more
such cases will be generated from typical array accesses.
23. (memory >> 24) and (memory >> 24) == CONST optimizations
ought to be done machine independently.
38. Hack expand_mult so that if there is no same-modes multiply
it will use a widening multiply and then truncate rather than
calling the library.
39. Hack expanding of division to notice cases for
long -> short division.
40. Represent divide insns as (DIV:SI ...) followed by
a separate lowpart extract. Represent remainder insns as DIV:SI
followed by a separate highpart extract. Then cse can work on
the DIV:SI part. Problem is, this may not be desirable on machines
where computing the quotient alone does not necessarily give
a remainder--such as the 68020 for long operands.
42. In subst in combine.c at line 704 or so, a reg that really
wants an areg gets a dreg. It is i*4, for indexing. Why?
52. Reloading can look at how reload_contents got set up.
If it was copied from a register, just reload from that register.
Otherwise, perhaps can change the previous insn to move the
data via the reload reg, thus avoiding one memory ref.
53. Know that certain library routines do not clobber memory.
63. Potential problem in cc_status.value2, if it ever activates itself
after a two-address subtraction (which currently cannot happen).
It is supposed to compare the current value of the destination
but eliminating it would use the results of the subtraction, equivalent
to comparing the previous value of the destination.
65. Should loops that neither start nor end with a break
be rearranged to end with the last break?
69. Define the floating point converting arithmetic instructions
for the 68881.
74. Combine loop opt with cse opt in one pass. Do cse on each loop,
then loop opt on that loop, and go from innermost loops outward.
Make loop invariants available for cse at end of loop.
85. pea can force a value to be reloaded into an areg
which can make it worse than separate adding and pushing.
This can only happen for adding something within addql range
and it only loses if the qty becomes dead at that point
so it can be added to with no copying.
93. If a pseudo doesn't get a hard reg everywhere,
can it get one during a loop?
95. Can simplify shift of result of a bfextu. See testunsfld.c.
Likewise and of result of a bfextu. See hyph.c.
96. Can do SImode bitfield insns without reloading, but must
alter the operands in special ways.
99. final could check loop-entry branches to see if they
screw up deletion of a test instruction. If they do,
can put another test instruction before the branch and
make it conditional and redirect it.
106. Aliasing may be impossible if data types of refs differ
and data type of containing objects also differ.
(But check this wrt unions.)
108. Can speed up flow analysis by making a table saying which
register is set and which registers are used by each instruction that
only sets one register and only uses two. This way avoid the tree
walk for such instructions (most instructions).
109. It is desirable to avoid converting INDEX to SImode if a
narrower mode suffices, as HImode does on the 68000.
How can this be done?
110. Possible special combination pattern:
If the two operands to a comparison die there and both come from insns
that are identical except for replacing one operand with the other,
throw away those insns. Ok if insns being discarded are known 1 to 1.
An andl #1 after a seq is 1 to 1, but how should compiler know that?
112. Can convert float to unsigned int by subtracting a constant,
converting to signed int, and changing the sign bit.
117. Any number of slow zero-extensions in one loop, that have
their clr insns moved out of the loop, can share one register
if their original life spans are disjoint.
But it may be hard to be sure of this since
the life span data that regscan produces may be hard to interpret
validly or may be incorrect after cse.
118. In cse, when a bfext insn refers to a register, if the field
corresponds to a halfword or a byte and the register is equivalent
to a memory location, it would be possible to detect this and
replace it with a simple memory reference.
121. Insns that store two values cannot be moved out of loops.
The code in scan_loop doesn't even try to deal with them.
122. When insn-output.c turns a bit-test into a sign-test,
it should see whether the cc is already set up with that sign.
123. When a conditional expression is used as a function arg, it would
be faster (and in some cases shorter) to push each alternative rather
than compute in a register and push that. This would require
being able to specify "push this" as a target for expand_expr.
124. On the 386, bad code results from foo (bar ()) when bar
returns a double, because the pseudo used fails to get preferenced
into an fp reg because of the distinction between regs 8 and 9.

View File

@ -1,364 +0,0 @@
0. Improved efficiency.
* Parse and output array initializers an element at a time, freeing
storage after each, instead of parsing the whole initializer first and
then outputting. This would reduce memory usage for large
initializers.
1. Better optimization.
* Constants in unused inline functions
It would be nice to delay output of string constants so that string
constants mentioned in unused inline functions are never generated.
Perhaps this would also take care of string constants in dead code.
The difficulty is in finding a clean way for the RTL which refers
to the constant (currently, only by an assembler symbol name)
to point to the constant and cause it to be output.
* More cse
The techniques for doing full global cse are described in the red
dragon book, or (a different version) in Frederick Chow's thesis from
Stanford. It is likely to be slow and use a lot of memory, but it
might be worth offering as an additional option.
It is probably possible to extend cse to a few very frequent cases
without so much expense.
For example, it is not very hard to handle cse through if-then
statements with no else clauses. Here's how to do it. On reaching a
label, notice that the label's use-count is 1 and that the last
preceding jump jumps conditionally to this label. Now you know it
is a simple if-then statement. Remove from the hash table
all the expressions that were entered since that jump insn
and you can continue with cse.
It is probably not hard to handle cse from the end of a loop
around to the beginning, and a few loops would be greatly sped
up by this.
* Support more general tail-recursion among different functions.
This might be possible under certain circumstances, such as when
the argument lists of the functions have the same lengths.
Perhaps it could be done with a special declaration.
You would need to verify in the calling function that it does not
use the addresses of any local variables and does not use setjmp.
* Put short statics vars at low addresses and use short addressing mode?
Useful on the 68000/68020 and perhaps on the 32000 series,
provided one has a linker that works with the feature.
This is said to make a 15% speedup on the 68000.
* Keep global variables in registers.
Here is a scheme for doing this. A global variable, or a local variable
whose address is taken, can be kept in a register for an entire function
if it does not use non-constant memory addresses and (for globals only)
does not call other functions. If the entire function does not meet
this criterion, a loop may.
The VAR_DECL for such a variable would have to have two RTL expressions:
the true home in memory, and the pseudo-register used temporarily.
It is necessary to emit insns to copy the memory location into the
pseudo-register at the beginning of the function or loop, and perhaps
back out at the end. These insns should have REG_EQUIV notes so that,
if the pseudo-register does not get a hard register, it is spilled into
the memory location which exists in any case.
The easiest way to set up these insns is to modify the routine
put_var_into_stack so that it does not apply to the entire function
(sparing any loops which contain nothing dangerous) and to call it at
the end of the function regardless of where in the function the
address of a local variable is taken. It would be called
unconditionally at the end of the function for all relevant global
variables.
For debugger output, the thing to do is to invent a new binding level
around the appropriate loop and define the variable name as a register
variable with that scope.
* Live-range splitting.
Currently a variable is allocated a hard register either for the full
extent of its use or not at all. Sometimes it would be good to
allocate a variable a hard register for just part of a function; for
example, through a particular loop where the variable is mostly used,
or outside of a particular loop where the variable is not used. (The
latter is nice because it might let the variable be in a register most
of the time even though the loop needs all the registers.)
It might not be very hard to do this in global-alloc.c when a variable
fails to get a hard register for its entire life span.
The first step is to find a loop in which the variable is live, but
which is not the whole life span or nearly so. It's probably best to
use a loop in which the variable is heavily used.
Then create a new pseudo-register to represent the variable in that loop.
Substitute this for the old pseudo-register there, and insert move insns
to copy between the two at the loop entry and all exits. (When several
such moves are inserted at the same place, some new feature should be
added to say that none of those registers conflict merely because of
overlap between the new moves. And the reload pass should reorder them
so that a store precedes a load, for any given hard register.)
After doing this for all the reasonable candidates, run global-alloc
over again. With luck, one of the two pseudo-registers will be fit
somewhere. It may even have a much higher priority due to its reduced
life span.
There will be no room in general for the new pseudo-registers in
basic_block_live_at_start, so there will need to be a second such
matrix exclusively for the new ones. Various other vectors indexed by
register number will have to be made bigger, or there will have to be
secondary extender vectors just for global-alloc.
A simple new feature could arrange that both pseudo-registers get the
same stack slot if they both fail to get hard registers.
Other compilers split live ranges when they are not connected, or
try to split off pieces `at the edge'. I think splitting around loops
will provide more speedup.
Creating a fake binding block and a new like-named variable with
shorter life span and different address might succeed in describing
this technique for the debugger.
* Detect dead stores into memory?
A store into memory is dead if it is followed by another store into
the same location; and, in between, there is no reference to anything
that might be that location (including no reference to a variable
address).
* Loop optimization.
Strength reduction and iteration variable elimination could be
smarter. They should know how to decide which iteration variables are
not worth making explicit because they can be computed as part of an
address calculation. Based on this information, they should decide
when it is desirable to eliminate one iteration variable and create
another in its place.
It should be possible to compute what the value of an iteration
variable will be at the end of the loop, and eliminate the variable
within the loop by computing that value at the loop end.
When a loop has a simple increment that adds 1,
instead of jumping in after the increment,
decrement the loop count and jump to the increment.
This allows aob insns to be used.
* Using constraints on values.
Many operations could be simplified based on knowledge of the
minimum and maximum possible values of a register at any particular time.
These limits could come from the data types in the tree, via rtl generation,
or they can be deduced from operations that are performed. For example,
the result of an `and' operation one of whose operands is 7 must be in
the range 0 to 7. Compare instructions also tell something about the
possible values of the operand, in the code beyond the test.
Value constraints can be used to determine the results of a further
comparison. They can also indicate that certain `and' operations are
redundant. Constraints might permit a decrement and branch
instruction that checks zeroness to be used when the user has
specified to exit if negative.
* Smarter reload pass.
The reload pass as currently written can reload values only into registers
that are reserved for reloading. This means that in order to use a
register for reloading it must spill everything out of that register.
It would be straightforward, though complicated, for reload1.c to keep
track, during its scan, of which hard registers were available at each
point in the function, and use for reloading even registers that were
free only at the point they were needed. This would avoid much spilling
and make better code.
* Change the type of a variable.
Sometimes a variable is declared as `int', it is assigned only once
from a value of type `char', and then it is used only by comparison
against constants. On many machines, better code would result if
the variable had type `char'. If the compiler could detect this
case, it could change the declaration of the variable and change
all the places that use it.
* Order of subexpressions.
It might be possible to make better code by paying attention
to the order in which to generate code for subexpressions of an expression.
* More code motion.
Consider hoisting common code up past conditional branches or
tablejumps.
* Trace scheduling.
This technique is said to be able to figure out which way a jump
will usually go, and rearrange the code to make that path the
faster one.
* Distributive law.
The C expression *(X + 4 * (Y + C)) compiles better on certain
machines if rewritten as *(X + 4*C + 4*Y) because of known addressing
modes. It may be tricky to determine when, and for which machines, to
use each alternative.
Some work has been done on this, in combine.c.
* Can optimize by changing if (x) y; else z; into z; if (x) y;
if z and x do not interfere and z has no effects not undone by y.
This is desirable if z is faster than jumping.
* For a two-insn loop on the 68020, such as
foo: movb a2@+,a3@+
jne foo
it is better to insert dbeq d0,foo before the jne.
d0 can be a junk register. The challenge is to fit this into
a portable framework: when can you detect this situation and
still be able to allocate a junk register?
2. Simpler porting.
Right now, describing the target machine's instructions is done
cleanly, but describing its addressing mode is done with several
ad-hoc macro definitions. Porting would be much easier if there were
an RTL description for addressing modes like that for instructions.
Tools analogous to genflags and genrecog would generate macros from
this description.
There would be one pattern in the address-description file for each
kind of addressing, and this pattern would have:
* the RTL expression for the address
* C code to verify its validity (since that may depend on
the exact data).
* C code to print the address in assembler language.
* C code to convert the address into a valid one, if it is not valid.
(This would replace LEGITIMIZE_ADDRESS).
* Register constraints for all indeterminates that appear
in the RTL expression.
3. Other languages.
Front ends for Pascal, Fortran, Algol, Cobol, Modula-2 and Ada are
desirable.
Pascal, Modula-2 and Ada require the implementation of functions
within functions. Some of the mechanisms for this already exist.
4. More extensions.
* Label-addresses as expressions.
It would be nice to have access to the addresses of labels; to be able to
store them in variables, or initialize vectors of them.
Alas, `&label0' is the address of the variable named label0, which is
unrelated to the label with that name. Some other syntax is needed.
Perhaps colon as a unary operator? That is ambiguous with `?:' with
the middle operand omitted. Perhaps ^ as a unary operator? Perhaps
`__label__ label0' could mean the value of label0? Its type could be
`void *'. `goto *EXP' could be used to go to a value of type `void
*'--no ambiguity there.
Jump optimization and flow analysis must know about computed jumps,
but that is not hard. Each basic block headed by a possible target of
computed jumps must be considered a successor of each basic block
ending in a computed jump. Aside from this, I believe no other
optimizer changes are needed.
Next question: stack levels. In most functions, there is no problem,
but it would be a shame to make a feature that doesn't work together
with other features. Here is an idea:
For each label that might need stack level restoration, construct a
shadow-label which will restore the stack and jump to the user-label.
Then use the address of the shadow label for label0 when someone asks
for that of label0. Jump optimization will delete all the shadow labels
if the function has no computed gotos.
* Generated unique labels. Have some way of generating distinct labels
for use in extended asm statements. I don't know what a good syntax would
be.
5. Generalize the machine model.
* Some new compiler features may be needed to do a good job on machines
where static data needs to be addressed using base registers.
* Some machines have two stacks in different areas of memory, one used
for scalars and another for large objects. The compiler does not
now have a way to understand this.
6. Better documentation of how GCC works and how to port it.
Here is an outline proposed by Allan Adler.
I. Overview of this document
II. The machines on which GCC is implemented
A. Prose description of those characteristics of target machines and
their operating systems which are pertinent to the implementation
of GCC.
i. target machine characteristics
ii. comparison of this system of machine characteristics with
other systems of machine specification currently in use
B. Tables of the characteristics of the target machines on which
GCC is implemented.
C. A priori restrictions on the values of characteristics of target
machines, with special reference to those parts of the source code
which entail those restrictions
i. restrictions on individual characteristics
ii. restrictions involving relations between various characteristics
D. The use of GCC as a cross-compiler
i. cross-compilation to existing machines
ii. cross-compilation to non-existent machines
E. Assumptions which are made regarding the target machine
i. assumptions regarding the architecture of the target machine
ii. assumptions regarding the operating system of the target machine
iii. assumptions regarding software resident on the target machine
iv. where in the source code these assumptions are in effect made
III. A systematic approach to writing the files tm.h and xm.h
A. Macros which require special care or skill
B. Examples, with special reference to the underlying reasoning
IV. A systematic approach to writing the machine description file md
A. Minimal viable sets of insn descriptions
B. Examples, with special reference to the underlying reasoning
V. Uses of the file aux-output.c
VI. Specification of what constitutes correct performance of an
implementation of GCC
A. The components of GCC
B. The itinerary of a C program through GCC
C. A system of benchmark programs
D. What your RTL and assembler should look like with these benchmarks
E. Fine tuning for speed and size of compiled code
VII. A systematic procedure for debugging an implementation of GCC
A. Use of GDB
i. the macros in the file .gdbinit for GCC
ii. obstacles to the use of GDB
a. functions implemented as macros can't be called in GDB
B. Debugging without GDB
i. How to turn off the normal operation of GCC and access specific
parts of GCC
C. Debugging tools
D. Debugging the parser
i. how machine macros and insn definitions affect the parser
E. Debugging the recognizer
i. how machine macros and insn definitions affect the recognizer
ditto for other components
VIII. Data types used by GCC, with special reference to restrictions not
specified in the formal definition of the data type
IX. References to the literature for the algorithms used in GCC

View File

@ -1,15 +0,0 @@
This directory contains the version 1.42 release of the GNU C compiler.
All serious bugs (that would make ordinary C programs fail) reported for
previous test releases have been fixed. We have often decided not to fix
bugs that are Less important, to avoid risking creating new bugs.
See the file gcc.texinfo for installation and porting information.
The file INSTALL contains a copy of the installation information.
The GNU C compiler is free software. See the file COPYING for copying
permission.
The files print-self.c and print-self1.c are not part of GCC.
They are programs that print themselves on standard output.
They were written by Dario Dariol and Giovanni Cozzi, and are
included for your hacking pleasure.

View File

@ -1,53 +0,0 @@
Return-Path: <jkp@sauna.hut.fi>
Date: Mon, 10 Apr 89 10:13:45 +0300
From: Jyrki Kuoppala <jkp@sauna.hut.fi>
Sender: jkp@sauna.hut.fi
To: info-gcc@prep.ai.mit.edu
Subject: Kernel fix needed for Altos 3068 to get coff-encapsulation working right
Organization: Helsinki University of Technology, Finland.
Here's a description how to fix a kernel bug in Altos 3068 and get
gcc-compiled programs working.
Author: Jyrki Kuoppala (jkp@cs.hut.fi)
Last modified: Mon Apr 10 09:28:40 1989
There's a bug in the Altos 3068 kernel that causes gcc-compiled
programs to fail in certain situations when the machine has a heavy
load and also in some other situations. The bug exists at least in
SVR 2.2 1.0gT1 and SVR 2.2 1.0e.
If you have source code to your system, apply the following change to
os/exec.c (function gethead):
Change the lines containing
u.u_exdata.ux_tstart = sizeof(struct naout) +
sizeof(struct filhd) + (ep->ef.nscns * sizeof(struct scnhdr));
to
u.u_exdata.ux_tstart = u.u_exdata.ux_txtorg;
If you only have binary, use sdb to find out the address of the
previous lines (on our system it's gethead+0x140) and use your
favourite binary editor to change the bytes '3036 0162 fffc 0002 0280
0000' to '23f9 01fb f4ca 01fb f4c2 6016'. This may or may not work in
your case, depending on the version of the operating system and the
phase of the moon.
Here's what is just before gethead+0x140 to ease finding out the right place:
0x9224 (gethead+0x122): 23f9 01fb f4ca 01fb f4ce mov.l &0x1fbf4ca.L,&0
x1fbf4ce.L []
0x922e (gethead+0x12c): 23f9 01fb f4c6 01fb f4ca mov.l &0x1fbf4c6.L,&0
x1fbf4ca.L []
0x9238 (gethead+0x136): 23f9 01fb f4c2 01fb f4c6 mov.l &0x1fbf4c2.L,&0
x1fbf4c6.L []
Good luck !
//Jyrki
jkp@cs.hut.fi

View File

@ -1,69 +0,0 @@
1/3/89 Pace Willisson
Here is what to do to bring up GCC & tools on an 80386 running system 5.3
(if you are adventurous and want to use the latest and greatest tools.
If you want it to be easy, check back in a couple of months.)
All of these instructions assume you are using the usg compiler. After
you get to the end, you could start over using the GNU compiler, but
that may not work yet ...
First make gcc, cc1, cpp, and gnulib:
cd .../gcc
config.gcc i386-sysv-gas
make start.encap
Don't try to bootstrap the compiler with itself at this point,
since it can't really be used until GAS and the converted libraries
are installed.
Now you must copy `cc1' and `cpp' and `gnulib' into the directory
`/usr/local/lib/gcc/i386-sysv-gas/VERSION', where VERSION stands for
the GCC version number. Also install `gcc' in a directory in your
path.
Now, make the GNU assembler:
cd .../gas
make a386
cp a386 /usr/local/lib/gcc/i386-sysv-gas/VERSION
Now, make the other utilities:
cd .../binutils
edit Makefile to turn on the CFLAGS for USG using COFF_ENCAPSULATE
make
cp ld /usr/local/lib/gcc/i386-sysv-gas/VERSION
Put the other programs (size nm strip ar objdump and ranlib) somewhere
handy, but don't clobber your usg programs. I put them all in
/usr/gnu/gnucomp, and I have this shell script in my path under the name "gnu":
exec /usr/gnu/gnucomp/$*
That way, I can say "gnu nm a.out", etc.
Convert the libraries to the encapsulated format:
make libc.a
cp libc.a /usr/local/lib/gnu/libc.a
cp .../gcc/gnulib usg-gnulib
make gnulib
cp gnulib /usr/local/lib/gcc/i386-sysv-gas/VERSION
robotussin /lib/crt0.o /usr/local/lib/gcc-crt0.o
Now add the parts of `gnulib' that are compiled with GCC,
and install the complete `gnulib' in place of the partial one.
cp gnulib .../gcc
cd .../gcc
make rest.encap
cp gnulib /usr/local/lib/gcc/i386-sysv-gas/VERSION
Now, you should be able to use 'gcc' to compile programs.
If you want to bootstrap GCC with itself, this can now be done.

View File

@ -1,150 +0,0 @@
Copyright (C) 1987 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@mcc.com)
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
This file describes the implementation notes of the GNU C Compiler for
the National Semiconductor 32032 chip (and 32000 family).
The 32032 machine description and configuration file for this compiler
is, for NS32000 family machine, primarily machine independent.
However, since this release still depends on vendor-supplied
assemblers and linkers, the compiler must obey the existing
conventions of the actual machine to which this compiler is targeted.
In this case, the actual machine which this compiler was targeted to
is a Sequent Balance 8000, running DYNIX 2.1.
The assembler for DYNIX 2.1 (and DYNIX 3.0, alas) does not cope with
the full generality of the addressing mode REGISTER RELATIVE.
Specifically, it generates incorrect code for operands of the
following form:
sym(rn)
Where `rn' is one of the general registers. Correct code is generated
for operands of the form
sym(pn)
where `pn' is one of the special processor registers (sb, fp, or sp).
An equivalent operand can be generated by the form
sym[rn:b]
although this addressing mode is about twice as slow on the 32032.
The more efficient addressing mode is controlled by defining the
constant SEQUENT_ADDRESS_BUG to 0. It is currently defined to be 1.
Another bug in the assembler makes it impossible to compute with
explicit addresses. In order to compute with a symbolic address, it
is necessary to load that address into a register using the "addr"
instruction. For example, it is not possible to say
cmpd _p,@_x
Rather one must say
addr _x,rn
cmpd _p,rn
The ns32032 chip has a number of known bugs. Any attempt to make the
compiler unaware of these deficiencies will surely bring disaster.
The current list of know bugs are as follows (list provided by Richard
Stallman):
1) instructions with two overlapping operands in memory
(unlikely in C code, perhaps impossible).
2) floating point conversion instructions with constant
operands (these may never happen, but I'm not certain).
3) operands crossing a page boundary. These can be prevented
by setting the flag in tm.h that requires strict alignment.
4) Scaled indexing in an insn following an insn that has a read-write
operand in memory. This can be prevented by placing a no-op in
between. I, Michael Tiemann, do not understand what exactly is meant
by `read-write operand in memory'. If this is refering to the special
TOS mode, for example "addd 5,tos" then one need not fear, since this
will never be generated. However, is this includes "addd 5,-4(fp)"
then there is room for disaster. The Sequent compiler does not insert
a no-op for code involving the latter, and I have been informed that
Sequent is aware of this list of bugs, so I must assume that it is not
a problem.
5) The 32032 cannot shift by 32 bits. It shifts modulo the word size
of the operand. Therefore, for 32-bit operations, 32-bit shifts are
interpreted as zero bit shifts. 32-bit shifts have been removed from
the compiler, but future hackers must be careful not to reintroduce
them.
6) The ns32032 is a very slow chip; however, some instructions are
still very much slower than one might expect. For example, it is
almost always faster to double a quantity by adding it to itself than
by shifting it by one, even if that quantity is deep in memory. The
MOVM instruction has a 20-cycle setup time, after which it moves data
at about the speed that normal moves would. It is also faster to use
address generation instructions than shift instructions for left
shifts less than 4. I do not claim that I generate optimal code for all
given patterns, but where I did escape from National's "clean
architecture", I did so because the timing specification from the data
book says that I will win if I do. I suppose this is called the
"performance gap".
Signed bitfield extraction has not been implemented. It is not
provided by the NS32032, and while it is most certainly possible to do
better than the standard shift-left/shift-right sequence, it is also
quite hairy. Also, since signed bitfields do not yet exist in C, this
omission seems relatively harmless.
Zero extractions could be better implemented if it were possible in
GCC to provide sized zero extractions: i.e. a byte zero extraction
would be allowed to yield a byte result. The current implementation
of GCC manifests 68000-ist thinking, where bitfields are extracted
into a register, and automatically sign/zero extended to fill the
register. See comments in ns32k.md around the "extzv" insn for more
details.
It should be noted that while the NS32000 family was designed to
provide odd-aligned addressing capability for multi-byte data (also
provided by the 68020, but not by the 68000 or 68010), many machines
do not opt to take advantage of this. For example, on the sequent,
although there is no advantage to long-word aligning word data, shorts
must be int-aligned in structs. This is an example of another
machine-specific machine dependency.
Because the ns32032 is has a coherent byte-order/bit-order
architecture, many instructions which would be different for
68000-style machines, fold into the same instruction for the 32032.
The classic case is push effective address, where it does not matter
whether one is pushing a long, word, or byte address. They all will
push the same address.
The macro FUNCTION_VALUE_REGNO_P is probably not sufficient, what is
needed is FUNCTION_VALUE_P, which also takes a MODE parameter. In
this way it will be possible to determine more exactly whether a
register is really a function value register, or just one that happens
to look right.

View File

@ -1,447 +0,0 @@
Return-Path: <info-gcc-request@prep.ai.mit.edu>
Date: 11 Sep 90 14:07:21 GMT
From: news@operations.dccs.upenn.edu (USENET News System)
Organization: University of Pennsylvania
Subject: Building gcc 1.37.1 with Vax C
References: <9009102236.AA15872@wubios.wustl.edu>
Sender: info-gcc-request@prep.ai.mit.edu
To: info-gcc@prep.ai.mit.edu
during it; hopefully they'll come in handy.
To build the new gcc-cpp and gcc-cc1 that come with Gnu C
version 1.37.1 with Vax C and NOT a previous version of gcc,
do the following:
I - Building gcc-cpp
A - Modify cccp.c
1 - Replace
#include <sys/types.h>
#include <sys/stat.h>
with
#ifndef VMS
#include <sys/types.h>
#include <sys/stat.h>
#else
#include <types.h>
#include <stat.h>
#endif
[It is claimed that
$ define sys sys$library
will solve the same problem without source changes.]
2 - In the VMS-specific section (has perror.h etc in it),
add the following:
#include <descrip.h> /* for dsc$descriptor_s */
#include <string.h> /* for strchr & strrchr */
#define index strchr
#define rindex strrchr
3 - You have to replace all occurences of:
extern char *index(), *rindex();
as well as any where they're separated (e.g. extern char *index()
by itself or extern char *rindex() by itself), with the following:
#ifndef VMS
extern char *index(); /* or whatever was here */
#endif
There's a total of three: one in main(), one in do_include(), and
one in hack_vms_include_specification().
B - You have to have alloca.mar for cccp.c; it was distributed
with vmsgcc1.34; it's also in the bison distribution. (both 1.03
and 1.06)
C - After you've compiled alloca.mar (MACRO ALLOCA.MAR), follow
the instructions at the top of MAKE-CC1.COM (namely, change the
CC := line to say cc/noopt instead of gcc, take the
cc1_options="-mpcc-alignment" part out of the CFLAGS line, and change
the LIBS line to say:
$ LIBS := alloca,sys$share:vaxcrtl/libr
D - Since it doesn't come with the distribution, you have
to generate cexp_tab.c yourself, either with bison on either
a Vax or a Unix box, or yacc in Unix. (@make below will die if you
don't have bison on your Vax or don't have this file)
E - Type:
@make
and watch it hum. It should go through okay; it'll die on the LINK
line, but don't worry about it.
F - Now link the whole thing with:
link /nomap/exe=gcc-cpp cccp,cexp,version,alloca,-
sys$share:vaxcrtl/libr
G - You should be screaming for joy right now; if you're not, then
give up on life. <snicker>
II - Building gcc-cc1
A - Change MAKE-CC1.COM to contain the line:
$ libs :== sys$share:vaxcrtl/libr,alloca
Yep, you have to have alloca.obj here too.
B - Modify toplev.c:
1 - Replace
#include <sys/types.h>
#include <sys/stat.h>
with
#ifndef VMS
#include <sys/types.h>
#include <sys/stat.h>
#else
#include <types.h>
#include <stat.h>
#endif
(You'll see this again.)
2 - Do:
Repl: rtx_equal_function_value_matters
With: rtx_equ_func_value_matters
Num: once
This is cuz you can't have a name over 31 chars with the
Vax C compiler; and yep you guessed it this is over that
limit. You're gonna be doing this a few more times.
C - Modify gcc.c:
1 - This is optional, since you never compile it (I'm
working on that):
Replace
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <sys/file.h>
with
#include <stdio.h>
#include <signal.h>
#ifdef VMS
#include <types.h>
#include <file.h>
#else
#include <sys/types.h>
#include <sys/file.h>
#endif
D - Modify c-parse_tab.c (if this isn't there, you'll have
to create it with bison or yacc):
Repl: expand_start_loop_continue_elsewhere
With: expand_startloop_cont_elsewhere
Num: twice
E - Modify tree.h:
Repl: expand_start_loop_continue_elsewhere
With: expand_startloop_cont_elsewhere
Num: once
F - Modify stmt.c:
Repl: expand_start_loop_continue_elsewhere
With: expand_startloop_cont_elsewhere
Num: twice
Repl: current_function_returns_pcc_struct
With: cur_func_ret_pcc_struct
Num: nine
Repl: current_function_returns_pointer
With: cur_func_ret_ptr
Num: 2
Repl: current_function_pretend_args_size
With: cur_func_pretend_args_size
Num: 3
G - Modify rtanal.c:
Repl: rtx_equal_function_value_matters
With: rtx_equ_func_values_matters
Num: twice
H - Modify output.h:
Repl: current_function_returns_pcc_struct
With: cur_func_ret_pcc_struct
Num: once
Repl: current_function_returns_pointer
With: cur_func_ret_ptr
Num: once
Repl: current_function_pretend_args_size
With: cur_func_pretend_args_size
Num: once
I - Modify tree.def:
Change the line that reads:
DEFTREECODE (FILE_TYPE, "file_type", "t", 0)
to:
#ifdef VMS
DEFTREECODE (FILE_TYPE_GNU, "file_type", "t", 0)
#else
DEFTREECODE (FILE_TYPE, "file_type", "t", 0)
#endif
This is cuz FILE_TYPE is defined in stdio.h as being
struct _iobuf *, which totally screws everything up.
J - Modify expr.c:
Change the line that reads:
if (code == FILE_TYPE)
to:
#ifdef VMS
if (code == FILE_TYPE_GNU)
#else
if (code == FILE_TYPE)
#endif
K - Modify expmed.c:
Change the line that reads:
trymode && GET_MODE_SIZE (trymode) <= maxsize;
to:
(trymode != 0) && (GET_MODE_SIZE (trymode) <= maxsize);
Enclosing the second half of the and in parenthesis may be
overkill. By the time I thought of it it was too late to
change it (read: I didn't feel like going back), but you
may want to give it a try.
L - Modify symout.c:
Change the line that has #include <stddef.h> on it to:
#ifndef VMS
#include <stddef.h>
#else
#define NULL (void *) 0
#endif
M - Modify insn-emit.c:
Line #1011 (in mine) is a 376-character long line that's
one HUGE return (it calls a function a few zillion times
embedded upon each other). This is a tad too big for Vax C
to chew; try cutting it down to a few lines. I made it look
like this:
rtx
gen_casesi (operand0, operand1, operand2, operand3)
rtx operand0;
rtx operand1;
rtx operand2;
rtx operand3;
{
return gen_rtx (SET, VOIDmode, pc_rtx,
gen_rtx (IF_THEN_ELSE, VOIDmode,
gen_rtx (LE, VOIDmode,
gen_rtx (MINUS, SImode, operand0, operand1),
operand2),
gen_rtx (PLUS, SImode,
gen_rtx (SIGN_EXTEND, SImode,
gen_rtx (MEM, HImode,
gen_rtx (PLUS, SImode, pc_rtx,
gen_rtx (MINUS, SImode, operand0, operand1)))),
gen_rtx (LABEL_REF, SImode, operand3)),
pc_rtx));
}
Kinda smacks of lisp, no?
N - Modify final.c:
Change the line that reads:
rtx final_sequence;
to:
#ifndef VMS
rtx final_sequence;
#endif
This is cuz rtx final_sequence already appears in
output.h, and Vax C screams when it sees this.
O - You have to have alloca(), bcopy(), bcmp(), and
bzero(); all are in the VMS Gcc 1.34 distribution; only
bcopy() is in the bison distribution. Since they're pretty
short, I'm gonna include 'em here. These were sent under the
Gnu public license.
alloca.mar:
.PSECT $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
.ENTRY ALLOCA,^M<>
SUBL2 4(AP),SP
MOVL 16(FP),R1
MOVQ 8(FP),AP
BICL2 #3,SP
ADDL2 #28,SP
MOVL SP,R0
JMP (R1)
.END
bcopy.mar:
.PSECT $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
; bcopy(from, to, size)
.ENTRY BCOPY,^M<R2,R3,R4,R5,R6>
MOVL 4(AP),R1
MOVL 8(AP),R3
MOVL 12(AP),R6
CMPL R1,R3
BGTR 2$ ; NORMAL FORWARD CASE
BLSS 3$ ; OVERLAPPING, MUST DO BACKWARDS
RET ; EQUAL, NOTHING TO DO
1$: SUBL2 R0,R6
MOVC3 R0,(R1),(R3)
2$: MOVZWL #65535,R0
CMPL R6,R0
BGTR 1$
MOVC3 R6,(R1),(R3)
RET
3$: ADDL2 R6,R1
ADDL2 R6,R3
MOVZWL #65535,R0
BRW 5$
4$: SUBL2 R0,R6
SUBL2 R0,R1
SUBL2 R0,R3
MOVC3 R0,(R1),(R3)
MOVZWL #65535,R0
SUBL2 R0,R1
SUBL2 R0,R3
5$: CMPL R6,R0
BGTR 4$
SUBL2 R6,R1
SUBL2 R6,R3
MOVC3 R6,(R1),(R3)
RET
.END
bcmp.mar:
.PSECT $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
; bcmp(s1, s2, n)
.ENTRY BCMP,^M<R2,R3,R4,R5>
MOVL 4(AP),R1
MOVL 8(AP),R3
MOVL 12(AP),R4
1$: MOVZWL #65535,R0
CMPL R4,R0
BLEQ 2$
SUBL2 R0,R4
CMPC3 R0,(R1),(R3)
BEQL 1$
ADDL2 R4,R0
RET
2$: CMPC3 R4,(R1),(R3)
RET
.END
bzero.mar:
.PSECT $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
; bzero(ptr, size)
.ENTRY BZERO,^M<R2,R3,R4,R5>
MOVL 4(AP),R3
BRB 2$
1$: SUBL2 R0,8(AP)
MOVC5 #0,(R3),#0,R0,(R3)
2$: MOVZWL #65535,R0
CMPL 8(AP),R0
BGTR 1$
MOVC5 #0,(R3),#0,8(AP),(R3)
RET
.END
P - On the last lines (where it's got all of the link shit),
change it so it reads:
...blahblahblah...
...blahblah,insn-extract,insn-output,obstack,-
integrate,caller-save,-
bcopy,bcmp,bzero
$!
So now it'll link the bcopy, bcmp, and bzero routines in.
Q - You should be screaming for joy right now; if you're
not, then give up on life again. Hey, I don't get paid for my humor.
R - Finally, you have to use old versions of:
GCC.EXE GCC-AS.EXE
GCC.COM GCC.CLD
GCCLIB.OLB
to make the package work properly. I've only been able to make the
new preprocessors make properly; since it wasn't even in the make
files that came with it, I don't think gcc.exe 1.37.1 was intended
to be built for the Vax .. we'll see.
In case you're wondering, I could never get vmsgcc134 to work properly;
that's why I did this with Vax C.
Good luck! This only worked under 5.3-1 (and the latest version of
Vax C...3.0? 3.1?), and isn't guaranteed in any way shape or form. If
you have stumbling blocks and think I may have come upon it during all
of this, feel free to mail me at kehoe@scotty.dccs.upenn.edu.
--
Brendan Kehoe | Soon: brendan@cs.widener.edu
For now: kehoe@scotty.dccs.upenn.edu | Or: bkehoe@widener.bitnet
Last resort: brendan.kehoe@cyber.widener.edu
Brendan Kehoe | Soon: brendan@cs.widener.edu
For now: kehoe@scotty.dccs.upenn.edu | Or: bkehoe@widener.bitnet
Last resort: brendan.kehoe@cyber.widener.edu

View File

@ -1,111 +0,0 @@
Our setup:
Sun 3/60 with cgfour
SunOS 4.0 (plus what Sun calls their "general hygiene" patch tape)
XV11R3 + MIT fixes 1 through 8 + "Purdue enhancements" + one local
"ANSIfication" fix (previously reported to MIT,
and attached below)
I installed gcc 1.34 (plus the expr.c fix) and also ran the "fixincludes"
script.
I built the X stuff with with the "CC" line in the "Sun.macros" file set to:
CC = gcc -fcombine-regs -fstrength-reduce -finline-functions -fpcc-struct-return -DPURDUE -Dinline=INLINE -DNOSTDHDRS
where -fcombine-regs, -fstrength-reduce, and -finline-functions
specify desired optimizations, -fpcc-struct-return makes things
compatible with the dbm library, -DPURDUE buys the Purdue speedups,
-Dinline=INLINE avoids a problem with a variable named "inline" in the
X file "fonts/bdftosnf/fontutil.c", and -DNOSTDHDRS avoids a problem
with multiple (and conflicting) typedef'ing of "size_t" in the
gcc-provided STDDEF_H and Sun's "sys/types.h".
Some clients may need -fwritable-strings. twm is said to need it.
The ANSIfication fix:
> From ado Mon Dec 26 10:55:28 1988
> To: xbugs@expo.lcs.mit.edu
> Subject: Xlibint and __STDC__ don't mix
>
>
> X Window System Bug Report
> xbugs@expo.lcs.mit.edu
>
>
>
>
> VERSION:
> R3
>
> CLIENT MACHINE and OPERATING SYSTEM:
> Sun 3/60 running SunOS 4.0
>
> DISPLAY:
> Sun CG4
>
> WINDOW MANAGER:
> uwm
>
> AREA:
> Xlib
>
> SYNOPSIS:
> Xlibint.h and __STDC__ don't mix
>
> DESCRIPTION:
> If __STDC__ is defined (and UNIXCPP is not defined),
> code that uses the GetReqExtra macro defined in Xlibint.h
> is uncompilable.
>
> REPEAT BY:
> Script started on Mon Dec 26 10:52:58 1988
> elsie$ cd lib/X
> elsie$ rm Xbackgnd.o
> rm: Xbackgnd.o: No such file or directory
> elsie$ rm XBackgnd.o
> elsie$ make XBackgnd.o CC=/usr/local/bin/gcc
> rm -f XBackgnd.o
> /usr/local/bin/gcc -c -O -I. -I../../. -I../.././X11 -DTCPCONN -DUNIXCONN XBackgnd.c
> XBackgnd.c: In function XSetWindowBackground:
> XBackgnd.c:16: undeclared variable `sz_' (first use here)
> *** Error code 1
> make: Fatal error: Command failed for target `XBackgnd.o'
> elsie$ exit
>
> script done on Mon Dec 26 10:53:51 1988
>
> SAMPLE FIX:
> *** 1.1/Xlibint.h Mon Dec 26 10:39:37 1988
> --- 1.2/Xlibint.h Mon Dec 26 10:39:37 1988
> ***************
> *** 122,133 ****
> #if defined(__STDC__) && !defined(UNIXCPP)
> #define GetReqExtra(name, n, req) \
> WORD64ALIGN\
> ! if ((dpy->bufptr + SIZEOF(*req) + n) > dpy->bufmax)\
> _XFlush(dpy);\
> req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
> req->reqType = X_##name;\
> ! req->length = (SIZEOF(*req) + n)>>2;\
> ! dpy->bufptr += SIZEOF(*req) + n;\
> dpy->request++
> #else
> #define GetReqExtra(name, n, req) \
> --- 122,133 ----
> #if defined(__STDC__) && !defined(UNIXCPP)
> #define GetReqExtra(name, n, req) \
> WORD64ALIGN\
> ! if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\
> _XFlush(dpy);\
> req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
> req->reqType = X_##name;\
> ! req->length = (SIZEOF(x##name##Req) + n)>>2;\
> ! dpy->bufptr += SIZEOF(x##name##Req) + n;\
> dpy->request++
> #else
> #define GetReqExtra(name, n, req) \
> --
> Arthur David Olson ado@ncifcrf.gov ADO is a trademark of Ampex.

View File

@ -1,968 +0,0 @@
GNU Service Directory -*- text -*-
This is a list of people who have asked to be listed as offering
support services for GNU software, including GNU Emacs, for a fee
or in some cases at no charge.
The information comes from the people who asked to be listed;
we do not include any information we know to be false, but we
cannot check out any of the information; we are transmitting it to
you as it was given to us and do not promise it is correct.
Also, this is not an endorsement of the people listed here.
We have no opinions and usually no information about the abilities of
any specific person. We provide this list to enable you to contact
service providers and decide for yourself whether to hire one.
Before FSF will list your name in the GNU Service Directory, we ask
that you agree informally to the following terms:
1. You will not restrict (except by copyleft) the use or distribution
of any software, documentation, or other information you supply anyone
in the course of modifying, extending, or supporting GNU software.
This includes any information specifically designed to ameliorate the
use of GNU software.
2. You will not take advantage of contact made through the Service
Directory to advertise an unrelated business (e.g., sales of
non-GNU-related proprietary information). You may spontaneously
mention your availability for general consulting, but you should not
promote a specific unrelated business unless the client asks.
Please include some indication of your rates, because otherwise users
have nothing to go by. Please put each e-mail address inside "<>".
Please put nothing else inside "<>". Thanks!
For a current copy of this directory, or to have yourself listed, ask:
gnu@prep.ai.mit.edu
** Please keep this file alphabetical **

Joseph Arceneaux <jla@ai.mit.edu>
PO Box 460633
San Francisco, CA 94146-0633
+1 415 285 9088
FSF Staff Programmer. Performed X11 implementation of Emacs version 19.
Currently working on hypertext emacs.
Service and development of GNU and X11 software. Handholding, teaching,
and installations at lower rates.
Rates: $150/hour. Free to non-profits.
Updated: 11/7/91

Giuseppe Attardi <attardi@di.unipi.it>
Dipartimento di Informatica
Corso Italia 40
I-56125 Pisa, Italy
+39 (50) 510-111
GNU: help on obtaininig GNU, for italian sites.
Updated: 18/11/91

Randolph Back <rback@boulder.Colorado.edu>
Back Software & Consulting, Inc.
1705 14th St. #344
Boulder, CO 80302
(303) 443-7758
Consulting, installation, cutomization and training for GNU emacs, and
other GNU software.
Entered: 3/13/91

Andrea Baldi
European Space Agency (ESA)
European Space Operations Center (ESOC)
Robert-Bosch-Str 5
D-6100 DARMSTADT
West-Germany
Phone 0049-6151-902762 (Work) Bitnet : <abaldi@esoc.bitnet>
Fax 0049-6151-90-495 Uucp : <unido!esoc.bitnet!abaldi>
Your Rate: Free
Programs Supported: Emacs, bison, gcc, g++, gdb, bash, X11
Emacs: installation and upgrading aid, answering, customization.
Gcc, g++, gdb, bash: installation and upgrading aid.
X11: quick questions
Experience (with gnu software)
I have maintained Emacs for more than 4 years as well as bison, gcc,
g++, gdb, bash, X11. I have written/modified several Emacs lisp programs.
Currently I maintain many GNU programs for my department.
Updated: 11 Sept 91

Bard Bloom
Department of Computer Science
Cornell University
Ithaca, NY 14850
607-255-9211
Your Rate: $200/hour.
I might do work for friends and worthy organizations for free.
Programs Supported: GNU Emacs
Experience: Lots. For example, in 1989 I wrote a safe multi-user
database program of sorts in Gnu Emacs in about a week.
I've written some 30,000 lines of Gnu Lisp code in total.
Degree: PhD in CS from MIT.
Other: My real life as a professor takes precedence over consulting.
Updated: 11 Sept 91

James Craig Burley
4 Mountain Gate Rd.
Ashland, MA 01721-2326
(508) 881-6087, -4745
Email: <burley@gnu.ai.mit.edu> (preferred)
<burley@cygnus.com>
<burley@world.std.com>
Expertise:
Compiler Internals (author of GNU Fortran, for example)
Operating Systems Internals (lately Linux on the ix86)
Tools/Utilities Development and Maintenance
Microcode Development and Maintenance (primarily VLIW machines)
Debugging (often asked to help debug Other People's Code)
Documentation (authored many books and ran a few doc projects)
Extensive experience with a variety of operating systems, hardware,
languages, and so on
Rate: $75/hour, though somewhat volatile due to commitments regarding
GNU Fortran -- willing to consider flat-fee arrangements
Entered: 10 Jul 92

Michael I. Bushnell <mib@gnu.ai.mit.edu>
NE43-426, 545 Technology Square
Cambridge, MA 02139
(617) 253-8568
All GNU software: Installation, customization, answering simple or
complex questions, bug fixing, extension.
Experience: I have done Unix and GNU programming for several years,
I am the primary author of the Hurd (which provides most
kernel related facilities for the GNU OS).
I am easily available in the Cambridge/Boston area; work via email.
I am willing to travel for sufficiently large jobs.
Rates: $50/hr, negotiable, less for non-profit organizaions.
Updated: 10/29/91

C2V Renaud Dumeur <renaud@ccv.fr>
82 bd Haussmann Jean-Alain Le Borgne <jalb@ccv.fr>
75009 Paris
France
Tel (1) 40.08.07.07
Fax (1) 43.87.35.99
Emacs: questions answered, installation, teaching (all levels), elisp
and C extensions and customization, porting, troubleshooting
gcc: installation, extensions, porting
gdb: installation, debugging, porting
X11: installation, debugging, internationalization
Experience: yes (ask for details)
Rates: 500ff/hr, negotiable.
Entered: 12/17/91

Mr. David J. Camp <david@wubios.wustl.edu>
6103 Charlotte Avenue
Saint Louis, MO 63120-1201
Background: Bachelor of Science in Computer Science, Washington University
Master of Science in Computer Science, Washington University
Over 12 years experience in the computer industry.
Author of the future GNU uu/xxen/decoder program.
Skilled in many languages, including C and Unix scripts.
Tasks: I can do on-site service in the St. Louis area.
I prefer short-term projects.
I can handle long projects given time.
I reserve the right to refuse work.
Rates: $50 per hour, including travel time
Entered: 1/1/91

Computing Support Team (CSTeam)
111 College Place, Rm 2-212
Syracuse, NY, 13244-4100
phone: 1-315-443-3929, fax: 1-315-443-4745, email: <info@csteam.com>
The Computing Support Team offers a wide variety of support services
including system design, installation, software support, contract
programming, network design, integration and migration services,
training, e-mail and telephone support. Experienced with GNU, X, TeX,
and other public domain software.
Rates: $50-$80/hr, 33% non-profit discount.
Entered: 10 Jul 92

Contributed Software
Graefestr. 76
1000 Berlin 61, Germany
phone: (+49 30) 694 69 07
modems: (+49 30) 694 {61 82 | 67 49 | 68 09}
email: <info@contrib.de>
internet: scuzzy.contrib.de [192.109.39.1]
We distribute, install/port, teach and support free software
in general, i.e. X11, GNU, khoros etc.
Rates are DM 150,-- plus tax per hour, educational sites get rebates.
Entered: 10 Jul 92

Cygnus Support <info@cygnus.com>
814 University Avenue ...uunet!cygint!info
Palo Alto, CA 94301
+1 415 322 3811 Voice
+1 415 322 3270 FAX
Cygnus Support offers warranty protection (service contracts) for a
number of free software tools. For a fixed annual fee our customers
receive binary and source distributions, mail and phone support,
documentation and customization assistance on a variety of popular
platforms.
At the time of this writing we offer support for a development package
including (among other things) gcc, g++, gdb, and of course, GNU
Emacs. We also offer support for a network facilities package
including many of the Athena tools like Kerberos and Hesiod. However
the set of supported tools and platforms increases frequently so
contact us for the latest information.
For those who need on-site assistance, support is also available from
our Cambridge office.
Rates: $300/hour. Annual Support starts at $35,000.
Updated: 11 Sept 91

Bradley N. Davis <b-davis@jaguar.utah.edu>
3242 South 540 West
Bountiful, UT 84010
(801) 298-6345
Will work on most GNU software. Especially GNU Emacs, GCC and a
little X11 and G++. Experienced with PCs and 386s.
Services offered: Installation, porting, customizing, troubleshooting.
Fee: $20 to $50 / hour depending on job
Updated: 6/11/91

DePalma SoftCraft Contact: Mauro DePalma
2923 Cohansey Drive Voice: (408) 259-4789
San Jose, CA 95132-1619 Fax: (408) 259-6935
Internet: <mauro@netcom.com> (or <apple!netcom!mauro>)
DePalma SoftCraft provides distribution, installation, setup, and
support for the X Window System (X11R4).
This small business provides consulting in every area of a computer
s/w project life cycle. We specialize in UNIX, GNU Development Tools
(gcc, g++, ...), RCS, and XView.
Updated: 4/29/91

Equivalent Software HB <ingwa@isy.liu.se>
Repslagaregatan 34 or <jonas-y@isy.liu.se>
582 22 Linkoping
SWEDEN
+46 (0)13 13 54 21
Equivalent Software HB is the worlds second(?) company dedicated to
supporting free UNIX software. The owners have more than 5 years of
UNIX experience, both as system adminstrators and programmers. We
also have extensive experience in maintaining the GNU programs, both
administrating it and fixing bugs.
Services offered:
- Installation and custumizing GNU and other free software. We will
make free software as easy to install and use as shrink wrapped
programs.
- Customization and porting.
- Subscriptions to new versions which we will send monthly or with
any other interval.
- Finding, Recommending and Investigation of free software in any
area of the customers choise.
- Regular consulting. We prefer smaller jobs, but are willing to
consider larger ones. We can work through the Internet, but prefer
jobs in Sweden.
Rates: For software items, request our price list.
For consulting, 450 SEK/hour.
Entered: 2/14/92

Andy Gaynor -- [Ag] <gaynor@paul.rutgers.edu>
597 Hoes Lane, Piscataway, NJ 08854
908-463-3376
GNU Emacs:
Lisp development, customization, troubleshooting, support, etc
User instruction and management for all levels of experience
Umpteen-thousand lines of Lisp code, careful study of GNU Emacs organization,
years of monitoring the UseNet Emacs and GNU groups, etc
Version 19 is due soon -- I will be up-to-speed as quickly as possible
$50/hour starting, negotiable on difficulty, organization, distribution, etc
Other Tasks:
General programming/software engineering (language software preferred)
Familiar with Unix, C, Lisp, networking, standard Unix utilities, various
other languages, etc
Contact me for more info
Entered: 10 Feb 92

Ron Guilmette <rfg@ncd.com>
396 Ano Nuevo Ave. #216
Sunnyvale, CA 94086
408-732-7839
Services: Development & porting of GNU software development tools.
GNU Contributions:
Invented, designed, and implemented the protoize and
unprotoize tools supplied with GCC2.
Designed and developed all code to support the generation
of Dwarf symbolic debugging information for System V Release
4 in GCC2.
Finished GCC2 port to the Intel i860 RISC processor.
Now developing GDB code for System V Release 4 support of
ELF and Dwarf.
Experience: 9+ years UNIX systems experience, all working on compilers
and related tools.
3+ years working professionally on GCC, G++, and GDB under
contract to various firms including the Microelectronics
and Computer Technology Corporation (MCC), Data General (DG),
Network Computing Devices (NCD), and Intel Corp.
Other qualifications:
Holder of both a Bachelor's and a Master's degree, both in
Computer Science.
Observer Member of ANSI X3J16 (C++ standardization) committee.
Former vice-chairman of UNIX International Programming
Languages Special Interest Group (UI/PLSIG).
Rates: Variable depending upon contract duration. Call for quote.
Updated: 9 Feb 92

Johannes M. Heuft <ksh@pcs.com>
Pfarrweg 2c
D-8000 Munich 90
Germany
Telephone: Germany+89/681773
Rate: min. DM 180.- ($ 120.-) per hour
interesting tasks for non-profit organisations may be free
Supported Programs: gcc, gas, g++, gdb, binutils, gnuplot, ...; (not emacs)
Experience: 10 years of operating system, network, and compiler
construction; also includes engineering management.
Degrees: Dipl. Inform. (similar to MS CS)
Updated: 11/9/91

Sanjay Hiranandani <4393472@mcimail.com>
16 Campus Plaza, Suite 180
Vestal, NY 13850
Work:607-729-7834 ext. 180
Home:607-748-2709
Fax:607-748-0243
Rate: $40/hr. Phone questions for free are ok as far as my schedule will permit
Lower rates for students and certain non-profit organizations
Can help with installation/customization/modification of most GNU software.
Experience: Software Development, System Administration, and Consulting on
a variety of computing platforms.
Updated: 11 Sept 91

Hundred Acre Software Consultants <info@pooh.com>
1280 Terminal Way, Suite 26 <uunet!heather!info>
Reno NV 89502-3243
(702) 329-9333
Hundred Acre is a consulting group providing support and development
services to organizations of all sizes. We support all kinds of publicly
available software, not just GNU; write for the current list. We work on
a "service contract" basis for support -- for a yearly fee, we provide email
and toll free telephone support, and free updates and bug fixes. Certain
support levels even have free on-site support. Development is charged on
either an hourly or fixed bid basis.
Consulting rates: $50 to $70 per hour, or fixed bid.
Support contracts: Several levels, from $500 to $30000 per year.
Updated: 2 Jul 91

Jose A. Fernandez <jaf@inference.com>
WORK: Inference Corporation HOME:
550 N. Continental Blvd. 1025 Hillside Dr.
El Segundo, CA 90245 Chino Hills, CA 91709
(310) 322-0200 (714) 528-2523
RATES:
$50-$200/hour plus expenses (or possibly free), depending on task.
SERVICES:
GNU software: installation, troubleshooting, and customization.
X11 software: installation and troubleshooting.
SysAdmin: installation, configuration, and trouble-shooting.
NetAdmin: installation, configuration, and trouble-shooting.
Education: teaching how to fish opens the demand for fishing poles.
Advice: free over email.
Entered: 10 Jul 92

Scott D. Kalter <sdk@twinsun.com>
970 Palm Ave. #218
West Hollywood, CA 90069
Home: (213)657-9174
Work: (213)524-1805
Emacs: e-lisp and C level customization/extension
training for general use and customization
user support, installation, troubleshooting
Rates: approx. $50/hr, negotiable
Very willing to answer quick questions for free.
Prefer e-mail communication to telephone.
Qualifications: BS Math/CS 1985: Carnegie Mellon University
MS CS 1988: UCLA
Extensive e-lisp level modification for rapid prototyping of
designs used in groupware research. Very familiar with all
levels of elisp programming. Taught Emacs use and
customization in universities and industry. Extensive
troubleshooting and user support experience.
Updated:10/10/91

Scott J. Kramer <sjk@aura.nbn.com>
P.O. Box 3392
San Rafael, CA 94912
+1 415-454-1295
Emacs: Tutoring, installations/upgrades, Lisp customizations,
general troubleshooting/support. Prefer that work I do
becomes part of the official Free Software Foundation
distribution.
Rate: Task- and time-dependent; non-monetary offers considered.
Updated: 28Aug91

Fen Labalme <fen@well.sf.ca.us>
Broadcatch Technologies
40 Carl St. #4
San Francisco CA 94117
(415) 731-1174
Rates: Free phone consultation
Extended project or consultation: $70/hour plus expenses
Non-profits get lower rates or free; barter welcome!
Emacs: Anything but specific termcap questions (general ones OK).
Includes elisp extensions & teaching beginning or advanced users.
Experience: I've been "hacking Emacs" for just about 15 years now.
Updated: 7/30/91

David C Lawrence <tale@cs.rpi.edu>
P.O. Box 61
North Chatham, NY 12132-0061
Home:518 766-9098 Work:518 851-2813
Rates: $30 hour for projects less than 8 hours.
$20 hour for longer projects.
Course fees vary with level of subject being taught.
Short queries answered free of charge.
All rates negotiable.
Support: Emacs (both lisp and C aspects), GCC, GAWK, sed, fileutils,
binutils, miscellaneous others. Definitely not G++.
Consulting via email or telephone, or possibly on-site.
Updated: 11 Sept 91

Greg Lehey
LEMIS
Schellnhausen 2
W-6324 Feldatal
Germany
Phone: +49-6637-1488
Fax: +49-6637-1489
Mail <grog%lemis@Germany.EU.net>
Services: Supply, porting, installation, consultation on all GNU
products.
Experience: 20 years OS and compiler experience, portations of most
GNU products.
Entered: 10 Jul 92

Marty Leisner <leisner.henr801c@xerox.com>
332 Shaftsbury Road
Rochester, New York 14610
Home:(716) 654-7931
Experience: 10 years C/Unix, 7 years DOS.
Extensive experience with GNU binary tools, cross-compilers,
embedded/hosted systems.
Degree : BS CS, Cornell University
Rates: $75/hr
Updated: 6 Jul 91

Roland McGrath <roland@ai.mit.edu>
545 Tech Sq rm 426
Cambridge, MA 02139
Work:(617)253-8568
Co-author and maintainer of GNU Make (with Richard Stallman).
Author and maintainer of the GNU C Library.
FSF employee summer 1989, fall 1990 to the present.
Installation, maintenance, porting, enhancement of all GNU software.
Fees negotiable. I can work anywhere in the Boston or SF Bay Area, or
anywhere on the Internet.
Updated: 12/15/90

Lee McLoughlin <lmjm@doc.ic.ac.uk>
Department of Computing,
Imperial College,
180 Queens Gate,
London
SW7 2BZ,
UK work: +44 71 589 5111 X 5085
gcc, emacs: can support and port to new machines
other: some experience with most gnu packages
Ported emacs to two new platforms (WhiteChappel Worstations,
HLH Orion). Worked on gcc port to Intergraph Clipper. Support
various gnu packages as part of a teaching service.
Rates: Quick phone questions are free.
Degrees:.Sc(Hons) Computer Science
Other: I'm a general workaholic and well versed in compilers, communications
and most things related to Unix.
Updated: 10.10.91

T.S.Mohan <mohan%vidya@shakti.ernet.in>
KBCS Group <mohan@vigyan.ernet.in>
Supercomputer Education and Research Centre
Indian Institute of Science
Bangalore 560 012
INDIA
Telephone (01-91-812)-341811, -341805
Rate: NIL. Availability for consultancy depends on
work load. High preference for academic institutions.
Support: emacs, gdb, gcc, g++ and other small public domain utilities
Experience: Installed and supported these + other gnu programs in our
centre for the past three years. General help to sister academic
departments and other academic institutions.
Degrees: Master of Engineering in CS. Currently working towards a PhD
in Distributed computing and programming languages.
Updated: 1 Dec 1991

Mojave Systems <mojsys!support@uunet.uu.net>
1254 Harvard Avenue
Claremont, CA 91711
714-621-7372
Mojave Systems offers porting services, warranty protection, and
software support for several GNU products. Porting services are
provided for a fixed fee. Software support is provided for fixed
annual fee.
Mojave Systems is able to provide these services for a wide variety of
hosts. We are currently porting GNU make and RCS to non-Unix hosts.
Entered: 12 Dec 90

Eric Raible <raible@nas.nasa.gov>
Nasa Ames Research Center
Mail Stop T045-1
Moffett Field, CA, 94035
(415) 604-4320 (W)
Rates: $40 hour; email questions free.
Gnu emacs C/lisp programming and porting. General
unix/graphics/emacs hacking, especially on Silicon Graphics
workstations.
Degree: MIT 83 BS CS.
Updated: 11 Sept 91

Paul Reilly <reilly@dg-rtp.dg.com>
721 Bennington Drive
Raleigh, NC 27615
Work: 919 248 6210
Home: 919 847 7294
Services: access, installation, porting, customizing and debugging
Unix Free software: X11, GNU, TeX, etc.
Rates: $150/hour
Updated: Dec 1991

Adam J. Richter <adam@soda.berkeley.edu> ...!ucbvax!soda!adam
409 Evelyn Avenue, Apartment 312 (510) 528-3209
Albany, CA 94706 fax: (510) 528-8508
X windows server expert. Freeware (especially copylefted) projects
preferred.
Updated: 18 Nov 91

Wolfgang S. Rupprecht <wolfgang@wsrcc.com>
PO Box 6524 <uunet!wsrcc!wolfgang>
Alexandria, VA 22306-0524 <wolfgang%wsrcc.com@uunet.uu.net>
(703) 768-2640
Emacs: Anything, (lisp, C, customization, porting, installing) I have
written thousands of lines of GNU Emacs C and Lisp code. Original
author of the floating point additions to appear in Emacs 19.
Rates: $75/hr.
Updated: 7/20/91

John Sechrest
Jasmic Systems Internet: <sechrest@jasmic.uucp>
2140 SW 49th St. UUCP: <hp-pcd!orstcs!jasmic!sechrest>
Corvallis, Oregon 97333
Gnu software: Questions about gnu emacs general use, training and classes,
documentation, system set up and design.
Experience: 11 years of Unix work. Heavy on System administration.
Teaching classes in Unix system administraion, Unix
Kernal Programming, Networking and Consulting services.
Currently working as the Support Coordinator for
Oregon State University (for 8 years).
Familiar with BSD systems mostly. Some SysVR4.
I have supported VAxes, HP's with HPUX, HP's with 4.3 BSD,
Sequent's, Next's and a few other misc. machines.
Updated: 28 Oct 1991

Steve Simmons <scs@lokkur.dexter.mi.us>
Inland Sea
9353 Hidden Lake Circle
Dexter, MI 48130
313-769-4086 (office1)
313-426-2086 (office2)
Rate: $75.00/hr for straight time until Jan 1, 1992. Rates will go up
an undetermined amount at that time. Free advice for short questions
by phone or email.
Programs Supported: Any. Quality of support I can offer depends on
the nature of the software; in particular I am *not* a compiler person.
Experiance: 13 years in computing, 10 with UNIX and various derivatives.
Specialist in systems administration. Lots of network admin.
Degree: Bachelors from University of Michigan, 1980.
Updated: 10 Oct 91

Lynn Slater <lrs@indetech.com>
42075 Lawrence Place
Fremont Ca 94538
Office (415) 438-2048; Home (415) 793-1864; Fax (415) 438-2034
Programs: Gnu Emacs Ada Mode, Gnu Emacs Empire Tool, Emacs,
g++ and gnumake (limited support only).
Experiance:
Gnu Emacs Ada Mode -- Co-author, principle integrator
Gnu Emacs Empire Tool -- Originator, co-author, principle distributor
Emacs -- Almost all parts. Authored super-apropos, headers, first GDB
interface, fancy-lisp, enhanced scribe mode,and lots of small stuff
g++ -- Have maintained, modified, and used G++ on 300+ user commercial
OLTP software.
gnumake -- Have bug fixed and extended.
Have single makefile that can merge in local changes and build the
following systems in a consistent manner in multiple releases on multiple
machines:
asm, bison, gcc, g++, emacs, rcs, gdb, libg++, att c++ libs, gnumake,
diff, tex2iroff
The makefile and related techniques are a bit hard to explain, but they
enable use and local changes in a broad spectrum of FSF code on many
platforms without having to remember all the individual make procedures.
Rate: Free for good cause or short stuff as there is time.
Am most likely to help in areas in which I have had problems or expect to
have problems.
Updated: 10 Oct 91

Small Business Systems, Inc. <postmaster@anomaly.sbs.com>
Box 17220, Route 104
Esmond, RI 02917
401.273.4669
Rate: Varies depending on complexity of task.
Hourly and fixed-rate contracts are available.
Programs Supported: All
Updated: 11 Sept 91

Randall D. Smith <randy@ai.mit.edu>
20 Watson Street
Cambridge, MA 02139, USA
+1 (617) 983-0276
Will work on most GNU software.
Installation, handholding, trouble shooting, extensions, teaching,
GCC, GDB, GNU-EMACS, and other ports.
Rates: Upward from $50.00/hour depending on my expertise in the area of the
job. GDB consulting at $80.00/hour.
Experience: 4 years of intensive experience with Unix and C including
system hacking and modification. Experience in porting GNU-EMACS (to
SGI Iris 4D) and GCC (to use Sun FPA chip). Experience working
full-time for the GNU project on other GNU programs (June 1988 -
August 1989). Primary maintainer of GDB and the GNU loader for that
period. Resume available on request.
Entered: 10 Feb 92

Richard M. Stallman <rms@prep.ai.mit.edu>
UUCP: {mit-eddie,ucbvax,uunet,harvard,uw-beaver}!ai.mit.edu!rms
545 Tech Sq, Rm 430
Cambridge, MA 02139
Emacs: anything whatever
Is anyone interested in courses in using or extending GNU Emacs?
Original inventor of Emacs and main author of GNU Emacs and GCC.
Rates: $6/min or $250/hr.
Entered: 5/24/90

Jonathan Stone <jonathan@isor.vuw.ac.nz>
c/o- Institute of Statistics and Operations Research
Victoria University of Wellington
P.O Box 600
Wellington
New Zealand
Work: +64 4 715-315 Fax: +64 4 712-070
Rate: hourly rate: NZ $ 150/hr. Quick phone questions are free.
Reduced rates available for for non-profit/educational insts
and daily rate work. Fixed-price contracts also considered.
Programs: GNU Emacs, GCC, GDB, GNU binutils,
Ghostscript, MIT X11
I am the author of the Pyramid ports of gcc and gdb.
Experiance: Five years administration of Unix systems and GNU tools
in University environments, and support of Unix administrators
and GNU tools as an external contractor to New Zealand Government
departments.
Degrees: M.Sc (Distinction) for a thesis involving work done on GCC.
Updated: 28 Aug 91

Bob Sutterfield <bob@morningstar.com>
work: home:
Morning Star Technologies
1760 Zollinger Road 3542 Norwood Street
Columbus, Ohio 43221 USA Columbus, Ohio 43224-3424 USA
(614)451-1883 (614)267-7611
Rates: $50/hr (negotiable) plus travel expenses
Gratis to Christian missionaries and mission agencies
Services: Installation, troubleshooting, and mild customization of
most GNU production and beta-test software; tutorials, training,
and handholding; general UNIX system and network consulting.
Entered: 2/16/92

Kayvan Sylvan <kayvan@satyr.Sylvan.COM>
Sylvan Associates
879 Lewiston Drive
San Jose, CA 95136
Phone: 408-978-1407
I will help you port, install and customize GNU Emacs, GCC, G++,
bison, and other GNU tools on almost any architechture and operating
system. Questions answered. GNU C and lisp hacking available. I will
also do ongoing support and periodic upgrades if you get on my GNU
software subscription list.
Rates: $60-$100/hour, depending on type of work. Substantial discounts
for long-term contracts and also for educational or non-profit
institutions.
Experience: Many different Unix systems (2.9BSD to 4.3BSD, SVR3 and
SVR4, Xenix). Systems programming and system administration on all
brands of Unix. Kernel hacking experience. Lots of porting experience.
I can port anything to anything (within reason).
Updated: 10 Jul 92

Leonard H. Tower Jr. <tower@prep.ai.mit.edu>
36 Porter Street
Somerville, MA 02143, USA
+1 (617) 623-7739
Will work on most GNU software.
Installation, handholding, trouble shooting, extensions, teaching.
Rates: 100.00/hour + travel expenses. Negotiable for non-profits.
Experience: Have hacked on over a dozen architectures in many languages. Have
system mothered several varieties of Unixes. Assisted rms with the front end
of gcc and it's back-end support. Resume available on request.
Entered: 12 Feb 92

Watchmaker Computing <support@watch.com>
P.O.Box 163, Kendall Square
Cambridge, MA 02142
email: support@watch.com
Emacs: We'll do GNUEmacs support, porting, bug fixing, and customizing.
We also have specific expertise in:
packages: GCC, G++, X11, Xt, InterViews, PERL, TeX, Epoch
languages: C, C++, Lisp, most others; we learn quickly!
Extensive experience coding for portability under UNIX.
Typical rates $35-$150/hour; will telecommute (Internet or phone)
Entered: 1/16/91

Chris Welty <weltyc@cs.rpi.edu>
RPI Computer Science Dept
Troy, NY 12180
518-276-2816 (W)
EMail correspondance preferred.
Rates vary depending on need, barter often accepted.
Programs: emacs, especially emacs lisp.
Lots of experience in various areas.
BS, MS from RPI. Currently working on PhD.
Updated: 10/10/91

Pace Willisson <pace@blitz.com>
Blitz Product Development Corporation <uunet!blitz!pace>
4 Spruce Road
Medway, MA 02053, USA
Work: (508) 533-6430
Rates: $80.00/hour
Will work on any GNU software.
Experience: 12 years working with C, Unix and Lisp Machines including
compilation systems, networks, device drivers, demand paging systems,
boot programs and window systems. Ported GDB to 80386. Designed COFF
encapsulation scheme to run GNU linker output on System 5 kernels.
Author of Unix "ispell".
Degree: BS in Computer Science from MIT
Updated: 7/31/91

Patrick Wood
Pipeline Associates, Inc.
2740 Route 10 West
Morris Plains, NJ 07950
Rate: Free
Support For: gcc, binutils, gnulib, using gcc for cross compiling
Experiance: used gcc for cross compiling for over 2 years; used
gcc for three years; installed and support gcc on several
BSD and System V UNIX systems; wrote peephole optimizer for
gcc on 68K, wrote portable replacement for FP routines in
gnulib.c. Modified gcc and binutils to work in byte-swapped
environments.
Other: email consulting only <pipeline!phw@motown.com>,
uunet!motown!pipeline!phw,sun!pipeline!phw, amdcad!pipeline!phw
Updated: 18 Sept 91

xprt Computer Consulting, Inc. <jody@shell.com>
17200 El Camino Real Suite 110 T
Houston, TX 77058
(713) 480 UNIX
(713) 486 8575 (Fax)
Programs Supported:
X11, TeX, and all of GNU.
Experience:
We have supported and maintained all of GNU, X11 and TeX for over four
years for a major oil company's research division on several different
Unix platforms.
Rates: $150/hour
Entered: 10 Jul 92

Name: david d [zoo] zuhn <zuhn@cs.umn.edu>
Company: armadillo zoo software
Fees: $50/hour, discounts for educational institutions and non-profits
GNU and X11 installation and maintainance on SGI Iris, Sun [68k &
SPARC], and Sequent machines. Additional machines a possibility.
Any GNU software installed. Most supported.
Updated: 7/11/92

** Please keep this file alphabetical **

View File

@ -1,214 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
alloca -- (mostly) portable public-domain implementation -- D A Gwyn
last edit: 86/05/30 rms
include config.h, since on VMS it renames some symbols.
Use xmalloc instead of malloc.
This implementation of the PWB library alloca() function,
which is used to allocate space off the run-time stack so
that it is automatically reclaimed upon procedure exit,
was inspired by discussions with J. Q. Johnson of Cornell.
It should work under any C implementation that uses an
actual procedure stack (as opposed to a linked list of
frames). There are some preprocessor constants that can
be defined when compiling for your specific system, for
improved efficiency; however, the defaults should be okay.
The general concept of this implementation is to keep
track of all alloca()-allocated blocks, and reclaim any
that are found to be deeper in the stack than the current
invocation. This heuristic does not reclaim storage as
soon as it becomes invalid, but it will do so eventually.
As a special case, alloca(0) reclaims storage without
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection.
*/
#ifndef lint
static char SCCSid[] = "@(#)alloca.c 1.1"; /* for the "what" utility */
#endif
#ifdef emacs
#include "config.h"
#ifdef static
/* actually, only want this if static is defined as ""
-- this is for usg, in which emacs must undefine static
in order to make unexec workable
*/
#ifndef STACK_DIRECTION
you
lose
-- must know STACK_DIRECTION at compile-time
#endif /* STACK_DIRECTION undefined */
#endif static
#endif emacs
#ifdef X3J11
typedef void *pointer; /* generic pointer type */
#else
typedef char *pointer; /* generic pointer type */
#endif
#define NULL 0 /* null pointer constant */
extern void free();
extern pointer xmalloc();
/*
Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#ifndef STACK_DIRECTION
#define STACK_DIRECTION 0 /* direction unknown */
#endif
#if STACK_DIRECTION != 0
#define STACK_DIR STACK_DIRECTION /* known at compile-time */
#else /* STACK_DIRECTION == 0; need run-time code */
static int stack_dir; /* 1 or -1 once known */
#define STACK_DIR stack_dir
static void
find_stack_direction (/* void */)
{
static char *addr = NULL; /* address of first
`dummy', once known */
auto char dummy; /* to get stack address */
if (addr == NULL)
{ /* initial entry */
addr = &dummy;
find_stack_direction (); /* recurse once */
}
else /* second entry */
if (&dummy > addr)
stack_dir = 1; /* stack grew upward */
else
stack_dir = -1; /* stack grew downward */
}
#endif /* STACK_DIRECTION == 0 */
/*
An "alloca header" is used to:
(a) chain together all alloca()ed blocks;
(b) keep track of stack depth.
It is very important that sizeof(header) agree with malloc()
alignment chunk size. The following default should work okay.
*/
#ifndef ALIGN_SIZE
#define ALIGN_SIZE sizeof(double)
#endif
typedef union hdr
{
char align[ALIGN_SIZE]; /* to force sizeof(header) */
struct
{
union hdr *next; /* for chaining headers */
char *deep; /* for stack depth measure */
} h;
} header;
/*
alloca( size ) returns a pointer to at least `size' bytes of
storage which will be automatically reclaimed upon exit from
the procedure that called alloca(). Originally, this space
was supposed to be taken from the current stack frame of the
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32.
*/
static header *last_alloca_header = NULL; /* -> last alloca header */
pointer
alloca (size) /* returns pointer to storage */
unsigned size; /* # bytes to allocate */
{
auto char probe; /* probes stack depth: */
register char *depth = &probe;
#if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* unknown growth direction */
find_stack_direction ();
#endif
/* Reclaim garbage, defined as all alloca()ed storage that
was allocated from deeper in the stack than currently. */
{
register header *hp; /* traverses linked list */
for (hp = last_alloca_header; hp != NULL;)
if (STACK_DIR > 0 && hp->h.deep > depth
|| STACK_DIR < 0 && hp->h.deep < depth)
{
register header *np = hp->h.next;
free ((pointer) hp); /* collect garbage */
hp = np; /* -> next header */
}
else
break; /* rest are not deeper */
last_alloca_header = hp; /* -> last valid storage */
}
if (size == 0)
return NULL; /* no allocation required */
/* Allocate combined header + user data storage. */
{
register pointer new = xmalloc (sizeof (header) + size);
/* address of header */
((header *)new)->h.next = last_alloca_header;
((header *)new)->h.deep = depth;
last_alloca_header = (header *)new;
/* User storage begins just after header. */
return (pointer)((char *)new + sizeof(header));
}
}

View File

@ -1,55 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Allow this file to be included multiple times
with different settings of NDEBUG. */
#undef assert
#undef __assert
#ifdef NDEBUG
#define assert(ignore) ((void)0)
#else
void __eprintf (); /* Defined in gnulib */
#ifdef __STDC__
#define assert(expression) \
((void) ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__)))
#define __assert(expression, file, lineno) \
(__eprintf ("Failed assertion `%s' at line %d of `%s'.\n", \
expression, lineno, file), 0)
#else /* no __STDC__; i.e. -traditional. */
#define assert(expression) \
((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
#define __assert(expression, file, lineno) \
(__eprintf ("Failed assertion `%s' at line %d of `%s'.\n", \
"expression", lineno, file), 0)
#endif /* no __STDC__; i.e. -traditional. */
#endif

View File

@ -1,157 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Description de la machine virtuelle
*
* Ecrit par Arnaud COMPAN & Francois PECHEUX ** avril-juin 1990
* Avec quelques modifications par Frederic Petrot.
*/
#ifndef FILE
#include <stdio.h>
#endif
#define AT_SP(mode) (gen_rtx (MEM, (mode), stack_pointer_rtx))
#define AT_BP(mode) (gen_rtx (MEM, (mode), frame_pointer_rtx))
#define RET return ""
#define RETCOM(X) return ""
extern FILE *asm_out_file;
static char *singlemove_string ();
static void output_movf ();
static void replace_float_constant ();
static int mentions_fp_top ();
static int call_top_dead_p ();
static int fp_top_dead_p1 ();
static rtx via_memory ();
static void output_asm_insn_double_reg_op ();
#define PRINT_REG(X, CODE, FILE) fprintf (FILE, "%s", reg_name[REGNO (X)])
notice_update_cc(exp)
rtx exp;
{
if (GET_CODE (exp) == SET) {
if (SET_DEST (exp) == pc_rtx)
return;
if (REG_P (SET_DEST (exp))
&& (REG_P (SET_SRC (exp)) || GET_CODE (SET_SRC (exp)) == MEM)) {
if (cc_status.value1
&& reg_overlap_mentioned_p (SET_DEST (exp), cc_status.value1))
cc_status.value1 = 0;
if (cc_status.value2
&& reg_overlap_mentioned_p (SET_DEST (exp), cc_status.value2))
cc_status.value2 = 0;
return;
}
if (GET_CODE (SET_DEST (exp)) == MEM && REG_P (SET_SRC (exp))) {
if (cc_status.value1 && GET_CODE (cc_status.value1) == MEM)
cc_status.value1 = 0;
if (cc_status.value2 && GET_CODE (cc_status.value2) == MEM)
cc_status.value2 = 0;
return;
} else if (GET_CODE (SET_SRC (exp)) == CALL) {
CC_STATUS_INIT;
return;
} else if (SET_DEST (exp) == cc0_rtx) {
CC_STATUS_INIT;
cc_status.value1 = SET_SRC (exp);
return;
} else if (GET_MODE (SET_SRC (exp)) == SImode)
switch (GET_CODE (SET_SRC (exp))) {
case ASHIFTRT:
case LSHIFTRT:
case ASHIFT:
case LSHIFT:
if (GET_CODE (XEXP (SET_SRC (exp), 1)) != CONST_INT) {
CC_STATUS_INIT;
break;
}
case PLUS:
case MINUS:
case NEG:
case AND:
case IOR:
case XOR:
cc_status.flags = CC_NO_OVERFLOW;
cc_status.value1 = SET_SRC (exp);
cc_status.value2 = SET_DEST (exp);
break;
default:
CC_STATUS_INIT;
}
else
CC_STATUS_INIT;
} else if (GET_CODE (exp) == PARALLEL
&& GET_CODE (XVECEXP (exp, 0, 0)) == SET) {
if (SET_DEST (XVECEXP (exp, 0, 0)) == pc_rtx)
return;
if (SET_DEST (XVECEXP (exp, 0, 0)) == cc0_rtx) {
CC_STATUS_INIT;
cc_status.value1 = SET_SRC (XVECEXP (exp, 0, 0));
return;
}
CC_STATUS_INIT;
} else
CC_STATUS_INIT;
}
output_ascii(file, p, size)
FILE *file;
char *p;
int size;
{
int i;
fprintf (file, "\t.string \"");
for (i = 0; i < size; i++) {
register int c = p[i];
if (c == '\"' || c == '\\')
putc ('\\', file);
if (c >= ' ' && c < 0177)
putc (c, file);
else {
fprintf (file, "\\%03o", c);
if (i < size - 1 && p[i + 1] >= '0' && p[i + 1] <= '9')
fprintf (file, "\"\n\tstring \"");
}
}
fprintf (file, "\"\n");
}
int ever_good(op, mode)
register rtx op;
enum machine_mode mode;
{
return 1;
}
int no_good(op, mode)
register rtx op;
enum machine_mode mode;
{
return 0;
}

View File

@ -1,85 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Define control and data flow tables, and regsets.
Copyright (C) 1987 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Define the type for a pointer to a set with a bit for each
(hard or pseudo) register. */
typedef long *regset;
/* Size of a regset for the current function,
in (1) bytes and (2) elements. */
extern int regset_bytes;
extern int regset_size;
/* Number of bits in each actual element of a regset. */
#define REGSET_ELT_BITS HOST_BITS_PER_INT
/* Number of basic blocks in the current function. */
extern int n_basic_blocks;
/* Index by basic block number, get first insn in the block. */
extern rtx *basic_block_head;
/* Index by basic block number, get last insn in the block. */
extern rtx *basic_block_end;
/* Index by basic block number, get address of regset
describing the registers live at the start of that block. */
extern regset *basic_block_live_at_start;
/* Indexed by n, gives number of basic block that (REG n) is used in.
If the value is REG_BLOCK_GLOBAL (-2),
it means (REG n) is used in more than one basic block.
REG_BLOCK_UNKNOWN (-1) means it hasn't been seen yet so we don't know.
This information remains valid for the rest of the compilation
of the current function; it is used to control register allocation. */
#define REG_BLOCK_UNKNOWN -1
#define REG_BLOCK_GLOBAL -2
extern short *reg_basic_block;

View File

@ -1,420 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Language-level data type conversion for GNU C.
Copyright (C) 1987, 1988 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* This file contains the functions for converting C expressions
to different data types. The only entry point is `convert'.
Every language front end must have a `convert' function
but what kind of conversions it does will depend on the language. */
#include "config.h"
#include "tree.h"
/* Change of width--truncation and extension of integers or reals--
is represented with NOP_EXPR. Proper functioning of many things
assumes that no other conversions can be NOP_EXPRs.
Conversion between integer and pointer is represented with CONVERT_EXPR.
Converting integer to real uses FLOAT_EXPR
and real to integer uses FIX_TRUNC_EXPR.
Here is a list of all the functions that assume that widening and
narrowing is always done with a NOP_EXPR:
In c-convert.c, convert_to_integer.
In c-typeck.c, build_binary_op_nodefault (boolean ops),
and truthvalue_conversion.
In expr.c: expand_expr, for operands of a MULT_EXPR.
In fold-const.c: fold.
In tree.c: get_narrower and get_unwidened. */
/* Subroutines of `convert'. */
static tree
convert_to_pointer (type, expr)
tree type, expr;
{
register tree intype = TREE_TYPE (expr);
register enum tree_code form = TREE_CODE (intype);
if (integer_zerop (expr))
{
if (type == TREE_TYPE (null_pointer_node))
return null_pointer_node;
expr = build_int_2 (0, 0);
TREE_TYPE (expr) = type;
return expr;
}
if (form == POINTER_TYPE)
return build (NOP_EXPR, type, expr);
if (form == INTEGER_TYPE || form == ENUMERAL_TYPE)
{
if (type_precision (intype) == POINTER_SIZE)
return build (CONVERT_EXPR, type, expr);
return convert_to_pointer (type,
convert (type_for_size (POINTER_SIZE, 0),
expr));
}
error ("cannot convert to a pointer type");
return null_pointer_node;
}
static tree
convert_to_real (type, expr)
tree type, expr;
{
register enum tree_code form = TREE_CODE (TREE_TYPE (expr));
extern int flag_float_store;
if (form == REAL_TYPE)
return build (flag_float_store ? CONVERT_EXPR : NOP_EXPR,
type, expr);
if (form == INTEGER_TYPE || form == ENUMERAL_TYPE)
return build (FLOAT_EXPR, type, expr);
if (form == POINTER_TYPE)
error ("pointer value used where a float was expected");
else
error ("aggregate value used where a float was expected");
{
register tree tem = make_node (REAL_CST);
TREE_TYPE (tem) = type;
TREE_REAL_CST (tem) = REAL_VALUE_ATOF ("0.0");
return tem;
}
}
/* The result of this is always supposed to be a newly created tree node
not in use in any existing structure. */
static tree
convert_to_integer (type, expr)
tree type, expr;
{
register tree intype = TREE_TYPE (expr);
register enum tree_code form = TREE_CODE (intype);
extern tree build_binary_op_nodefault ();
extern tree build_unary_op ();
if (form == POINTER_TYPE)
{
if (integer_zerop (expr))
expr = integer_zero_node;
else
expr = fold (build (CONVERT_EXPR,
type_for_size (POINTER_SIZE, 0), expr));
intype = TREE_TYPE (expr);
form = TREE_CODE (intype);
if (intype == type)
return expr;
}
if (form == INTEGER_TYPE || form == ENUMERAL_TYPE)
{
register int outprec = TYPE_PRECISION (type);
register int inprec = TYPE_PRECISION (intype);
register enum tree_code ex_form = TREE_CODE (expr);
if (outprec >= inprec)
return build (NOP_EXPR, type, expr);
/* Here detect when we can distribute the truncation down past some arithmetic.
For example, if adding two longs and converting to an int,
we can equally well convert both to ints and then add.
For the operations handled here, such truncation distribution
is always safe.
It is desirable in these cases:
1) when truncating down to full-word from a larger size
2) when truncating takes no work.
3) when at least one operand of the arithmetic has been extended
(as by C's default conversions). In this case we need two conversions
if we do the arithmetic as already requested, so we might as well
truncate both and then combine. Perhaps that way we need only one.
Note that in general we cannot do the arithmetic in a type
shorter than the desired result of conversion, even if the operands
are both extended from a shorter type, because they might overflow
if combined in that type. The exceptions to this--the times when
two narrow values can be combined in their narrow type even to
make a wider result--are handled by "shorten" in build_binary_op. */
switch (ex_form)
{
case RSHIFT_EXPR:
/* We can pass truncation down through right shifting
when the shift count is a negative constant. */
if (TREE_CODE (TREE_OPERAND (expr, 1)) != INTEGER_CST
|| TREE_INT_CST_LOW (TREE_OPERAND (expr, 1)) > 0)
break;
goto trunc1;
case LSHIFT_EXPR:
/* We can pass truncation down through left shifting
when the shift count is a positive constant. */
if (TREE_CODE (TREE_OPERAND (expr, 1)) != INTEGER_CST
|| TREE_INT_CST_LOW (TREE_OPERAND (expr, 1)) < 0)
break;
/* In this case, shifting is like multiplication. */
goto trunc1;
case MAX_EXPR:
case MIN_EXPR:
case MULT_EXPR:
{
tree arg0 = get_unwidened (TREE_OPERAND (expr, 0), type);
tree arg1 = get_unwidened (TREE_OPERAND (expr, 1), type);
/* Don't distribute unless the output precision is at least as big
as the actual inputs. Otherwise, the comparison of the
truncated values will be wrong. */
if (outprec >= TYPE_PRECISION (TREE_TYPE (arg0))
&& outprec >= TYPE_PRECISION (TREE_TYPE (arg1))
/* If signedness of arg0 and arg1 don't match,
we can't necessarily find a type to compare them in. */
&& (TREE_UNSIGNED (TREE_TYPE (arg0))
== TREE_UNSIGNED (TREE_TYPE (arg1))))
goto trunc1;
break;
}
case PLUS_EXPR:
case MINUS_EXPR:
case BIT_AND_EXPR:
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case BIT_ANDTC_EXPR:
trunc1:
{
tree arg0 = get_unwidened (TREE_OPERAND (expr, 0), type);
tree arg1 = get_unwidened (TREE_OPERAND (expr, 1), type);
if (outprec >= BITS_PER_WORD
|| TRULY_NOOP_TRUNCATION (outprec, inprec)
|| inprec > TYPE_PRECISION (TREE_TYPE (arg0))
|| inprec > TYPE_PRECISION (TREE_TYPE (arg1)))
{
/* Do the arithmetic in type TYPEX,
then convert result to TYPE. */
register tree typex = type;
/* Can't do arithmetic in enumeral types
so use an integer type that will hold the values. */
if (TREE_CODE (typex) == ENUMERAL_TYPE)
typex = type_for_size (TYPE_PRECISION (typex),
TREE_UNSIGNED (typex));
/* But now perhaps TYPEX is as wide as INPREC.
In that case, do nothing special here.
(Otherwise would recurse infinitely in convert. */
if (TYPE_PRECISION (typex) != inprec)
{
/* Don't do unsigned arithmetic where signed was wanted,
or vice versa.
Exception: if the original operands were unsigned
then can safely do the work as unsigned.
And we may need to do it as unsigned
if we truncate to the original size. */
typex = ((TREE_UNSIGNED (TREE_TYPE (expr))
|| TREE_UNSIGNED (TREE_TYPE (arg0)))
? unsigned_type (typex) : signed_type (typex));
return convert (type,
build_binary_op_nodefault (ex_form,
convert (typex, arg0),
convert (typex, arg1),
ex_form));
}
}
}
break;
case EQ_EXPR:
case NE_EXPR:
case GT_EXPR:
case GE_EXPR:
case LT_EXPR:
case LE_EXPR:
case TRUTH_AND_EXPR:
case TRUTH_ANDIF_EXPR:
case TRUTH_OR_EXPR:
case TRUTH_ORIF_EXPR:
case TRUTH_NOT_EXPR:
/* If we want result of comparison converted to a byte,
we can just regard it as a byte, since it is 0 or 1. */
TREE_TYPE (expr) = type;
return expr;
case NEGATE_EXPR:
case BIT_NOT_EXPR:
case ABS_EXPR:
{
register tree typex = type;
/* Can't do arithmetic in enumeral types
so use an integer type that will hold the values. */
if (TREE_CODE (typex) == ENUMERAL_TYPE)
typex = type_for_size (TYPE_PRECISION (typex),
TREE_UNSIGNED (typex));
/* But now perhaps TYPEX is as wide as INPREC.
In that case, do nothing special here.
(Otherwise would recurse infinitely in convert. */
if (TYPE_PRECISION (typex) != inprec)
{
/* Don't do unsigned arithmetic where signed was wanted,
or vice versa. */
typex = (TREE_UNSIGNED (TREE_TYPE (expr))
? unsigned_type (typex) : signed_type (typex));
return convert (type,
build_unary_op (ex_form,
convert (typex, TREE_OPERAND (expr, 0)),
1));
}
}
case NOP_EXPR:
/* If truncating after truncating, might as well do all at once.
If truncating after extending, we may get rid of wasted work. */
return convert (type, get_unwidened (TREE_OPERAND (expr, 0), type));
case COND_EXPR:
/* Can treat the two alternative values like the operands
of an arithmetic expression. */
{
tree arg1 = get_unwidened (TREE_OPERAND (expr, 1), type);
tree arg2 = get_unwidened (TREE_OPERAND (expr, 2), type);
if (outprec >= BITS_PER_WORD
|| TRULY_NOOP_TRUNCATION (outprec, inprec)
|| inprec > TYPE_PRECISION (TREE_TYPE (arg1))
|| inprec > TYPE_PRECISION (TREE_TYPE (arg2)))
{
/* Do the arithmetic in type TYPEX,
then convert result to TYPE. */
register tree typex = type;
/* Can't do arithmetic in enumeral types
so use an integer type that will hold the values. */
if (TREE_CODE (typex) == ENUMERAL_TYPE)
typex = type_for_size (TYPE_PRECISION (typex),
TREE_UNSIGNED (typex));
/* But now perhaps TYPEX is as wide as INPREC.
In that case, do nothing special here.
(Otherwise would recurse infinitely in convert. */
if (TYPE_PRECISION (typex) != inprec)
{
/* Don't do unsigned arithmetic where signed was wanted,
or vice versa. */
typex = (TREE_UNSIGNED (TREE_TYPE (expr))
? unsigned_type (typex) : signed_type (typex));
return convert (type,
build (COND_EXPR, typex,
TREE_OPERAND (expr, 0),
convert (typex, arg1),
convert (typex, arg2)));
}
}
}
}
return build (NOP_EXPR, type, expr);
}
if (form == REAL_TYPE)
return build (FIX_TRUNC_EXPR, type, expr);
error ("aggregate value used where an integer was expected");
{
register tree tem = build_int_2 (0, 0);
TREE_TYPE (tem) = type;
return tem;
}
}
/* Create an expression whose value is that of EXPR,
converted to type TYPE. The TREE_TYPE of the value
is always TYPE. This function implements all reasonable
conversions; callers should filter out those that are
not permitted by the language being compiled. */
tree
convert (type, expr)
tree type, expr;
{
register tree e = expr;
register enum tree_code code = TREE_CODE (type);
if (type == TREE_TYPE (expr) || TREE_CODE (expr) == ERROR_MARK)
return expr;
if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
return error_mark_node;
if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE)
{
error ("void value not ignored as it ought to be");
return error_mark_node;
}
if (code == VOID_TYPE)
return build (CONVERT_EXPR, type, e);
#if 0
/* This is incorrect. A truncation can't be stripped this way.
Extensions will be stripped by the use of get_unwidened. */
if (TREE_CODE (expr) == NOP_EXPR)
return convert (type, TREE_OPERAND (expr, 0));
#endif
if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
return fold (convert_to_integer (type, e));
if (code == POINTER_TYPE)
return fold (convert_to_pointer (type, e));
if (code == REAL_TYPE)
return fold (convert_to_real (type, e));
error ("conversion to non-scalar type requested");
return error_mark_node;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,56 +0,0 @@
%{
/* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
%}
struct resword { char *name; short token; enum rid rid; };
%%
__alignof, ALIGNOF, NORID
__alignof__, ALIGNOF, NORID
__asm, ASM, NORID
__asm__, ASM, NORID
__attribute, ATTRIBUTE, NORID
__attribute__, ATTRIBUTE, NORID
__const, TYPE_QUAL, RID_CONST
__const__, TYPE_QUAL, RID_CONST
__inline, SCSPEC, RID_INLINE
__inline__, SCSPEC, RID_INLINE
__signed, TYPESPEC, RID_SIGNED
__signed__, TYPESPEC, RID_SIGNED
__typeof, TYPEOF, NORID
__typeof__, TYPEOF, NORID
__volatile, TYPE_QUAL, RID_VOLATILE
__volatile__, TYPE_QUAL, RID_VOLATILE
asm, ASM, NORID
auto, SCSPEC, RID_AUTO
break, BREAK, NORID
case, CASE, NORID
char, TYPESPEC, RID_CHAR
const, TYPE_QUAL, RID_CONST
continue, CONTINUE, NORID
default, DEFAULT, NORID
do, DO, NORID
double, TYPESPEC, RID_DOUBLE
else, ELSE, NORID
enum, ENUM, NORID
extern, SCSPEC, RID_EXTERN
float, TYPESPEC, RID_FLOAT
for, FOR, NORID
goto, GOTO, NORID
if, IF, NORID
inline, SCSPEC, RID_INLINE
int, TYPESPEC, RID_INT
long, TYPESPEC, RID_LONG
register, SCSPEC, RID_REGISTER
return, RETURN, NORID
short, TYPESPEC, RID_SHORT
signed, TYPESPEC, RID_SIGNED
sizeof, SIZEOF, NORID
static, SCSPEC, RID_STATIC
struct, STRUCT, NORID
switch, SWITCH, NORID
typedef, SCSPEC, RID_TYPEDEF
typeof, TYPEOF, NORID
union, UNION, NORID
unsigned, TYPESPEC, RID_UNSIGNED
void, TYPESPEC, RID_VOID
volatile, TYPE_QUAL, RID_VOLATILE
while, WHILE, NORID

View File

@ -1,72 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Define constants for communication with parse.y.
Copyright (C) 1987 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
enum rid
{
RID_UNUSED,
RID_INT,
RID_CHAR,
RID_FLOAT,
RID_DOUBLE,
RID_VOID,
RID_UNUSED1,
RID_UNSIGNED,
RID_SHORT,
RID_LONG,
RID_AUTO,
RID_STATIC,
RID_EXTERN,
RID_REGISTER,
RID_TYPEDEF,
RID_SIGNED,
RID_CONST,
RID_VOLATILE,
RID_INLINE,
RID_NOALIAS,
RID_MAX
};
#define RID_FIRST_MODIFIER RID_UNSIGNED

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,177 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Definitions for C parsing and type checking.
Copyright (C) 1987 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Language-dependent contents of an identifier. */
struct lang_identifier
{
struct tree_identifier ignore;
tree global_value, local_value, label_value, implicit_decl;
tree error_locus;
};
/* Macros for access to language-specific slots in an identifier. */
#define IDENTIFIER_GLOBAL_VALUE(NODE) \
(((struct lang_identifier *)(NODE))->global_value)
#define IDENTIFIER_LOCAL_VALUE(NODE) \
(((struct lang_identifier *)(NODE))->local_value)
#define IDENTIFIER_LABEL_VALUE(NODE) \
(((struct lang_identifier *)(NODE))->label_value)
#define IDENTIFIER_IMPLICIT_DECL(NODE) \
(((struct lang_identifier *)(NODE))->implicit_decl)
#define IDENTIFIER_ERROR_LOCUS(NODE) \
(((struct lang_identifier *)(NODE))->error_locus)
/* Nonzero means reject anything that ANSI standard C forbids. */
extern int pedantic;
/* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */
#define C_TYPE_FIELDS_READONLY(type) TYPE_SEP_UNIT (type)
/* in c-typecheck.c */
extern tree build_component_ref(), build_conditional_expr(), build_compound_expr();
extern tree build_unary_op(), build_binary_op(), build_function_call();
extern tree build_binary_op_nodefault ();
extern tree build_indirect_ref(), build_array_ref(), build_c_cast();
extern tree build_modify_expr();
extern tree c_sizeof (), c_alignof ();
extern void store_init_value ();
extern tree digest_init ();
extern tree c_expand_start_case ();
extern tree default_conversion ();
/* Given two integer or real types, return the type for their sum.
Given two compatible ANSI C types, returns the merged type. */
extern tree commontype ();
/* in c-decl.c */
extern tree build_label ();
extern int start_function ();
extern void finish_function ();
extern void store_parm_decls ();
extern tree get_parm_info ();
extern void pushlevel ();
extern tree poplevel ();
extern tree groktypename(), lookup_name();
extern tree lookup_label(), define_label();
extern tree implicitly_declare(), getdecls(), gettags ();
extern tree start_decl();
extern void finish_decl();
extern tree start_struct(), finish_struct(), xref_tag();
extern tree grokfield();
extern tree start_enum(), finish_enum();
extern tree build_enumerator();
extern tree make_index_type ();
/* Add qualifiers to a type, in the fashion for C. */
extern tree c_build_type_variant ();
extern tree double_type_node, long_double_type_node, float_type_node;
extern tree char_type_node, unsigned_char_type_node, signed_char_type_node;
extern tree short_integer_type_node, short_unsigned_type_node;
extern tree long_integer_type_node, long_unsigned_type_node;
extern tree long_long_integer_type_node, long_long_unsigned_type_node;
extern tree unsigned_type_node;
extern tree string_type_node, char_array_type_node, int_array_type_node;
extern int current_function_returns_value;
extern int current_function_returns_null;
extern tree ridpointers[];
/* Nonzero means `$' can be in an identifier. */
extern int dollars_in_ident;
/* Nonzero means allow type mismatches in conditional expressions;
just make their values `void'. */
extern int flag_cond_mismatch;
/* Nonzero means don't recognize the keyword `asm'. */
extern int flag_no_asm;
/* Nonzero means warn about implicit declarations. */
extern int warn_implicit;
/* Nonzero means warn about function definitions that default the return type
or that use a null return and have a return-type other than void. */
extern int warn_return_type;
/* Nonzero means give string constants the type `const char *'
to get extra warnings from them. These warnings will be too numerous
to be useful, except in thoroughly ANSIfied programs. */
extern int warn_write_strings;
/* Nonzero means warn about sizeof(function) or addition/subtraction
of function pointers. */
extern int warn_pointer_arith;
/* Nonzero means warn for all old-style non-prototype function decls. */
extern int warn_strict_prototypes;
/* Nonzero means warn about pointer casts that can drop a type qualifier
from the pointer target type. */
extern int warn_cast_qual;
/* Nonzero means do some things the same way PCC does. */
extern int flag_traditional;

File diff suppressed because it is too large Load Diff

View File

@ -1,689 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Save and restore call-clobbered registers which are live across a call.
Copyright (C) 1989 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include "rtl.h"
#include "insn-config.h"
#include "flags.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "reload.h"
#include "recog.h"
#include "basic-block.h"
/* Set of hard regs currently live (during scan of all insns). */
static HARD_REG_SET hard_regs_live;
/* The block of storage on the stack where regs are saved */
static rtx save_block_addr;
static int save_block_size;
/* A REG rtx for each hard register that has been saved. */
static rtx save_reg_rtx[FIRST_PSEUDO_REGISTER];
static void set_reg_live ();
static void clear_reg_live ();
static void insert_call_saves ();
static void emit_mult_save ();
static void emit_mult_restore ();
static rtx grow_save_block ();
static enum machine_mode choose_hard_reg_mode ();
/* Find the places where hard regs are live across calls and save them. */
save_call_clobbered_regs ()
{
rtx insn;
int b;
if (obey_regdecls)
return;
save_block_size = 0;
save_block_addr = 0;
bzero (save_reg_rtx, sizeof save_reg_rtx);
for (b = 0; b < n_basic_blocks; b++)
{
regset regs_live = basic_block_live_at_start[b];
int offset, bit, i;
/* Compute hard regs live at start of block -- this is the
real hard regs marked live, plus live pseudo regs that
have been renumbered to hard regs. */
#ifdef HARD_REG_SET
hard_regs_live = *regs_live;
#else
COPY_HARD_REG_SET (hard_regs_live, regs_live);
#endif
for (offset = 0, i = 0; offset < regset_size; offset++)
{
if (regs_live[offset] == 0)
i += HOST_BITS_PER_INT;
else
for (bit = 1; bit && i < max_regno; bit <<= 1, i++)
if ((regs_live[offset] & bit) && reg_renumber[i] >= 0)
SET_HARD_REG_BIT (hard_regs_live, reg_renumber[i]);
}
/* Now scan the insns in the block, keeping track of what hard
regs are live as we go. When we see a call, save the live
call-clobbered hard regs. */
for (insn = basic_block_head[b]; TRUE; insn = NEXT_INSN (insn))
{
RTX_CODE code = GET_CODE (insn);
if (code == CALL_INSN)
insert_call_saves (insn);
if (code == INSN || code == CALL_INSN || code == JUMP_INSN)
{
rtx link;
/* NB: the normal procedure is to first enliven any
registers set by insn, then deaden any registers that
had their last use at insn. This is incorrect now,
since multiple pseudos may have been mapped to the
same hard reg, and the death notes are ambiguous. So
it must be done in the other, safe, order. */
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
if (REG_NOTE_KIND (link) == REG_DEAD)
clear_reg_live (XEXP (link, 0));
note_stores (PATTERN (insn), set_reg_live);
}
if (insn == basic_block_end[b])
break;
}
}
}
/* Here from note_stores when an insn stores a value in a register.
Set the proper bit or bits in hard_regs_live. */
static void
set_reg_live (reg, setter)
rtx reg, setter;
{
register int regno;
/* WORD is which word of a multi-register group is being stored.
For the case where the store is actually into a SUBREG of REG.
Except we don't use it; I believe the entire REG needs to be
live. */
int word = 0;
if (GET_CODE (reg) == SUBREG)
{
word = SUBREG_WORD (reg);
reg = SUBREG_REG (reg);
}
if (GET_CODE (reg) != REG)
return;
regno = REGNO (reg);
/* For pseudo reg, see if it has been assigned a hardware reg. */
if (reg_renumber[regno] >= 0)
regno = reg_renumber[regno] /* + word */;
/* Handle hardware regs (and pseudos allocated to hard regs). */
if (regno < FIRST_PSEUDO_REGISTER && ! call_fixed_regs[regno])
{
register int last = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg));
while (regno < last)
{
SET_HARD_REG_BIT (hard_regs_live, regno);
regno++;
}
}
}
/* Here when a REG_DEAD note records the last use of a reg. Clear
the appropriate bit or bits in hard_regs_live. */
static void
clear_reg_live (reg)
rtx reg;
{
register int regno = REGNO (reg);
/* For pseudo reg, see if it has been assigned a hardware reg. */
if (reg_renumber[regno] >= 0)
regno = reg_renumber[regno];
/* Handle hardware regs (and pseudos allocated to hard regs). */
if (regno < FIRST_PSEUDO_REGISTER && ! call_fixed_regs[regno])
{
/* Pseudo regs already assigned hardware regs are treated
almost the same as explicit hardware regs. */
register int last = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg));
while (regno < last)
{
CLEAR_HARD_REG_BIT (hard_regs_live, regno);
regno++;
}
}
}
/* Insert insns to save and restore live call-clobbered regs around
call insn INSN. */
static void
insert_call_saves (insn)
rtx insn;
{
int regno;
int save_block_size_needed;
int save_block_offset[FIRST_PSEUDO_REGISTER];
save_block_size_needed = 0;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
{
save_block_offset[regno] = -1;
if (call_used_regs[regno] && ! call_fixed_regs[regno]
&& TEST_HARD_REG_BIT (hard_regs_live, regno))
{
enum machine_mode mode = choose_hard_reg_mode (regno);
int align = GET_MODE_UNIT_SIZE (mode);
if (align > BIGGEST_ALIGNMENT / BITS_PER_UNIT)
align = BIGGEST_ALIGNMENT / BITS_PER_UNIT;
save_block_size_needed =
((save_block_size_needed + align - 1) / align) * align;
save_block_offset[regno] = save_block_size_needed;
save_block_size_needed += GET_MODE_SIZE (mode);
if (! save_reg_rtx[regno])
save_reg_rtx[regno] = gen_rtx (REG, mode, regno);
}
}
if (save_block_size < save_block_size_needed)
save_block_addr = grow_save_block (save_block_addr,
save_block_size_needed);
emit_mult_save (insn, save_block_addr, save_block_offset);
emit_mult_restore (insn, save_block_addr, save_block_offset);
}
/* Emit a string of stores to save the hard regs listed in
OFFSET[] at address ADDR. Emit them before INSN.
OFFSET[reg] is -1 if reg should not be saved, or a
suitably-aligned offset from ADDR.
The offsets actually used do not have to be those listed
in OFFSET, but should fit in a block of the same size. */
static void
emit_mult_save (insn, addr, offset)
rtx insn, addr;
int offset[];
{
int regno;
/* A register to use as a temporary for address calculations. */
rtx tempreg;
/* A register that could be used as that temp if we save and restore it. */
rtx can_push_reg;
/* Nonzero means we need to save a register to use it as TEMPREG. */
int needpush;
/* The amount the stack is decremented to save that register (if we do). */
int decrement;
/* Record which regs we save, in case we branch to retry. */
char already_saved[FIRST_PSEUDO_REGISTER];
bzero (already_saved, sizeof already_saved);
/* Hair is needed because sometimes the addresses to save in are
not valid (offsets too big).
So we need a reg, TEMPREG, to compute addresses in.
We look first for an empty reg to use.
Sometimes no reg is empty. Then we push a reg, use it, and pop it.
Sometimes the only reg to push and pop this way is one we want to save.
We can't save it while using it as a temporary.
So we save all the other registers, pop it, and go back to `retry'.
At that point, only this reg remains to be saved;
all the others already saved are empty.
So one of them can be the temporary for this one. */
/* Sometimes we can't save all the regs conveniently at once, just some.
If that happens, we branch back here to save the rest. */
retry:
needpush = 0;
tempreg = 0;
can_push_reg = 0;
/* Set NEEDPUSH if any save-addresses are not valid memory addresses.
If any register is available, record it in TEMPREG.
If any register doesn't need saving here, record it in CAN_PUSH_REG. */
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
{
if (offset[regno] >= 0 && ! already_saved[regno])
{
rtx reg = save_reg_rtx[regno];
rtx addr1 = plus_constant (addr, offset[regno]);
if (memory_address_p (GET_MODE (reg), addr1))
needpush = 1;
}
/* A call-clobbered reg that is dead, or already saved,
can be used as a temporary for sure, at no extra cost. */
if (tempreg == 0 && call_used_regs[regno] && ! fixed_regs[regno]
&& !(offset[regno] >= 0 && ! already_saved[regno])
&& HARD_REGNO_MODE_OK (regno, Pmode))
{
tempreg = gen_rtx (REG, Pmode, regno);
/* Don't use it if not valid for addressing. */
if (! strict_memory_address_p (QImode, tempreg))
tempreg = 0;
}
/* A call-saved reg can be a temporary if we push and pop it. */
if (can_push_reg == 0 && ! call_used_regs[regno]
&& HARD_REGNO_MODE_OK (regno, Pmode))
{
can_push_reg = gen_rtx (REG, Pmode, regno);
/* Don't use it if not valid for addressing. */
if (! strict_memory_address_p (QImode, can_push_reg))
can_push_reg = 0;
}
}
/* Clear NEEDPUSH if we already found an empty reg. */
if (tempreg != 0)
needpush = 0;
/* If we need a temp reg and none is free, make one free. */
if (needpush)
{
/* Choose a reg, preferably not among those it is our job to save. */
if (can_push_reg != 0)
tempreg = can_push_reg;
else
{
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
if (offset[regno] >= 0 && !already_saved[regno]
&& HARD_REGNO_MODE_OK (regno, Pmode))
{
tempreg = gen_rtx (REG, Pmode, regno);
/* Don't use it if not valid for addressing. */
if (! strict_memory_address_p (QImode, tempreg))
tempreg = 0;
else
break;
}
}
/* Push it on the stack. */
#ifdef STACK_GROWS_DOWNWARD
decrement = UNITS_PER_WORD;
#else
decrement = - UNITS_PER_WORD;
#endif
emit_insn_before (gen_add2_insn (stack_pointer_rtx,
gen_rtx (CONST_INT, VOIDmode, -decrement)),
insn);
emit_insn_before (gen_move_insn (gen_rtx (MEM, Pmode, stack_pointer_rtx),
tempreg),
insn);
}
/* Save the regs we are supposed to save, aside from TEMPREG.
Use TEMPREG for address calculations when needed. */
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
if (offset[regno] >= 0 && ! already_saved[regno]
&& tempreg != 0 && REGNO (tempreg) != regno)
{
rtx reg = save_reg_rtx[regno];
rtx addr1 = plus_constant (addr, offset[regno]);
rtx temp;
if (! memory_address_p (GET_MODE (reg), addr1))
{
if (GET_CODE (addr1) != PLUS)
abort ();
if (GET_CODE (XEXP (addr1, 1)) != CONST_INT
|| GET_CODE (XEXP (addr1, 0)) != REG)
abort ();
emit_insn_before (gen_move_insn (tempreg, XEXP (addr1, 0)), insn);
emit_insn_before (gen_add2_insn (tempreg, XEXP (addr1, 1)), insn);
addr1 = tempreg;
}
temp = gen_rtx (MEM, GET_MODE (reg), addr1);
emit_insn_before (gen_move_insn (temp, reg), insn);
already_saved[regno] = 1;
}
/* If we pushed TEMPREG to make it free, pop it. */
if (needpush)
{
emit_insn_before (gen_move_insn (tempreg,
gen_rtx (MEM, Pmode, stack_pointer_rtx)),
insn);
emit_insn_before (gen_add2_insn (stack_pointer_rtx,
gen_rtx (CONST_INT, VOIDmode, decrement)),
insn);
}
/* If TEMPREG itself needs saving, go back and save it.
There are plenty of free regs now, those already saved. */
if (tempreg != 0
&& offset[REGNO (tempreg)] >= 0 && ! already_saved[REGNO (tempreg)])
goto retry;
}
/* Emit a string of loads to restore the hard regs listed in
OFFSET[] from address ADDR; insert the loads after INSN.
OFFSET[reg] is -1 if reg should not be loaded, or a
suitably-aligned offset from ADDR.
The offsets actually used do not need to be those provided in
OFFSET, but should agree with whatever emit_mult_save does. */
static void
emit_mult_restore (insn, addr, offset)
rtx insn, addr;
int offset[];
{
int regno;
/* Number of regs now needing to be restored. */
int restore_count;
/* A register to use as a temporary for address calculations. */
rtx tempreg;
/* A register available for that purpose but less desirable. */
rtx maybe_tempreg;
/* A register that could be used as that temp if we push and pop it. */
rtx can_push_reg;
/* Nonzero means we need to push and pop a register to use it as TEMPREG. */
int needpush;
/* The amount the stack is decremented to save that register (if we do). */
int decrement;
/* Record which regs we restore, in case we branch to retry. */
char already_restored[FIRST_PSEUDO_REGISTER];
bzero (already_restored, sizeof already_restored);
/* Note: INSN can't be the last insn, since if it were,
no regs would live across it. */
insn = NEXT_INSN (insn);
if (insn == 0)
abort ();
/* Now we can insert before INSN.
That is convenient because we can insert them in the order
that they should ultimately appear. */
/* Hair is needed because sometimes the addresses to restore from are
not valid (offsets too big).
So we need a reg, TEMPREG, to compute addresses in.
We look first for an empty reg to use.
Sometimes no reg is empty. Then we push a reg, use it, and pop it.
If all the suitable regs need to be restored,
that strategy won't work. So we restore all but one, using that one
as a temporary. Then we jump to `retry' to restore that one,
pushing and popping another (already restored) as a temporary. */
retry:
needpush = 0;
tempreg = 0;
can_push_reg = 0;
restore_count = 0;
/* Set NEEDPUSH if any restore-addresses are not valid memory addresses.
If any register is available, record it in TEMPREG.
Otherwise, one register yet to be restored goes in MAYBE_TEMPREG,
and can be used as TEMPREG for any other regs to be restored.
If any register doesn't need restoring, record it in CAN_PUSH_REG. */
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
{
if (offset[regno] >= 0 && ! already_restored[regno])
{
rtx reg = save_reg_rtx[regno];
rtx addr1 = plus_constant (addr, offset[regno]);
restore_count++;
if (memory_address_p (GET_MODE (reg), addr1))
needpush = 1;
/* Find a call-clobbered reg that needs restoring.
We can use it as a temporary if we defer restoring it. */
if (maybe_tempreg == 0)
{
maybe_tempreg = gen_rtx (REG, Pmode, regno);
/* Don't use it if not valid for addressing. */
if (! strict_memory_address_p (QImode, maybe_tempreg))
maybe_tempreg = 0;
}
}
/* If any call-clobbered reg is dead, put it in TEMPREG.
It can be used as a temporary at no extra cost. */
if (tempreg == 0 && call_used_regs[regno] && ! fixed_regs[regno]
&& offset[regno] < 0
&& HARD_REGNO_MODE_OK (regno, Pmode))
{
tempreg = gen_rtx (REG, Pmode, regno);
/* Don't use it if not valid for addressing. */
if (! strict_memory_address_p (QImode, tempreg))
tempreg = 0;
}
/* Any non-call-clobbered reg, put in CAN_PUSH_REG.
It can be used as a temporary if we push and pop it. */
if (can_push_reg == 0 && ! call_used_regs[regno]
&& HARD_REGNO_MODE_OK (regno, Pmode))
{
can_push_reg = gen_rtx (REG, Pmode, regno);
/* Don't use it if not valid for addressing. */
if (! strict_memory_address_p (QImode, can_push_reg))
can_push_reg = 0;
}
/* Any reg we already restored can be a temporary
if we push and pop it. */
if (can_push_reg == 0 && already_restored[regno]
&& HARD_REGNO_MODE_OK (regno, Pmode))
{
can_push_reg = gen_rtx (REG, Pmode, regno);
/* Don't use it if not valid for addressing. */
if (! strict_memory_address_p (QImode, can_push_reg))
can_push_reg = 0;
}
}
/* If 2 or more regs need to be restored, use one as a temp reg
for the rest (if we need a tempreg). */
if (tempreg == 0 && maybe_tempreg != 0 && restore_count > 1)
tempreg = maybe_tempreg;
/* Clear NEEDPUSH if we already found an empty reg. */
if (tempreg != 0)
needpush = 0;
/* If we need a temp reg and none is free, make one free. */
if (needpush)
{
tempreg = can_push_reg;
/* Push it on the stack. */
#ifdef STACK_GROWS_DOWNWARD
decrement = UNITS_PER_WORD;
#else
decrement = - UNITS_PER_WORD;
#endif
emit_insn_before (gen_add2_insn (stack_pointer_rtx,
gen_rtx (CONST_INT, VOIDmode, -decrement)),
insn);
emit_insn_before (gen_move_insn (gen_rtx (MEM, Pmode, stack_pointer_rtx),
tempreg),
insn);
}
/* Restore the regs we are supposed to restore, aside from TEMPREG.
Use TEMPREG for address calculations when needed. */
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
if (offset[regno] >= 0 && ! already_restored[regno]
&& tempreg != 0 && REGNO (tempreg) != regno)
{
rtx reg = save_reg_rtx[regno];
rtx addr1 = plus_constant (addr, offset[regno]);
rtx temp;
if (! memory_address_p (GET_MODE (reg), addr1))
{
if (GET_CODE (addr1) != PLUS)
abort ();
if (GET_CODE (XEXP (addr1, 1)) != CONST_INT
|| GET_CODE (XEXP (addr1, 0)) != REG)
abort ();
emit_insn_before (gen_move_insn (tempreg, XEXP (addr1, 0)), insn);
emit_insn_before (gen_add2_insn (tempreg, XEXP (addr1, 1)), insn);
addr1 = tempreg;
}
temp = gen_rtx (MEM, GET_MODE (reg), addr1);
emit_insn_before (gen_move_insn (reg, temp), insn);
already_restored[regno] = 1;
}
/* If we pushed TEMPREG to make it free, pop it. */
if (needpush)
{
emit_insn_before (gen_move_insn (tempreg,
gen_rtx (MEM, Pmode, stack_pointer_rtx)),
insn);
emit_insn_before (gen_add2_insn (stack_pointer_rtx,
gen_rtx (CONST_INT, VOIDmode, decrement)),
insn);
}
/* If TEMPREG itself needs restoring, go back and restore it.
We can find a reg already restored to push and use as a temporary. */
if (tempreg != 0
&& offset[REGNO (tempreg)] >= 0 && ! already_restored[REGNO (tempreg)])
goto retry;
}
/* Return the address of a new block of size SIZE on the stack.
The old save block is at ADDR; ADDR is 0 if no block exists yet. */
static rtx
grow_save_block (addr, size)
rtx addr;
int size;
{
rtx newaddr;
/* Keep the size a multiple of the main allocation unit. */
size = (((size + (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1)
/ (BIGGEST_ALIGNMENT / BITS_PER_UNIT))
* (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
/* If no save block exists yet, create one and return it. */
if (! addr)
{
save_block_size = size;
return XEXP (assign_stack_local (BLKmode, size), 0);
}
/* Get a new block and coalesce it with the old one. */
newaddr = XEXP (assign_stack_local (BLKmode, size - save_block_size), 0);
if (GET_CODE (newaddr) == PLUS
&& XEXP (newaddr, 0) == frame_pointer_rtx
&& GET_CODE (XEXP (newaddr, 1)) == CONST_INT
&& GET_CODE (addr) == PLUS
&& XEXP (addr, 0) == frame_pointer_rtx
&& GET_CODE (XEXP (addr, 1)) == CONST_INT
&& ((INTVAL (XEXP (newaddr, 1)) - INTVAL (XEXP (addr, 1))
== size - save_block_size)
|| (INTVAL (XEXP (addr, 1)) - INTVAL (XEXP (newaddr, 1))
== size - save_block_size)))
{
save_block_size = size;
if (INTVAL (XEXP (newaddr, 1)) < INTVAL (XEXP (addr, 1)))
return newaddr;
else
return addr;
}
/* They didn't coalesce, find out why */
abort ();
save_block_size = size;
return XEXP (assign_stack_local (BLKmode, size), 0);
}
/* Return a machine mode that is legitimate for hard reg REGNO
and large enough to save the whole register. */
static enum machine_mode
choose_hard_reg_mode (regno)
int regno;
{
enum reg_class class = REGNO_REG_CLASS (regno);
if (CLASS_MAX_NREGS (class, DImode) == 1
&& HARD_REGNO_MODE_OK (regno, DImode))
return DImode;
else if (CLASS_MAX_NREGS (class, DFmode) == 1
&& HARD_REGNO_MODE_OK (regno, DFmode))
return DFmode;
else if (CLASS_MAX_NREGS (class, SImode) == 1
&& HARD_REGNO_MODE_OK (regno, SImode))
return SImode;
else if (CLASS_MAX_NREGS (class, SFmode) == 1
&& HARD_REGNO_MODE_OK (regno, SFmode))
return SFmode;
else if (CLASS_MAX_NREGS (class, HImode) == 1
&& HARD_REGNO_MODE_OK (regno, HImode))
return HImode;
else
abort ();
}

File diff suppressed because it is too large Load Diff

View File

@ -1,656 +0,0 @@
/* Parse C expressions for CCCP.
Copyright (C) 1987 Free Software Foundation.
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 1, 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, 675 Mass Ave, Cambridge, MA 02139, USA.
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding!
Adapted from expread.y of GDB by Paul Rubin, July 1986.
/* Parse a C expression from text in a string */
%{
#include "config.h"
#include <setjmp.h>
/* #define YYDEBUG 1 */
int yylex ();
void yyerror ();
int expression_value;
static jmp_buf parse_return_error;
/* some external tables of character types */
extern unsigned char is_idstart[], is_idchar[];
#ifndef CHAR_TYPE_SIZE
#define CHAR_TYPE_SIZE BITS_PER_UNIT
#endif
%}
%union {
struct constant {long value; int unsignedp;} integer;
int voidval;
char *sval;
}
%type <integer> exp exp1 start
%token <integer> INT CHAR
%token <sval> NAME
%token <integer> ERROR
%right '?' ':'
%left ','
%left OR
%left AND
%left '|'
%left '^'
%left '&'
%left EQUAL NOTEQUAL
%left '<' '>' LEQ GEQ
%left LSH RSH
%left '+' '-'
%left '*' '/' '%'
%right UNARY
/* %expect 40 */
%%
start : exp1
{ expression_value = $1.value; }
;
/* Expressions, including the comma operator. */
exp1 : exp
| exp1 ',' exp
{ $$ = $3; }
;
/* Expressions, not including the comma operator. */
exp : '-' exp %prec UNARY
{ $$.value = - $2.value;
$$.unsignedp = $2.unsignedp; }
| '!' exp %prec UNARY
{ $$.value = ! $2.value;
$$.unsignedp = 0; }
| '+' exp %prec UNARY
{ $$ = $2; }
| '~' exp %prec UNARY
{ $$.value = ~ $2.value;
$$.unsignedp = $2.unsignedp; }
| '(' exp1 ')'
{ $$ = $2; }
;
/* Binary operators in order of decreasing precedence. */
exp : exp '*' exp
{ $$.unsignedp = $1.unsignedp || $3.unsignedp;
if ($$.unsignedp)
$$.value = (unsigned) $1.value * $3.value;
else
$$.value = $1.value * $3.value; }
| exp '/' exp
{ if ($3.value == 0)
{
error ("division by zero in #if");
$3.value = 1;
}
$$.unsignedp = $1.unsignedp || $3.unsignedp;
if ($$.unsignedp)
$$.value = (unsigned) $1.value / $3.value;
else
$$.value = $1.value / $3.value; }
| exp '%' exp
{ if ($3.value == 0)
{
error ("division by zero in #if");
$3.value = 1;
}
$$.unsignedp = $1.unsignedp || $3.unsignedp;
if ($$.unsignedp)
$$.value = (unsigned) $1.value % $3.value;
else
$$.value = $1.value % $3.value; }
| exp '+' exp
{ $$.value = $1.value + $3.value;
$$.unsignedp = $1.unsignedp || $3.unsignedp; }
| exp '-' exp
{ $$.value = $1.value - $3.value;
$$.unsignedp = $1.unsignedp || $3.unsignedp; }
| exp LSH exp
{ $$.unsignedp = $1.unsignedp;
if ($$.unsignedp)
$$.value = (unsigned) $1.value << $3.value;
else
$$.value = $1.value << $3.value; }
| exp RSH exp
{ $$.unsignedp = $1.unsignedp;
if ($$.unsignedp)
$$.value = (unsigned) $1.value >> $3.value;
else
$$.value = $1.value >> $3.value; }
| exp EQUAL exp
{ $$.value = ($1.value == $3.value);
$$.unsignedp = 0; }
| exp NOTEQUAL exp
{ $$.value = ($1.value != $3.value);
$$.unsignedp = 0; }
| exp LEQ exp
{ $$.unsignedp = 0;
if ($1.unsignedp || $3.unsignedp)
$$.value = (unsigned) $1.value <= $3.value;
else
$$.value = $1.value <= $3.value; }
| exp GEQ exp
{ $$.unsignedp = 0;
if ($1.unsignedp || $3.unsignedp)
$$.value = (unsigned) $1.value >= $3.value;
else
$$.value = $1.value >= $3.value; }
| exp '<' exp
{ $$.unsignedp = 0;
if ($1.unsignedp || $3.unsignedp)
$$.value = (unsigned) $1.value < $3.value;
else
$$.value = $1.value < $3.value; }
| exp '>' exp
{ $$.unsignedp = 0;
if ($1.unsignedp || $3.unsignedp)
$$.value = (unsigned) $1.value > $3.value;
else
$$.value = $1.value > $3.value; }
| exp '&' exp
{ $$.value = $1.value & $3.value;
$$.unsignedp = $1.unsignedp || $3.unsignedp; }
| exp '^' exp
{ $$.value = $1.value ^ $3.value;
$$.unsignedp = $1.unsignedp || $3.unsignedp; }
| exp '|' exp
{ $$.value = $1.value | $3.value;
$$.unsignedp = $1.unsignedp || $3.unsignedp; }
| exp AND exp
{ $$.value = ($1.value && $3.value);
$$.unsignedp = 0; }
| exp OR exp
{ $$.value = ($1.value || $3.value);
$$.unsignedp = 0; }
| exp '?' exp ':' exp
{ $$.value = $1.value ? $3.value : $5.value;
$$.unsignedp = $3.unsignedp || $5.unsignedp; }
| INT
{ $$ = yylval.integer; }
| CHAR
{ $$ = yylval.integer; }
| NAME
{ $$.value = 0;
$$.unsignedp = 0; }
;
%%
/* During parsing of a C expression, the pointer to the next character
is in this variable. */
static char *lexptr;
/* Take care of parsing a number (anything that starts with a digit).
Set yylval and return the token type; update lexptr.
LEN is the number of characters in it. */
/* maybe needs to actually deal with floating point numbers */
int
parse_number (olen)
int olen;
{
register char *p = lexptr;
register long n = 0;
register int c;
register int base = 10;
register int len = olen;
for (c = 0; c < len; c++)
if (p[c] == '.') {
/* It's a float since it contains a point. */
yyerror ("floating point numbers not allowed in #if expressions");
return ERROR;
}
yylval.integer.unsignedp = 0;
if (len >= 3 && (!strncmp (p, "0x", 2) || !strncmp (p, "0X", 2))) {
p += 2;
base = 16;
len -= 2;
}
else if (*p == '0')
base = 8;
while (len > 0) {
c = *p++;
len--;
if (c >= 'A' && c <= 'Z') c += 'a' - 'A';
if (c >= '0' && c <= '9') {
n *= base;
n += c - '0';
} else if (base == 16 && c >= 'a' && c <= 'f') {
n *= base;
n += c - 'a' + 10;
} else {
/* `l' means long, and `u' means unsigned. */
while (1) {
if (c == 'l' || c == 'L')
;
else if (c == 'u' || c == 'U')
yylval.integer.unsignedp = 1;
else
break;
if (len == 0)
break;
c = *p++;
len--;
}
/* Don't look for any more digits after the suffixes. */
break;
}
}
if (len != 0) {
yyerror ("Invalid number in #if expression");
return ERROR;
}
/* If too big to be signed, consider it unsigned. */
if (n < 0)
yylval.integer.unsignedp = 1;
lexptr = p;
yylval.integer.value = n;
return INT;
}
struct token {
char *operator;
int token;
};
#ifndef NULL
#define NULL 0
#endif
static struct token tokentab2[] = {
{"&&", AND},
{"||", OR},
{"<<", LSH},
{">>", RSH},
{"==", EQUAL},
{"!=", NOTEQUAL},
{"<=", LEQ},
{">=", GEQ},
{NULL, ERROR}
};
/* Read one token, getting characters through lexptr. */
int
yylex ()
{
register int c;
register int namelen;
register char *tokstart;
register struct token *toktab;
retry:
tokstart = lexptr;
c = *tokstart;
/* See if it is a special token of length 2. */
for (toktab = tokentab2; toktab->operator != NULL; toktab++)
if (c == *toktab->operator && tokstart[1] == toktab->operator[1]) {
lexptr += 2;
return toktab->token;
}
switch (c) {
case 0:
return 0;
case ' ':
case '\t':
case '\r':
case '\n':
lexptr++;
goto retry;
case '\'':
lexptr++;
c = *lexptr++;
if (c == '\\')
c = parse_escape (&lexptr);
/* Sign-extend the constant if chars are signed on target machine. */
{
if (lookup ("__CHAR_UNSIGNED__", sizeof ("__CHAR_UNSIGNED__")-1, -1)
|| ((c >> (CHAR_TYPE_SIZE - 1)) & 1) == 0)
yylval.integer.value = c & ((1 << CHAR_TYPE_SIZE) - 1);
else
yylval.integer.value = c | ~((1 << CHAR_TYPE_SIZE) - 1);
}
yylval.integer.unsignedp = 0;
c = *lexptr++;
if (c != '\'') {
yyerror ("Invalid character constant in #if");
return ERROR;
}
return CHAR;
/* some of these chars are invalid in constant expressions;
maybe do something about them later */
case '/':
case '+':
case '-':
case '*':
case '%':
case '|':
case '&':
case '^':
case '~':
case '!':
case '@':
case '<':
case '>':
case '(':
case ')':
case '[':
case ']':
case '.':
case '?':
case ':':
case '=':
case '{':
case '}':
case ',':
lexptr++;
return c;
case '"':
yyerror ("double quoted strings not allowed in #if expressions");
return ERROR;
}
if (c >= '0' && c <= '9') {
/* It's a number */
for (namelen = 0;
c = tokstart[namelen], is_idchar[c] || c == '.';
namelen++)
;
return parse_number (namelen);
}
if (!is_idstart[c]) {
yyerror ("Invalid token in expression");
return ERROR;
}
/* It is a name. See how long it is. */
for (namelen = 0; is_idchar[tokstart[namelen]]; namelen++)
;
lexptr += namelen;
return NAME;
}
/* Parse a C escape sequence. STRING_PTR points to a variable
containing a pointer to the string to parse. That pointer
is updated past the characters we use. The value of the
escape sequence is returned.
A negative value means the sequence \ newline was seen,
which is supposed to be equivalent to nothing at all.
If \ is followed by a null character, we return a negative
value and leave the string pointer pointing at the null character.
If \ is followed by 000, we return 0 and leave the string pointer
after the zeros. A value of 0 does not mean end of string. */
int
parse_escape (string_ptr)
char **string_ptr;
{
register int c = *(*string_ptr)++;
switch (c)
{
case 'a':
return TARGET_BELL;
case 'b':
return TARGET_BS;
case 'e':
return 033;
case 'f':
return TARGET_FF;
case 'n':
return TARGET_NEWLINE;
case 'r':
return TARGET_CR;
case 't':
return TARGET_TAB;
case 'v':
return TARGET_VT;
case '\n':
return -2;
case 0:
(*string_ptr)--;
return 0;
case '^':
c = *(*string_ptr)++;
if (c == '\\')
c = parse_escape (string_ptr);
if (c == '?')
return 0177;
return (c & 0200) | (c & 037);
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
{
register int i = c - '0';
register int count = 0;
while (++count < 3)
{
c = *(*string_ptr)++;
if (c >= '0' && c <= '7')
i = (i << 3) + c - '0';
else
{
(*string_ptr)--;
break;
}
}
if ((i & ~((1 << CHAR_TYPE_SIZE) - 1)) != 0)
{
i &= (1 << CHAR_TYPE_SIZE) - 1;
warning ("octal character constant does not fit in a byte");
}
return i;
}
case 'x':
{
register int i = 0;
register int count = 0;
for (;;)
{
c = *(*string_ptr)++;
if (c >= '0' && c <= '9')
i = (i << 4) + c - '0';
else if (c >= 'a' && c <= 'f')
i = (i << 4) + c - 'a' + 10;
else if (c >= 'A' && c <= 'F')
i = (i << 4) + c - 'A' + 10;
else
{
(*string_ptr)--;
break;
}
}
if ((i & ~((1 << BITS_PER_UNIT) - 1)) != 0)
{
i &= (1 << BITS_PER_UNIT) - 1;
warning ("hex character constant does not fit in a byte");
}
return i;
}
default:
return c;
}
}
void
yyerror (s)
char *s;
{
error (s);
longjmp (parse_return_error, 1);
}
/* This page contains the entry point to this file. */
/* Parse STRING as an expression, and complain if this fails
to use up all of the contents of STRING. */
/* We do not support C comments. They should be removed before
this function is called. */
int
parse_c_expression (string)
char *string;
{
lexptr = string;
if (lexptr == 0 || *lexptr == 0) {
error ("empty #if expression");
return 0; /* don't include the #if group */
}
/* if there is some sort of scanning error, just return 0 and assume
the parsing routine has printed an error message somewhere.
there is surely a better thing to do than this. */
if (setjmp (parse_return_error))
return 0;
if (yyparse ())
return 0; /* actually this is never reached
the way things stand. */
if (*lexptr)
error ("Junk after end of expression.");
return expression_value; /* set by yyparse () */
}
#ifdef TEST_EXP_READER
/* main program, for testing purposes. */
main ()
{
int n, c;
char buf[1024];
extern int yydebug;
/*
yydebug = 1;
*/
initialize_random_junk ();
for (;;) {
printf ("enter expression: ");
n = 0;
while ((buf[n] = getchar ()) != '\n' && buf[n] != EOF)
n++;
if (buf[n] == EOF)
break;
buf[n] = '\0';
printf ("parser returned %d\n", parse_c_expression (buf));
}
}
/* table to tell if char can be part of a C identifier. */
unsigned char is_idchar[256];
/* table to tell if char can be first char of a c identifier. */
unsigned char is_idstart[256];
/* table to tell if c is horizontal space. isspace () thinks that
newline is space; this is not a good idea for this program. */
char is_hor_space[256];
/*
* initialize random junk in the hash table and maybe other places
*/
initialize_random_junk ()
{
register int i;
/*
* Set up is_idchar and is_idstart tables. These should be
* faster than saying (is_alpha (c) || c == '_'), etc.
* Must do set up these things before calling any routines tthat
* refer to them.
*/
for (i = 'a'; i <= 'z'; i++) {
++is_idchar[i - 'a' + 'A'];
++is_idchar[i];
++is_idstart[i - 'a' + 'A'];
++is_idstart[i];
}
for (i = '0'; i <= '9'; i++)
++is_idchar[i];
++is_idchar['_'];
++is_idstart['_'];
#if DOLLARS_IN_IDENTIFIERS
++is_idchar['$'];
++is_idstart['$'];
#endif
/* horizontal space table */
++is_hor_space[' '];
++is_hor_space['\t'];
}
error (msg)
{
printf ("error: %s\n", msg);
}
warning (msg)
{
printf ("warning: %s\n", msg);
}
struct hashnode *
lookup (name, len, hash)
char *name;
int len;
int hash;
{
return (DEFAULT_SIGNED_CHAR) ? 0 : ((struct hashnode *) -1);
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,122 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Definitions for condition code handling in final.c and output routines.
Copyright (C) 1987 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* The variable cc_status says how to interpret the condition code.
It is set by output routines for an instruction that sets the cc's
and examined by output routines for jump instructions.
cc_status contains two components named `value1' and `value2'
that record two equivalent expressions for the values that the
condition codes were set from. (Either or both may be null if
there is no useful expression to record.) These fields are
used for eliminating redundant test and compare instructions
in the cases where the condition codes were already set by the
previous instruction.
cc_status.flags contains flags which say that the condition codes
were set in a nonstandard manner. The output of jump instructions
uses these flags to compensate and produce the standard result
with the nonstandard condition codes. Standard flags are defined here.
The tm- file can also define other machine-dependent flags.
cc_status also contains a machine-dependent component `mdep'
whose type, `CC_STATUS_MDEP', may be defined as a macro in the
tm- file. */
#ifndef CC_STATUS_MDEP
#define CC_STATUS_MDEP int
#endif
#ifndef CC_STATUS_MDEP_INIT
#define CC_STATUS_MDEP_INIT 0
#endif
typedef struct {int flags; rtx value1, value2; CC_STATUS_MDEP mdep;} CC_STATUS;
/* While outputting an insn as assembler code,
this is the status BEFORE that insn. */
extern CC_STATUS cc_prev_status;
/* While outputting an insn as assembler code,
this is being altered to the status AFTER that insn. */
extern CC_STATUS cc_status;
/* These are the machine-independent flags: */
/* Set if the sign of the cc value is inverted:
output a following jump-if-less as a jump-if-greater, etc. */
#define CC_REVERSED 1
/* This bit means that the current setting of the N bit is bogus
and conditional jumps should use the Z bit in its place.
This state obtains when an extraction of a signed single-bit field
or an arithmetic shift right of a byte by 7 bits
is turned into a btst, because btst does not set the N bit. */
#define CC_NOT_POSITIVE 2
/* This bit means that the current setting of the N bit is bogus
and conditional jumps should pretend that the N bit is clear.
Used after extraction of an unsigned bit
or logical shift right of a byte by 7 bits is turned into a btst.
The btst does not alter the N bit, but the result of that shift
or extract is never negative. */
#define CC_NOT_NEGATIVE 4
/* This bit means that the current setting of the overflow flag
is bogus and conditional jumps should pretend there is no overflow. */
#define CC_NO_OVERFLOW 010
/* This bit means that what ought to be in the Z bit
should be tested as the complement of the N bit. */
#define CC_Z_IN_NOT_N 020
/* This bit means that what ought to be in the Z bit
should be tested as the N bit. */
#define CC_Z_IN_N 040
/* This is how to initialize the variable cc_status.
final does this at appropriate moments. */
#define CC_STATUS_INIT \
(cc_status.flags = 0, cc_status.value1 = 0, cc_status.value2 = 0, \
CC_STATUS_MDEP_INIT)

View File

@ -1,26 +0,0 @@
$ !
$ ! Set up to compile GCC on VMS
$ !
$ echo = "write sys$output"
$ !
$ if f$search("config.h") .nes. "" then delete config.h.*
$ copy [.config]xm-vms.h []config.h
$ echo "Linked `config.h' to `[.config]xm-vms.h'.
$ !
$ if f$search("tm.h") .nes. "" then delete tm.h.*
$ copy [.config]tm-vms.h []tm.h
$ echo "Linked `tm.h' to `[.config]tm-vms.h'.
$ !
$ if f$search("md.") .nes. "" then delete md..*
$ copy [.config]vax.md []md.
$ echo "Linked `md' to `[.config]vax.md'.
$ !
$ if f$search("aux-output.c") .nes. "" then delete aux-output.c.*
$ copy [.config]out-vax.c []aux-output.c
$ echo "Linked `aux-output.c' to `[.config]out-vax.c'.
$ !
$ if f$search("config.status") .nes. "" then delete config.status.*
$ open/write file config.status
$ write file "Links are now set up for use with a vax running VMS."
$ close file
$ type config.status

View File

@ -1,440 +0,0 @@
#!/bin/sh
# Configuration script for GNU CC
# Copyright (C) 1988 Free Software Foundation, Inc.
#This file is part of GNU CC.
#GNU CC 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 1, or (at your option)
#any later version.
#GNU CC 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 GNU CC; see the file COPYING. If not, write to
#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Shell script to create proper links to machine-dependent files in
# preparation for compiling gcc.
#
# Usage: config.gcc [vint] [-srcdir=DIR] machine
#
# If config.gcc succeeds, it leaves its status in config.status.
# If config.gcc fails after disturbing the status quo,
# config.status is removed.
#
progname=$0
remove=rm
hard_link=ln
symbolic_link='ln -s'
#for Test
#remove="echo rm"
#hard_link="echo ln"
#symbolic_link="echo ln -s"
for arg in $*;
do
case $arg in
-srcdir=*)
srcdir=`echo $arg | sed s/-srcdir=//`
;;
-vint)
vint=on
;;
*)
machine=$arg
;;
esac
done
# Find the source files, if location was not specified.
if [ x$srcdir = x ]
then
srcdirdefaulted=1
srcdir=.
if [ ! -r tree.c ]
then
srcdir=..
fi
fi
if [ ! -r ${srcdir}/tree.c ]
then
if [ x$srcdirdefaulted = x ]
then
echo "$progname: Can't find compiler sources in \`${srcdir}'." 1>&2
else
echo "$progname: Can't find compiler sources in \`.' or \`..'." 1>&2
fi
exit 1
fi
if [ x$machine != x ];
then
case $machine in
vax) # for vaxen running bsd
;;
ultrix) # for vaxen running ultrix
cpu_type=vax
;;
tahoe) # for tahoe's running bsd
;;
harris) # for harris tahoe, using COFF.
cpu_type=tahoe
;;
vms) # for vaxen running VMS
cpu_type=vax
configuration_file=xm-${machine}.h
target_machine=tm-${machine}.h
;;
vax-sysv | vaxv) # for vaxen running system V
cpu_type=vax
configuration_file=xm-vaxv.h
target_machine=tm-vaxv.h
;;
sequent-i386) # for Intel 80386's on Sequent Symmetry
cpu_type=i386
configuration_file=xm-i386.h
target_machine=tm-seq386.h
;;
fmtowns)
cpu_type=i386
configuration_file=xm-i386.h
target_machine=tm-fmtowns.h
;;
i386-mach)
cpu_type=i386
configuration_file=xm-i386.h
target_machine=tm-i386gas.h
;;
i386-sysv | i386v) # for Intel 80386's running system V
machine=i386v
cpu_type=i386
configuration_file=xm-${machine}.h
;;
i386-sysv4 | i386v4) # for Intel 80386's running system V.4
machine=i386v4
cpu_type=i386
configuration_file=xm-i386v.h
;;
i386-sysv-gas | i386g)
cpu_type=i386
configuration_file=xm-i386v.h
target_machine=tm-i386vgas.h
;;
i386-sco) # for Intel 80386's running SCO system
machine=i386sco
cpu_type=i386
configuration_file=xm-i386v.h
;;
i386-esix) # for Intel 80386's running ESIX system
machine=i386esix
cpu_type=i386
configuration_file=xm-i386v.h
;;
i386-isc) # for Intel 80386's running ISC
machine=i386isc
cpu_type=i386
configuration_file=xm-i386v.h
;;
i386-aix | ps2-aix | aix386 | ps2aix ) # for IBM PS/2 running AIX
machine=aix386
cpu_type=i386
configuration_file=xm-${machine}.h
;;
i860)
;;
i860-gas)
machine=i860
target_machine=tm-i860g.h
;;
next )
cpu_type=m68k
target_machine=tm-next.h
;;
sun4-os3 | sun-4-os3)
cpu_type=sparc
target_machine=tm-sun4os3.h
;;
sun3-os3 | sun-3-os3)
cpu_type=m68k
target_machine=tm-sun3os3.h
;;
sun3-nfp-os3 | sun-3-nfp-os3)
cpu_type=m68k
target_machine=tm-sun3os3nf.h
;;
sun3-mach)
cpu_type=m68k
target_machine=tm-sun3mach.h
;;
sun2 | sun-2 | sun2-os3 | sun-2-os3)
cpu_type=m68k
target_machine=tm-sun2.h
;;
sun2-os4 | sun-2-os4)
cpu_type=m68k
target_machine=tm-sun2os4.h
;;
sun386 | sun386i | roadrunner)
cpu_type=i386
configuration_file=xm-sun386i.h
target_machine=tm-sun386i.h
;;
sun4 | sun-4 | sun4-os4 | sun-4-os4)
cpu_type=sparc
target_machine=tm-sparc.h
;;
sun3 | sun-3 | sun3-os4 | sun-3-os4)
cpu_type=m68k
target_machine=tm-sun3.h
;;
sun3-nfp | sun-3-nfp | sun3-nfp-os4 | sun-3-nfp-os4)
cpu_type=m68k
target_machine=tm-sun3-nfp.h
;;
sun2-os4 |sun-2-os4)
cpu_type=m68k
target_machine=tm-sun2.h
;;
hp9k320) # HP 9000 series 300 with gcc alone
cpu_type=m68k
configuration_file=xm-hp9k320.h
;;
hp9k320-old) # HP 9000 series 300 with gcc alone
cpu_type=m68k
target_machine=tm-hp9k32old.h
configuration_file=xm-hp9k320.h
;;
hp9k320-gas | hp9k320g) # with gnu as, ld and gdb
cpu_type=m68k
configuration_file=xm-hp9k320.h
target_machine=tm-hp9k320g.h
;;
hp9k320-bsd) # HP 9000/3xx running Berkeley Unix
cpu_type=m68k
target_machine=tm-hp9k3bsd.h
;;
hp9k200-bsd) # HP 9000/2xx running Berkeley Unix
cpu_type=m68k
target_machine=tm-hp9k2bsd.h
;;
isi68)
cpu_type=m68k
;;
isi68-nfp)
cpu_type=m68k
;;
news | news800)
configuration_file=xm-m68k.h
target_machine=tm-news.h
cpu_type=m68k
;;
news-gas | news-g)
configuration_file=xm-m68k.h
target_machine=tm-newsgas.h
cpu_type=m68k
;;
altos | altos3068) # Altos 3068 with gnu as, ld and gdb
cpu_type=m68k
configuration_file=xm-altos3068.h
target_machine=tm-altos3068.h
;;
3b1)
cpu_type=m68k
configuration_file=xm-${machine}.h
;;
3b1g | 3b1-gas)
machine=3b1g
cpu_type=m68k
configuration_file=xm-3b1.h
;;
delta68k | motorola-3300 | delta)
cpu_type=m68k
configuration_file=xm-delta68k.h
target_machine=tm-delta68k.h
;;
sequent-ns32k | sequent)
machine=sequent
cpu_type=ns32k
;;
encore)
cpu_type=ns32k
;;
genix)
target_machine=tm-genix.h
machine=ns32k
cpu_type=ns32k
configuration_file=xm-genix.h
;;
88000)
cpu_type=m88k
target_machine=tm-${cpu_type}.h
;;
alliant) # Alliant FX/8
;;
convex-c1) # Convex C1
if [ -r /usr/include/stdlib.h ]
then
target_machine=tm-convex1.h
else
target_machine=tm-conv1os7.h
fi
cpu_type=convex
;;
convex-c2) # Convex C2
if [ -r /usr/include/stdlib.h ]
then
target_machine=tm-convex2.h
else
target_machine=tm-conv2os7.h
fi
cpu_type=convex
;;
iris) # Mostly like a MIPS.
cpu_type=mips
target_machine=tm-iris.h
configuration_file=xm-iris.h
;;
mips) # Default MIPS environment
;;
mips-os5) # SYSV variant of MIPS system.
cpu_type=mips
target_machine=tm-mips-5.h
;;
mips-os4) # Default MIPS environment on RISC-OS 4.00
cpu_type=mips
;;
mips-sysv-os5) # SYSV variant of MIPS system, RISC-OS 5.00
cpu_type=mips
target_machine=tm-mips-5s.h
configuration_file=xm-umips.h
;;
mips-bsd43-os5) # BSD 4.3 variant of MIPS system, RISC-OS 5.00
cpu_type=mips
target_machine=tm-mips-5b.h
;;
mips-sysv | mips-sysv-os4) # SYSV variant of MIPS system, RISC-OS 4.00
cpu_type=mips
target_machine=tm-mips-sysv.h
configuration_file=xm-umips.h
;;
mips-bsd43 | mips-bsd43-os4) # BSD 4.3 variant of MIPS system, RISC-OS 4.00
cpu_type=mips
target_machine=tm-mips-bsd.h
;;
mips-news | news-3600 | risc-news) # Sony NEWS 3600 or risc/news.
cpu_type=mips
target_machine=tm-mips-news.h
;;
dec-3100 | decstation) # Decstation or pmax.
cpu_type=mips
target_machine=tm-decstatn.h
;;
apollo68)
cpu_type=m68k
;;
tower) # NCR Tower 32 SVR3. as with sdb debugging.
cpu_type=m68k
target_machine=tm-tower-as.h
configuration_file=xm-tower.h
;;
pyr | pyramid)
machine=pyr
;;
# 370)
# machine=370
# ;;
esac
# if cpu_type is not set, define cpu_type to machine.
#
cpu_type=${cpu_type-$machine}
configuration_file=${configuration_file-xm-$cpu_type.h}
target_machine=${target_machine-tm-$machine.h}
machine_description=${cpu_type}.md
aux_output=${aux_output-out-$cpu_type.c}
if [ xx${vint} = xx ]
then
files="$configuration_file $target_machine
$machine_description $aux_output"
links="config.h tm.h md aux-output.c"
else
files="$configuration_file tm-vmc.h $target_machine
$machine_description $aux_output"
links="config.h tm.h tm-pre.h md aux-output.c"
fi
while [ -n "$files" ]
do
# set file to car of files, files to cdr of files
set $files; file=$1; shift; files=$*
set $links; link=$1; shift; links=$*
if [ ! -r ${srcdir}/config/$file ]
then
echo "$progname: cannot create a link \`$link'," 1>&2
echo "since the file \`config/$file' does not exist." 1>&2
exit 1
fi
$remove -f $link
rm -f config.status
# Make a symlink if possible, otherwise try a hard link
$symbolic_link ${srcdir}/config/$file $link 2>/dev/null || $hard_link ${srcdir}/config/$file $link
if [ ! -r $link ]
then
echo "$progname: unable to link \`$link' to \`${srcdir}/config/$file'." 1>&2
exit 1
fi
echo "Linked \`$link' to \`${srcdir}/config/$file'."
done
if [ xx${vint} = xx ]
then
echo "Links are now set up for use with a $machine." \
| tee config.status
else
echo "Links are now set up for use with a $machine (vint)." \
| tee config.status
fi
# Install a makefile, and make it set VPATH
# if necessary so that the sources are found.
# Also change its value of srcdir.
# Also create a .gdbinit file which runs the one in srcdir
# and tells GDB to look there for source files.
case $srcdir in
.)
;;
*)
echo "VPATH = ${srcdir}" > x
cat x ${srcdir}/Makefile | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile
rm x
echo "dir ." > .gdbinit
echo "dir ${srcdir}" >> .gdbinit
echo "source ${srcdir}/.gdbinit" >> .gdbinit
;;
esac
exit 0
else
echo "Usage: $progname machine"
echo -n "Where \`machine' is something like "
echo "\`vax', \`sun3', \`encore', etc."
if [ -r config.status ]
then
cat config.status
fi
exit 1
fi

View File

@ -1,59 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Description de la machine virtuelle
*
* Ecrit par Arnaud COMPAN & Francois PECHEUX ** avril-juin 1990
*
*/
#define MY_SUN
#define FALSE 0
#define TRUE 1
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
#define HOST_BITS_PER_INT 32
#define HOST_BITS_PER_LONG 32
#define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 33
#ifdef MY_SUN
#define USG
#endif
#include "tm.h"
#ifdef MY_SUN
#define bcopy(a,b,c) memcpy (b,a,c)
#define bzero(a,b) memset (a,0,b)
#define bcmp(a,b,c) memcmp (a,b,c)
#endif
#ifdef __GNUC__
#define alloca(n) __builtin_alloca(n)
#endif

View File

@ -1 +0,0 @@
Links are now set up for use with a mu.

View File

@ -1,869 +0,0 @@
;; -------------------------------------------------------------
;;
;; Description de la machine universelle
;;
;;
;; Ecrit par Arnaud COMPAN & Francois PECHEUX ** avril-juin 1990
;; Quelques modifs par Frederic Petrot, 91/92
;; -------------------------------------------------------------
(define_insn "cmpqi"
[(set (cc0)
(compare (match_operand:QI 0 "general_operand" "g")
(match_operand:QI 1 "general_operand" "g")))]
""
"cmp.qi %0,%1")
(define_insn "cmphi"
[(set (cc0)
(compare (match_operand:HI 0 "general_operand" "g")
(match_operand:HI 1 "general_operand" "g")))]
""
"cmp.hi %0,%1")
(define_insn "cmpsi"
[(set (cc0)
(compare (match_operand:SI 0 "general_operand" "g")
(match_operand:SI 1 "general_operand" "g")))]
""
"cmp.si %0,%1")
(define_insn "cmpsf"
[(set (cc0)
(compare (match_operand:SF 0 "general_operand" "g")
(match_operand:SF 1 "general_operand" "g")))]
""
"cmp.sf %0,%1")
(define_insn "cmpdf"
[(set (cc0)
(compare (match_operand:DF 0 "general_operand" "g")
(match_operand:DF 1 "general_operand" "g")))]
""
"cmp.df %0,%1")
(define_insn "tstqi"
[(set (cc0)
(match_operand:QI 0 "general_operand" "g"))]
""
"cmp.qi %0,#0")
(define_insn "tsthi"
[(set (cc0)
(match_operand:HI 0 "general_operand" "g"))]
""
"cmp.hi %0,#0")
(define_insn "tstsi"
[(set (cc0)
(match_operand:SI 0 "general_operand" "g"))]
""
"cmp.si %0,#0")
(define_insn "tstsf"
[(set (cc0)
(match_operand:SF 0 "general_operand" "g"))]
""
"cmp.sf %0,#0")
(define_insn "tstdf"
[(set (cc0)
(match_operand:DF 0 "general_operand" "g"))]
""
"cmp.df %0,#0")
(define_insn "movqi"
[(set (match_operand:QI 0 "general_operand" "=g")
(match_operand:QI 1 "general_operand" "g"))]
""
"mov.qi %0,%1")
(define_insn "movhi"
[(set (match_operand:HI 0 "general_operand" "=g")
(match_operand:HI 1 "general_operand" "g"))]
""
"mov.hi %0,%1")
(define_insn "movsi"
[(set (match_operand:SI 0 "general_operand" "=g")
(match_operand:SI 1 "general_operand" "g"))]
""
"mov.si %0,%1")
(define_insn "movsf"
[(set (match_operand:SF 0 "general_operand" "=g")
(match_operand:SF 1 "general_operand" "g"))]
""
"mov.sf %0,%1")
(define_insn "movdf"
[(set (match_operand:DF 0 "general_operand" "=g")
(match_operand:DF 1 "general_operand" "g"))]
""
"mov.df %0,%1")
(define_insn "extendqihi2"
[(set (match_operand:HI 0 "general_operand" "=g")
(sign_extend:HI
(match_operand:QI 1 "general_operand" "g")))]
""
"ext.qi.hi %1,%0")
(define_insn "extendqisi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(sign_extend:SI
(match_operand:QI 1 "general_operand" "g")))]
""
"ext.qi.si %1,%0")
(define_insn "extendhisi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(sign_extend:SI
(match_operand:HI 1 "general_operand" "g")))]
""
"ext.hi.si %1,%0")
(define_insn "zero_extendhisi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(zero_extend:SI
(match_operand:HI 1 "general_operand" "g")))]
""
"ext0.hi.si %1,%0")
(define_insn "zero_extendqihi2"
[(set (match_operand:HI 0 "general_operand" "=g")
(zero_extend:HI
(match_operand:QI 1 "general_operand" "g")))]
""
"ext0.qi.hi %1,%0")
(define_insn "zero_extendqisi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(zero_extend:SI
(match_operand:QI 1 "general_operand" "g")))]
""
"ext0.qi.si %1,%0")
(define_insn "extendsfdf2"
[(set (match_operand:DF 0 "general_operand" "=g")
(float_extend:DF
(match_operand:SF 1 "general_operand" "g")))]
""
"ext.sf.df %1,%0")
(define_insn "truncsiqi2"
[(set (match_operand:QI 0 "general_operand" "=g")
(truncate:QI
(match_operand:SI 1 "general_operand" "g")))]
""
"trunc.si.qi %1,%0")
(define_insn "truncsihi2"
[(set (match_operand:HI 0 "general_operand" "=g")
(truncate:HI
(match_operand:SI 1 "general_operand" "g")))]
""
"trunc.si.hi %1,%0")
(define_insn "trunchiqi2"
[(set (match_operand:QI 0 "general_operand" "=g")
(truncate:QI
(match_operand:HI 1 "general_operand" "g")))]
""
"trunc.hi.qi %1,%0")
(define_insn "truncdfsf2"
[(set (match_operand:SF 0 "general_operand" "=g")
(float_truncate:SF
(match_operand:DF 1 "general_operand" "g")))]
""
"trunc.df.sf %1,%0")
(define_insn "floatqisf2"
[(set (match_operand:SF 0 "general_operand" "=g")
(float:SF (match_operand:QI 1 "general_operand" "g")))]
""
"float.qi.sf %1,%0")
(define_insn "floathisf2"
[(set (match_operand:SF 0 "general_operand" "=g")
(float:SF (match_operand:HI 1 "general_operand" "g")))]
""
"float.hi.sf %1,%0")
(define_insn "floatsisf2"
[(set (match_operand:SF 0 "general_operand" "=g")
(float:SF (match_operand:SI 1 "general_operand" "g")))]
""
"float.si.sf %1,%0")
(define_insn "floatqidf2"
[(set (match_operand:DF 0 "general_operand" "=g")
(float:DF (match_operand:QI 1 "general_operand" "g")))]
""
"float.qi.df %1,%0")
(define_insn "floathidf2"
[(set (match_operand:DF 0 "general_operand" "=g")
(float:DF (match_operand:HI 1 "general_operand" "g")))]
""
"float.hi.df %1,%0")
(define_insn "floatsidf2"
[(set (match_operand:DF 0 "general_operand" "=g")
(float:DF (match_operand:SI 1 "general_operand" "g")))]
""
"float.si.df %1,%0")
(define_insn "fix_truncsfqi2"
[(set (match_operand:QI 0 "general_operand" "=g")
(fix:QI (fix:SF (match_operand:SF 1 "general_operand" "g"))))]
""
"fix_trunc.sf.qi %1,%0")
(define_insn "fix_truncsfhi2"
[(set (match_operand:HI 0 "general_operand" "=g")
(fix:HI (fix:SF (match_operand:SF 1 "general_operand" "g"))))]
""
"fix_trunc.sf.hi %1,%0")
(define_insn "fix_truncsfsi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(fix:SI (fix:SF (match_operand:SF 1 "general_operand" "g"))))]
""
"fix_trunc.sf.si %1,%0")
(define_insn "fix_truncdfqi2"
[(set (match_operand:QI 0 "general_operand" "=g")
(fix:QI (fix:DF (match_operand:DF 1 "general_operand" "g"))))]
""
"fix_trunc.df.qi %1,%0")
(define_insn "fix_truncdfhi2"
[(set (match_operand:HI 0 "general_operand" "=g")
(fix:HI (fix:DF (match_operand:DF 1 "general_operand" "g"))))]
""
"fix_trunc.df.hi %1,%0")
(define_insn "fix_truncdfsi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(fix:SI (fix:DF (match_operand:DF 1 "general_operand" "g"))))]
""
"fix_trunc.df.si %1,%0")
(define_insn "fixunssfqi2"
[(set (match_operand:QI 0 "general_operand" "=g")
(unsigned_fix:QI (fix:SF (match_operand:SF 1 "general_operand" "g"))))]
""
"fixuns.sf.qi %1,%0")
(define_insn "fixunssfhi2"
[(set (match_operand:HI 0 "general_operand" "=g")
(unsigned_fix:HI (fix:SF (match_operand:SF 1 "general_operand" "g"))))]
""
"fixuns.sf.hi %1,%0")
(define_insn "fixunssfsi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(unsigned_fix:SI (fix:SF (match_operand:SF 1 "general_operand" "g"))))]
""
"fixuns.sf.si %1,%0")
(define_insn "fixunsdfqi2"
[(set (match_operand:QI 0 "general_operand" "=g")
(unsigned_fix:QI (fix:DF (match_operand:DF 1 "general_operand" "g"))))]
""
"fixuns.df.qi %1,%0")
(define_insn "fixunsdfhi2"
[(set (match_operand:HI 0 "general_operand" "=g")
(unsigned_fix:HI (fix:DF (match_operand:DF 1 "general_operand" "g"))))]
""
"fixuns.df.hi %1,%0")
(define_insn "fixunsdfsi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(unsigned_fix:SI (fix:DF (match_operand:DF 1 "general_operand" "g"))))]
""
"fixuns.df.si %1,%0")
(define_insn "addqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(plus:QI (match_operand:QI 1 "general_operand" "%g")
(match_operand:QI 2 "general_operand" "g")))]
""
"add.qi %0,%1,%2")
(define_insn "addhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(plus:HI (match_operand:HI 1 "general_operand" "%g")
(match_operand:HI 2 "general_operand" "g")))]
""
"add.hi %0,%1,%2")
(define_insn "addsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(plus:SI (match_operand:SI 1 "general_operand" "%g")
(match_operand:SI 2 "general_operand" "g")))]
""
"add.si %0,%1,%2")
(define_insn "addsf3"
[(set (match_operand:SF 0 "general_operand" "=g")
(plus:SF (match_operand:SF 1 "general_operand" "%g")
(match_operand:SF 2 "general_operand" "g")))]
""
"add.sf %0,%1,%2")
(define_insn "adddf3"
[(set (match_operand:DF 0 "general_operand" "=g")
(plus:DF (match_operand:DF 1 "general_operand" "%g")
(match_operand:DF 2 "general_operand" "g")))]
""
"add.df %0,%1,%2")
(define_insn "mulqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(mult:QI (match_operand:QI 1 "general_operand" "%g")
(match_operand:QI 2 "general_operand" "g")))]
""
"mul.qi %0,%1,%2")
(define_insn "mulhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(mult:HI (match_operand:HI 1 "general_operand" "%g")
(match_operand:HI 2 "general_operand" "g")))]
""
"mul.hi %0,%1,%2")
(define_insn "mulsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(mult:SI (match_operand:SI 1 "general_operand" "%g")
(match_operand:SI 2 "general_operand" "g")))]
""
"mul.si %0,%1,%2")
(define_insn "mulsf3"
[(set (match_operand:SF 0 "general_operand" "=g")
(mult:SF (match_operand:SF 1 "general_operand" "%g")
(match_operand:SF 2 "general_operand" "g")))]
""
"mul.sf %0,%1,%2")
(define_insn "muldf3"
[(set (match_operand:DF 0 "general_operand" "=g")
(mult:DF (match_operand:DF 1 "general_operand" "%g")
(match_operand:DF 2 "general_operand" "g")))]
""
"mul.df %0,%1,%2")
(define_insn "divqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(div:QI (match_operand:QI 1 "general_operand" "g")
(match_operand:QI 2 "general_operand" "g")))]
""
"div.qi %0,%1,%2")
(define_insn "divhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(div:HI (match_operand:HI 1 "general_operand" "g")
(match_operand:HI 2 "general_operand" "g")))]
""
"div.hi %0,%1,%2")
(define_insn "divsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(div:SI (match_operand:SI 1 "general_operand" "g")
(match_operand:SI 2 "general_operand" "g")))]
""
"div.si %0,%1,%2")
(define_insn "divsf3"
[(set (match_operand:SF 0 "general_operand" "=g")
(div:SF (match_operand:SF 1 "general_operand" "g")
(match_operand:SF 2 "general_operand" "g")))]
""
"div.sf %0,%1,%2")
(define_insn "divdf3"
[(set (match_operand:DF 0 "general_operand" "=g")
(div:DF (match_operand:DF 1 "general_operand" "g")
(match_operand:DF 2 "general_operand" "g")))]
""
"div.df %0,%1,%2")
(define_insn "subqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(minus:QI (match_operand:QI 1 "general_operand" "g")
(match_operand:QI 2 "general_operand" "g")))]
""
"sub.qi %0,%1,%2")
(define_insn "subhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(minus:HI (match_operand:HI 1 "general_operand" "g")
(match_operand:HI 2 "general_operand" "g")))]
""
"sub.hi %0,%1,%2")
(define_insn "subsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(minus:SI (match_operand:SI 1 "general_operand" "g")
(match_operand:SI 2 "general_operand" "g")))]
""
"sub.si %0,%1,%2")
(define_insn "subsf3"
[(set (match_operand:SF 0 "general_operand" "=g")
(minus:SF (match_operand:SF 1 "general_operand" "g")
(match_operand:SF 2 "general_operand" "g")))]
""
"sub.sf %0,%1,%2")
(define_insn "subdf3"
[(set (match_operand:DF 0 "general_operand" "=g")
(minus:DF (match_operand:DF 1 "general_operand" "g")
(match_operand:DF 2 "general_operand" "g")))]
""
"sub.df %0,%1,%2")
(define_insn "andqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(and:QI (match_operand:QI 1 "general_operand" "%g")
(match_operand:QI 2 "general_operand" "g")))]
""
"and.qi %0,%1,%2")
(define_insn "andhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(and:HI (match_operand:HI 1 "general_operand" "%g")
(match_operand:HI 2 "general_operand" "g")))]
""
"and.hi %0,%1,%2")
(define_insn "andsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(and:SI (match_operand:SI 1 "general_operand" "%g")
(match_operand:SI 2 "general_operand" "g")))]
""
"and.si %0,%1,%2")
(define_insn "iorqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(ior:QI (match_operand:QI 1 "general_operand" "%g")
(match_operand:QI 2 "general_operand" "g")))]
""
"or.qi %0,%1,%2")
(define_insn "iorhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(ior:HI (match_operand:HI 1 "general_operand" "%g")
(match_operand:HI 2 "general_operand" "g")))]
""
"or.hi %0,%1,%2")
(define_insn "iorsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(ior:SI (match_operand:SI 1 "general_operand" "%g")
(match_operand:SI 2 "general_operand" "g")))]
""
"or.si %0,%1,%2")
(define_insn "xorqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(xor:QI (match_operand:QI 1 "general_operand" "%g")
(match_operand:QI 2 "general_operand" "g")))]
""
"xor.qi %0,%1,%2")
(define_insn "xorhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(xor:HI (match_operand:HI 1 "general_operand" "%g")
(match_operand:HI 2 "general_operand" "g")))]
""
"xor.hi %0,%1,%2")
(define_insn "xorsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(xor:SI (match_operand:SI 1 "general_operand" "%g")
(match_operand:SI 2 "general_operand" "g")))]
""
"xor.si %0,%1,%2")
(define_insn "negqi2"
[(set (match_operand:QI 0 "general_operand" "=g")
(neg:QI (match_operand:QI 1 "general_operand" "g")))]
""
"neg.qi %0,%1")
(define_insn "neghi2"
[(set (match_operand:HI 0 "general_operand" "=g")
(neg:HI (match_operand:HI 1 "general_operand" "g")))]
""
"neg.hi %0,%1")
(define_insn "negsi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(neg:SI (match_operand:SI 1 "general_operand" "g")))]
""
"neg.si %0,%1")
(define_insn "one_cmplqi2"
[(set (match_operand:QI 0 "general_operand" "=g")
(not:QI (match_operand:QI 1 "general_operand" "g")))]
""
"not.qi %0,%1")
(define_insn "one_cmplhi2"
[(set (match_operand:HI 0 "general_operand" "=g")
(not:HI (match_operand:HI 1 "general_operand" "g")))]
""
"not.hi %0,%1")
(define_insn "one_cmplsi2"
[(set (match_operand:SI 0 "general_operand" "=g")
(not:SI (match_operand:SI 1 "general_operand" "g")))]
""
"not.si %0,%1")
(define_insn "ashlqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(ashift:QI (match_operand:QI 1 "general_operand" "g")
(match_operand:QI 2 "general_operand" "g")))]
""
"asl.qi %0,%1,%2")
(define_insn "ashlhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(ashift:HI (match_operand:HI 1 "general_operand" "g")
(match_operand:HI 2 "general_operand" "g")))]
""
"asl.hi %0,%1,%2")
(define_insn "ashlsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(ashift:SI (match_operand:SI 1 "general_operand" "g")
(match_operand:SI 2 "general_operand" "g")))]
""
"asl.si %0,%1,%2")
(define_insn "ashrqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(ashiftrt:QI (match_operand:QI 1 "general_operand" "g")
(match_operand:QI 2 "general_operand" "g")))]
""
"asr.qi %0,%1,%2")
(define_insn "ashrhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(ashiftrt:HI (match_operand:HI 1 "general_operand" "g")
(match_operand:HI 2 "general_operand" "g")))]
""
"asr.hi %0,%1,%2")
(define_insn "ashrsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(ashiftrt:SI (match_operand:SI 1 "general_operand" "g")
(match_operand:SI 2 "general_operand" "g")))]
""
"asr.si %0,%1,%2")
(define_insn "lshlqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(lshift:QI (match_operand:QI 1 "general_operand" "g")
(match_operand:QI 2 "general_operand" "g")))]
""
"lsl.qi %0,%1,%2")
(define_insn "lshlhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(lshift:HI (match_operand:HI 1 "general_operand" "g")
(match_operand:HI 2 "general_operand" "g")))]
""
"lsl.hi %0,%1,%2")
(define_insn "lshlsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(lshift:SI (match_operand:SI 1 "general_operand" "g")
(match_operand:SI 2 "general_operand" "g")))]
""
"lsl.si %0,%1,%2")
(define_insn "lshrqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(lshiftrt:QI (match_operand:QI 1 "general_operand" "g")
(match_operand:QI 2 "general_operand" "g")))]
""
"lsr.qi %0,%1,%2")
(define_insn "lshrhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(lshiftrt:HI (match_operand:HI 1 "general_operand" "g")
(match_operand:HI 2 "general_operand" "g")))]
""
"lsr.hi %0,%1,%2")
(define_insn "lshrsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(lshiftrt:SI (match_operand:SI 1 "general_operand" "g")
(match_operand:SI 2 "general_operand" "g")))]
""
"lsr.si %0,%1,%2")
/*
(define_insn "rotlqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(rotate:QI (match_operand:QI 1 "general_operand" "g")
(match_operand:QI 2 "general_operand" "g")))]
""
"rotl.qi %0,%1,%2")
(define_insn "rotlhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(rotate:HI (match_operand:HI 1 "general_operand" "g")
(match_operand:HI 2 "general_operand" "g")))]
""
"rotl.hi %0,%1,%2")
(define_insn "rotlsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(rotate:SI (match_operand:SI 1 "general_operand" "g")
(match_operand:SI 2 "general_operand" "g")))]
""
"rotl.si %0,%1,%2")
(define_insn "rotrqi3"
[(set (match_operand:QI 0 "general_operand" "=g")
(rotatert:QI (match_operand:QI 1 "general_operand" "g")
(match_operand:QI 2 "general_operand" "g")))]
""
"rotr.qi %0,%1,%2")
(define_insn "rotrhi3"
[(set (match_operand:HI 0 "general_operand" "=g")
(rotatert:HI (match_operand:HI 1 "general_operand" "g")
(match_operand:HI 2 "general_operand" "g")))]
""
"rotr.hi %0,%1,%2")
(define_insn "rotrsi3"
[(set (match_operand:SI 0 "general_operand" "=g")
(rotatert:SI (match_operand:SI 1 "general_operand" "g")
(match_operand:SI 2 "general_operand" "g")))]
""
"rotr.si %0,%1,%2")
*/
(define_insn "beq"
[(set (pc)
(if_then_else (eq (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"beq %l0")
(define_insn "bne"
[(set (pc)
(if_then_else (ne (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"bne %l0")
(define_insn "bgt"
[(set (pc)
(if_then_else (gt (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"bgt %l0")
(define_insn "bgtu"
[(set (pc)
(if_then_else (gtu (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"bgtu %l0")
(define_insn "blt"
[(set (pc)
(if_then_else (lt (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"blt %l0")
(define_insn "bltu"
[(set (pc)
(if_then_else (ltu (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"bltu %l0")
(define_insn "bge"
[(set (pc)
(if_then_else (ge (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"bge %l0")
(define_insn "bgeu"
[(set (pc)
(if_then_else (geu (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"bgeu %l0")
(define_insn "ble"
[(set (pc)
(if_then_else (le (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"ble %l0")
(define_insn "bleu"
[(set (pc)
(if_then_else (leu (cc0)
(const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
"bleu %l0")
(define_insn ""
[(set (pc)
(if_then_else (eq (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"bne %l0")
(define_insn ""
[(set (pc)
(if_then_else (ne (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"beq %l0")
(define_insn ""
[(set (pc)
(if_then_else (gt (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"ble %l0")
(define_insn ""
[(set (pc)
(if_then_else (gtu (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"bleu %l0")
(define_insn ""
[(set (pc)
(if_then_else (lt (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"bge %l0")
(define_insn ""
[(set (pc)
(if_then_else (ltu (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"bgeu %l0")
(define_insn ""
[(set (pc)
(if_then_else (ge (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"blt %l0")
(define_insn ""
[(set (pc)
(if_then_else (geu (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"bltu %l0")
(define_insn ""
[(set (pc)
(if_then_else (le (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"bgt %l0")
(define_insn ""
[(set (pc)
(if_then_else (leu (cc0)
(const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
"bgtu %l0")
(define_insn "jump"
[(set (pc)
(label_ref (match_operand 0 "" "")))]
""
"bra %l0")
(define_insn "tablejump"
[(set (pc) (match_operand:SI 0 "general_operand" "g"))
(use (label_ref (match_operand 1 "" "")))]
""
"bra %0")
(define_insn "call"
[(call (match_operand:SI 0 "ever_good" "g")
(match_operand:SI 1 "ever_good" "g"))]
""
"call %0")
(define_insn "call_value"
[(set (match_operand 0 "" "g")
(call (match_operand:SI 1 "ever_good" "g")
(match_operand:SI 2 "ever_good" "g")))]
""
"call %1")
(define_insn "nop"
[(const_int 0)]
""
"nop")

View File

@ -1,157 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Description de la machine virtuelle
*
* Ecrit par Arnaud COMPAN & Francois PECHEUX ** avril-juin 1990
* Avec quelques modifications par Frederic Petrot.
*/
#ifndef FILE
#include <stdio.h>
#endif
#define AT_SP(mode) (gen_rtx (MEM, (mode), stack_pointer_rtx))
#define AT_BP(mode) (gen_rtx (MEM, (mode), frame_pointer_rtx))
#define RET return ""
#define RETCOM(X) return ""
extern FILE *asm_out_file;
static char *singlemove_string ();
static void output_movf ();
static void replace_float_constant ();
static int mentions_fp_top ();
static int call_top_dead_p ();
static int fp_top_dead_p1 ();
static rtx via_memory ();
static void output_asm_insn_double_reg_op ();
#define PRINT_REG(X, CODE, FILE) fprintf (FILE, "%s", reg_name[REGNO (X)])
notice_update_cc(exp)
rtx exp;
{
if (GET_CODE (exp) == SET) {
if (SET_DEST (exp) == pc_rtx)
return;
if (REG_P (SET_DEST (exp))
&& (REG_P (SET_SRC (exp)) || GET_CODE (SET_SRC (exp)) == MEM)) {
if (cc_status.value1
&& reg_overlap_mentioned_p (SET_DEST (exp), cc_status.value1))
cc_status.value1 = 0;
if (cc_status.value2
&& reg_overlap_mentioned_p (SET_DEST (exp), cc_status.value2))
cc_status.value2 = 0;
return;
}
if (GET_CODE (SET_DEST (exp)) == MEM && REG_P (SET_SRC (exp))) {
if (cc_status.value1 && GET_CODE (cc_status.value1) == MEM)
cc_status.value1 = 0;
if (cc_status.value2 && GET_CODE (cc_status.value2) == MEM)
cc_status.value2 = 0;
return;
} else if (GET_CODE (SET_SRC (exp)) == CALL) {
CC_STATUS_INIT;
return;
} else if (SET_DEST (exp) == cc0_rtx) {
CC_STATUS_INIT;
cc_status.value1 = SET_SRC (exp);
return;
} else if (GET_MODE (SET_SRC (exp)) == SImode)
switch (GET_CODE (SET_SRC (exp))) {
case ASHIFTRT:
case LSHIFTRT:
case ASHIFT:
case LSHIFT:
if (GET_CODE (XEXP (SET_SRC (exp), 1)) != CONST_INT) {
CC_STATUS_INIT;
break;
}
case PLUS:
case MINUS:
case NEG:
case AND:
case IOR:
case XOR:
cc_status.flags = CC_NO_OVERFLOW;
cc_status.value1 = SET_SRC (exp);
cc_status.value2 = SET_DEST (exp);
break;
default:
CC_STATUS_INIT;
}
else
CC_STATUS_INIT;
} else if (GET_CODE (exp) == PARALLEL
&& GET_CODE (XVECEXP (exp, 0, 0)) == SET) {
if (SET_DEST (XVECEXP (exp, 0, 0)) == pc_rtx)
return;
if (SET_DEST (XVECEXP (exp, 0, 0)) == cc0_rtx) {
CC_STATUS_INIT;
cc_status.value1 = SET_SRC (XVECEXP (exp, 0, 0));
return;
}
CC_STATUS_INIT;
} else
CC_STATUS_INIT;
}
output_ascii(file, p, size)
FILE *file;
char *p;
int size;
{
int i;
fprintf (file, "\t.string \"");
for (i = 0; i < size; i++) {
register int c = p[i];
if (c == '\"' || c == '\\')
putc ('\\', file);
if (c >= ' ' && c < 0177)
putc (c, file);
else {
fprintf (file, "\\%03o", c);
if (i < size - 1 && p[i + 1] >= '0' && p[i + 1] <= '9')
fprintf (file, "\"\n\tstring \"");
}
}
fprintf (file, "\"\n");
}
int ever_good(op, mode)
register rtx op;
enum machine_mode mode;
{
return 1;
}
int no_good(op, mode)
register rtx op;
enum machine_mode mode;
{
return 0;
}

View File

@ -1,494 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Description de la machine virtuelle
*
* Ecrit par Arnaud COMPAN & Francois PECHEUX ** avril-juin 1990
*
*/
#define DBX_DEBUGGING_INFO
#ifdef MY_SUN
#define CPP_PREDEFINES "-Dsun -Dunix"
#endif
#ifdef MY_VAX
#define CPP_PREDEFINES "-Dvax -Dunix"
#endif
extern int target_flags;
#define TARGET_DEFAULT 1
#define TARGET_SWITCHES {{ "", TARGET_DEFAULT}}
#define BITS_BIG_ENDIAN
#define BYTES_BIG_ENDIAN
#define BITS_PER_UNIT 8
#define BITS_PER_WORD 32
#define UNITS_PER_WORD 4
#define POINTER_SIZE 32
#define POINTER_BOUNDARY 32
#define PARM_BOUNDARY 32
#define STACK_BOUNDARY 32
#define FUNCTION_BOUNDARY 32
#define BIGGEST_ALIGNMENT 32
#define EMPTY_FIELD_BOUNDARY 32
#define STRUCTURE_SIZE_BOUNDARY 32
#define STRICT_ALIGNMENT
#define MAX_FIXED_MODE_SIZE BITS_PER_WORD
#define FIRST_PSEUDO_REGISTER 32
#define FIXED_REGISTERS \
{ \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 1 \
}
#define CALL_USED_REGISTERS \
{ \
1, 1, 1, 1, 1, 1, 1, 1, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
0, 1, 0, 0, 1, 1, 0, 1 \
}
#define HARD_REGNO_NREGS(REGNO, MODE) \
((GET_MODE_SIZE(MODE) + UNITS_PER_WORD -1) / UNITS_PER_WORD)
#define HARD_REGNO_MODE_OK(REGNO, MODE) 1
#define MODES_TIEABLE_P(MODE1, MODE2) ( (MODE1) == (MODE2) )
#define STACK_POINTER_REGNUM 31
#define FRAME_POINTER_REGNUM 30
#define FRAME_POINTER_REQUIRED 0
#define ARG_POINTER_REGNUM 30
#define STATIC_CHAIN_REGNUM 29
#define STRUCT_VALUE_REGNUM 28
enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define N_REG_CLASSES (int) LIM_REG_CLASSES
#define GENERAL_REGS ALL_REGS
#define REG_CLASS_NAMES {"NO_REGS", "ALL_REGS" }
#define REG_CLASS_CONTENTS {0, -1}
#define REGNO_REG_CLASS(REGNO) ALL_REGS
#define INDEX_REG_CLASS ALL_REGS
#define BASE_REG_CLASS ALL_REGS
#define REG_CLASS_FROM_LETTER(C) NO_REGS
#define REGNO_OK_FOR_INDEX_P(REGNO) \
((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)
#define REGNO_OK_FOR_BASE_P(REGNO) \
((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)
#define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
#define CLASS_MAX_NREGS(CLASS, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
#define CONST_OK_FOR_LETTER_P(VALUE, C) (0)
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) (0)
#define STACK_GROWS_DOWNWARD 1
#define FRAME_GROWS_DOWNWARD 1
#define FIRST_PARM_OFFSET(FNDECL) (8)
#define RETURN_POPS_ARGS(FUNTYPE) (0)
#define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx (REG, TYPE_MODE (VALTYPE), 25)
#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 25)
#define FUNCTION_VALUE_REGNO_P(N) ((N)==25)
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (0)
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
#define CUMULATIVE_ARGS int
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE) ((CUM) = 0)
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
((CUM) += ((MODE) != BLKmode \
? (GET_MODE_SIZE (MODE) + 3) / 4 \
: (int_size_in_bytes (TYPE) + 3) / 4))
#define FUNCTION_ARG_REGNO_P(N) (0)
#define FUNCTION_PROLOGUE(FILE, SIZE) \
{ \
extern char call_used_regs[]; \
int i; \
\
fprintf(FILE, "\tsub.si d31,d31,#4\n"); \
fprintf(FILE, "\tmov.si (d31),d30\n"); \
fprintf(FILE, "\tmov.si d30,d31\n"); \
if (SIZE != 0) \
fprintf(FILE, "\tsub.si d31,d31,#%d\n",SIZE); \
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) \
if (regs_ever_live[i] && !call_used_regs[i] && \
i != FRAME_POINTER_REGNUM) { \
fprintf(FILE, "\tsub.si d31,d31,#4\n"); \
fprintf(FILE, "\tmov.si (d31),%s\n",reg_names[i]); \
} \
}
#define FUNCTION_PROFILER(FILE, LABELNO) \
fprintf(FILE,"\t; ----- Profiler\n") ;
#define EXIT_IGNORE_STACK 0
#define FUNCTION_EPILOGUE(FILE, SIZE) \
{ \
extern char call_used_regs[]; \
int i; \
\
for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--) \
if (regs_ever_live[i] && !call_used_regs[i] && \
i!=FRAME_POINTER_REGNUM) { \
fprintf(FILE, "\tmov.si %s,(d31)\n",reg_names[i]); \
fprintf(FILE, "\tadd.si d31,d31,#4\n"); \
} \
if (SIZE != 0) \
fprintf(FILE, "\tadd.si d31,d31,#%d\n", SIZE); \
fprintf(FILE, "\tmov.si d30,(d31)\n"); \
fprintf(FILE, "\tadd.si d31,d31,#4\n"); \
fprintf(FILE, "\tret\n"); \
}
#define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \
{ \
puts("Ah que schisme dans FIX_FRAME_POINTER_ADDRESS"); \
abort(); \
}
#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
#define MAX_REGS_PER_ADDRESS 1
#ifndef REG_OK_STRICT
#define REG_OK_FOR_INDEX_P(X) (1)
#define REG_OK_FOR_BASE_P(X) (1)
#else
#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
#endif
#define REG_OK_FOR_P(X) (REG_OK_FOR_INDEX_P(X) || REG_OK_FOR_BASE_P(X))
#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
{ \
if (CONSTANT_ADDRESS_P(X)) \
goto ADDR ; \
else if (GET_CODE(X) == CONST_INT) \
goto ADDR ; \
else if (REG_P(X) && REG_OK_FOR_P(X)) \
goto ADDR ; \
else if (GET_CODE(X) == SYMBOL_REF) \
goto ADDR ; \
else if (GET_CODE(X) == PLUS) { \
if (REG_P(XEXP(X,0)) && REG_OK_FOR_P(XEXP(X,0)) && \
GET_CODE(XEXP(X,1))==CONST_INT) \
goto ADDR ; \
if (REG_P(XEXP(X,1)) && REG_OK_FOR_P(XEXP(X,1)) \
&& GET_CODE(XEXP(X,0))==CONST_INT) \
goto ADDR ; \
} \
}
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) { }
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
#define LEGITIMATE_CONSTANT_P(X) (1)
#define CASE_VECTOR_MODE SImode
#define CASE_TAKES_INDEX_RAW
/* #define CASE_VECTOR_PC_RELATIVE */
#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
#define EASY_DIV_EXPR TRUNC_DIV_EXPR
#define DEFAULT_SIGNED_CHAR 1
#define MOVE_MAX 4
#define SLOW_BYTE_ACCESS 0
#define SHIFT_COUNT_TRUNCATED
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
#define STORE_FLAG_VALUE 1
#define Pmode SImode
#define FUNCTION_MODE SImode
#define NO_FUNCTION_CSE
#define CONST_COSTS(RTX,CODE) \
case CONST_INT: \
case CONST: \
case LABEL_REF: \
case SYMBOL_REF: \
case CONST_DOUBLE: \
case PLUS: \
return 1;
#define CC_IN_FCCR 04000
#define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc((EXP))
#define TEXT_SECTION_ASM_OP "\n\t.text"
#define DATA_SECTION_ASM_OP "\n\t.data"
#define ASM_APP_ON ""
#define ASM_APP_OFF ""
#define ASM_FILE_START(FILE) \
do { \
extern char *version_string, *language_string; \
{ \
int len = strlen(dump_base_name); \
char *na = dump_base_name + len; \
char shorter[15]; \
while (na > dump_base_name) { \
if (na[-1] == '/') \
break; \
na--; \
} \
strncpy (shorter, na, 14); \
shorter[14] = '\0'; \
fprintf(FILE, "\t.file\t\"%s\"\n", shorter); \
} \
fprintf(FILE, "\t.version\t\"%s %s\"\n", \
language_string, version_string); \
} while (0)
#define REGISTER_NAMES \
{ \
"d0","d1","d2","d3","d4","d5","d6","d7","d8","d9", \
"d10","d11","d12","d13","d14","d15","d16","d17","d18","d19", \
"d20","d21","d22","d23","d24","d25","d26","d27","d28","d29", \
"d30","d31" \
}
#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
#define ASM_OUTPUT_LABEL(FILE,NAME) \
(assemble_name(FILE, NAME), fputs (":\n", FILE))
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
{ \
fputs("\t.global\t", FILE); \
assemble_name(FILE, NAME); \
fputs("\n", FILE); \
}
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
fprintf(FILE, "_%s", NAME)
#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
fprintf(FILE, ".%s%d:\n", PREFIX, NUM)
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf(LABEL, "*#.%s%d", PREFIX, NUM)
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
fprintf(FILE, "\t.double %.20e\n", (VALUE))
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
fprintf(FILE, "\t.float %.12e\n", (VALUE))
#define ASM_OUTPUT_INT(FILE,VALUE) \
( fprintf(FILE, "\t.int "), \
output_addr_const(FILE, (VALUE)), \
fprintf(FILE, "\n") \
)
#define ASM_OUTPUT_SHORT(FILE,VALUE) \
( fprintf(FILE, "\t.short "), \
output_addr_const(FILE, (VALUE)), \
fprintf(FILE, "\n") \
)
#define ASM_OUTPUT_CHAR(FILE,VALUE) \
( fprintf(FILE, "\t.char "), \
output_addr_const(FILE, (VALUE)), \
fprintf(FILE, "\n") \
)
#define ASM_OUTPUT_BYTE(FILE,VALUE) \
fprintf(FILE, "\t.byte 0x%x\n", (VALUE))
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) output_ascii(FILE, P, SIZE)
#define ASM_OUTPUT_ADDR_VEC_PROLOGUE(FILE, MODE, LEN) \
fprintf(FILE, "\tjmp r1\n");
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
fprintf(FILE, "push \n", \
((REGNO) < 32 ? "" : "f"), reg_names[REGNO])
#define ASM_OUTPUT_REG_POP(FILE,REGNO) \
fprintf(FILE, "pop \n", \
((REGNO) < 32 ? "" : "f"), reg_names[REGNO])
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
fprintf(FILE, "\t.L%d\n", VALUE)
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
fprintf(FILE, "\tword .L%d-.L%d\n", VALUE, REL)
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
if ((LOG) != 0) \
fprintf (FILE, "\t.align %d\n", 1<<(LOG))
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
fprintf(FILE, "\t.skip %d\n", (SIZE))
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
( fputs ("\t.comm ", (FILE)), \
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%d\n", (ROUNDED)) \
)
#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
( fprintf ((FILE), "\t.data\n"), \
fprintf ((FILE), "\t.align %d\n", (SIZE) <= 4 ? 4 : 8), \
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ":\n\t.skip %d\n", (ROUNDED)), \
fprintf ((FILE), "\t.text\n") \
)
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
sprintf ((OUTPUT), "%s_%d", (NAME), (LABELNO)) \
)
#define ASM_OPEN_PAREN "("
#define ASM_CLOSE_PAREN ")"
/* Define results of standard character escape sequences. */
#define TARGET_BELL 007
#define TARGET_BS 010
#define TARGET_TAB 011
#define TARGET_NEWLINE 012
#define TARGET_VT 013
#define TARGET_FF 014
#define TARGET_CR 015
#define PRINT_OPERAND(FILE, X, CODE) \
{ \
/* fprintf(FILE,"'%d'",GET_CODE(X)) ; */ \
if (GET_CODE (X) == REG) \
fprintf (FILE, "%s", reg_names[REGNO (X)]); \
else if (GET_CODE (X) == MEM) \
output_address (XEXP (X, 0)); \
else if (GET_CODE (X) == SYMBOL_REF) \
output_addr_const (FILE, X); \
else if (GET_CODE (X) == LABEL_REF) \
output_addr_const (FILE, X); \
else if (GET_CODE (X) == CONST) \
{ \
fprintf(FILE,"$") ; \
output_addr_const (FILE, XEXP(X,0)); \
} \
else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \
{ \
union { double d; int i[2]; } u; \
union { float f; int i; } u1; \
u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
u1.f = u.d; \
if (CODE == 'f') \
fprintf (FILE, "#%f", u1.f); \
else \
fprintf (FILE, "#%x", u1.i); \
} \
else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != DImode) \
{ \
union { double d; int i[2]; } u; \
u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
fprintf (FILE, "#%f", u.d); \
} \
else if (GET_CODE(X) == CONST_INT) \
{ \
fprintf(FILE,"#") ; \
output_addr_const (FILE, X); \
} \
else if (GET_CODE(X) == PLUS) \
{ \
if (GET_CODE(XEXP(X,0)) == CONST_INT) \
output_addr_const (FILE, XEXP(X,0)); \
if (GET_CODE(XEXP(X,1)) == CONST_INT) \
output_addr_const (FILE, XEXP(X,1)); \
if (GET_CODE(XEXP(X,0)) == REG) \
fprintf (FILE, "(%s)", reg_names[REGNO (XEXP(X,0))]); \
if (GET_CODE(XEXP(X,1)) == REG) \
fprintf (FILE, "(%s)", reg_names[REGNO (XEXP(X,1))]); \
} \
else \
fprintf(FILE, "*print_operand %d*",GET_CODE(X)) ; \
}
#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
{ \
switch (GET_CODE (ADDR)) \
{ \
case REG: \
fprintf (FILE, "(%s)", reg_names[REGNO (ADDR)]); \
break; \
case MEM: \
output_address (XEXP (ADDR, 0)); \
break; \
case CONST_INT: \
fprintf(FILE,"#") ; \
output_addr_const (FILE, ADDR); \
break; \
case SYMBOL_REF: \
fprintf(FILE,"$") ; \
output_addr_const (FILE, ADDR); \
break; \
case CONST: /* on suppose que c'est une addition */ \
fprintf(FILE,"$") ; \
output_addr_const (FILE, XEXP(ADDR,0)); \
break ; \
case PLUS: \
if (GET_CODE(XEXP(ADDR,0)) == CONST_INT) \
output_addr_const (FILE, XEXP(ADDR,0)); \
if (GET_CODE(XEXP(ADDR,1)) == CONST_INT) \
output_addr_const (FILE, XEXP(ADDR,1)); \
if (GET_CODE(XEXP(ADDR,0)) == REG) \
fprintf (FILE, "(%s)", reg_names[REGNO (XEXP(ADDR,0))]); \
if (GET_CODE(XEXP(ADDR,1)) == REG) \
fprintf (FILE, "(%s)", reg_names[REGNO (XEXP(ADDR,1))]); \
break; \
default: \
fprintf (FILE, "*print_operand_address %d*",GET_CODE(ADDR)); \
break; \
} \
}
#define SFVALUE float
#define INTIFY(FLOATVAL) FLOATVAL
#define ASM_OPERAND_LETTER '#'
#define STARTING_FRAME_OFFSET 0

View File

@ -1,59 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Description de la machine virtuelle
*
* Ecrit par Arnaud COMPAN & Francois PECHEUX ** avril-juin 1990
*
*/
#define MY_SUN
#define FALSE 0
#define TRUE 1
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
#define HOST_BITS_PER_INT 32
#define HOST_BITS_PER_LONG 32
#define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 33
#ifdef MY_SUN
#define USG
#endif
#include "tm.h"
#ifdef MY_SUN
#define bcopy(a,b,c) memcpy (b,a,c)
#define bzero(a,b) memset (a,0,b)
#define bcmp(a,b,c) memcmp (a,b,c)
#endif
#ifdef __GNUC__
#define alloca(n) __builtin_alloca(n)
#endif

View File

@ -1,82 +0,0 @@
'xrdef {Top-pg}{1}
'xrdef {Top-snt}{chapter'tie1}
'xrdef {Global Actions-pg}{1}
'xrdef {Global Actions-snt}{section'tie1.1}
'xrdef {Commands-pg}{3}
'xrdef {Commands-snt}{section'tie1.2}
'xrdef {Header Files-pg}{3}
'xrdef {Header Files-snt}{section'tie1.3}
'xrdef {Header Uses-pg}{3}
'xrdef {Header Uses-snt}{section'tie1.3.1}
'xrdef {Include Syntax-pg}{4}
'xrdef {Include Syntax-snt}{section'tie1.3.2}
'xrdef {Include Operation-pg}{5}
'xrdef {Include Operation-snt}{section'tie1.3.3}
'xrdef {Once-Only-pg}{6}
'xrdef {Once-Only-snt}{section'tie1.3.4}
'xrdef {Macros-pg}{7}
'xrdef {Macros-snt}{section'tie1.4}
'xrdef {Simple Macros-pg}{7}
'xrdef {Simple Macros-snt}{section'tie1.4.1}
'xrdef {Argument Macros-pg}{9}
'xrdef {Argument Macros-snt}{section'tie1.4.2}
'xrdef {Predefined-pg}{11}
'xrdef {Predefined-snt}{section'tie1.4.3}
'xrdef {Standard Predefined-pg}{11}
'xrdef {Standard Predefined-snt}{section'tie1.4.3.1}
'xrdef {Nonstandard Predefined-pg}{13}
'xrdef {Nonstandard Predefined-snt}{section'tie1.4.3.2}
'xrdef {Stringification-pg}{15}
'xrdef {Stringification-snt}{section'tie1.4.4}
'xrdef {Concatenation-pg}{16}
'xrdef {Concatenation-snt}{section'tie1.4.5}
'xrdef {Undefining-pg}{17}
'xrdef {Undefining-snt}{section'tie1.4.6}
'xrdef {Redefining-pg}{18}
'xrdef {Redefining-snt}{section'tie1.4.7}
'xrdef {Macro Pitfalls-pg}{19}
'xrdef {Macro Pitfalls-snt}{section'tie1.4.8}
'xrdef {Misnesting-pg}{19}
'xrdef {Misnesting-snt}{section'tie1.4.8.1}
'xrdef {Macro Parentheses-pg}{19}
'xrdef {Macro Parentheses-snt}{section'tie1.4.8.2}
'xrdef {Swallow Semicolon-pg}{21}
'xrdef {Swallow Semicolon-snt}{section'tie1.4.8.3}
'xrdef {Side Effects-pg}{22}
'xrdef {Side Effects-snt}{section'tie1.4.8.4}
'xrdef {Self-Reference-pg}{23}
'xrdef {Self-Reference-snt}{section'tie1.4.8.5}
'xrdef {Argument Prescan-pg}{24}
'xrdef {Argument Prescan-snt}{section'tie1.4.8.6}
'xrdef {Cascaded Macros-pg}{27}
'xrdef {Cascaded Macros-snt}{section'tie1.4.8.7}
'xrdef {Conditionals-pg}{27}
'xrdef {Conditionals-snt}{section'tie1.5}
'xrdef {Conditional Uses-pg}{28}
'xrdef {Conditional Uses-snt}{section'tie1.5.1}
'xrdef {Conditional Syntax-pg}{28}
'xrdef {Conditional Syntax-snt}{section'tie1.5.2}
'xrdef {#if Command-pg}{28}
'xrdef {#if Command-snt}{section'tie1.5.2.1}
'xrdef {#else Command-pg}{29}
'xrdef {#else Command-snt}{section'tie1.5.2.2}
'xrdef {#elif Command-pg}{30}
'xrdef {#elif Command-snt}{section'tie1.5.2.3}
'xrdef {Deleted Code-pg}{31}
'xrdef {Deleted Code-snt}{section'tie1.5.3}
'xrdef {Conditionals-Macros-pg}{31}
'xrdef {Conditionals-Macros-snt}{section'tie1.5.4}
'xrdef {#error Command-pg}{32}
'xrdef {#error Command-snt}{section'tie1.5.5}
'xrdef {Combining Sources-pg}{33}
'xrdef {Combining Sources-snt}{section'tie1.6}
'xrdef {Other Commands-pg}{34}
'xrdef {Other Commands-snt}{section'tie1.7}
'xrdef {Output-pg}{35}
'xrdef {Output-snt}{section'tie1.8}
'xrdef {Invocation-pg}{35}
'xrdef {Invocation-snt}{section'tie1.9}
'xrdef {Concept Index-pg}{39}
'xrdef {Concept Index-snt}{}
'xrdef {Index-pg}{41}
'xrdef {Index-snt}{}

View File

@ -1,30 +0,0 @@
\initial {C}
\entry {cascaded macros}{27}
\entry {commands}{3}
\entry {concatenation}{16}
\entry {conditionals}{27}
\initial {H}
\entry {header file}{3}
\initial {L}
\entry {line control}{33}
\initial {M}
\entry {macro body uses macro}{27}
\initial {N}
\entry {null command}{34}
\initial {O}
\entry {options}{35}
\entry {output format}{35}
\initial {P}
\entry {predefined macros}{11}
\entry {preprocessor commands}{3}
\initial {R}
\entry {redefining macros}{18}
\entry {repeated inclusion}{6}
\initial {S}
\entry {self-reference}{23}
\entry {semicolons (after macro calls)}{21}
\entry {side effects (in macro arguments)}{22}
\entry {stringification}{15}
\initial {U}
\entry {undefining macros}{17}
\entry {unsafe macros}{22}

View File

@ -1,51 +0,0 @@
\initial {#}
\entry {\code {#elif}}{30}
\entry {\code {#else}}{29}
\entry {\code {#error}}{32}
\entry {\code {#ident}}{34}
\entry {\code {#if}}{28}
\entry {\code {#ifdef}}{32}
\entry {\code {#ifndef}}{32}
\entry {\code {#include}}{4}
\entry {\code {#line}}{33}
\entry {\code {#pragma}}{34}
\initial {-}
\entry {\code {-C}}{36}
\entry {\code {-d}}{37}
\entry {\code {-D}}{36}
\entry {\code {-i}}{37}
\entry {\code {-I}}{36}
\entry {\code {-M}}{37}
\entry {\code {-MM}}{37}
\entry {\code {-P}}{35}
\entry {\code {-pedantic}}{36}
\entry {\code {-trigraphs}}{36}
\entry {\code {-U}}{37}
\entry {\code {-undef}}{37}
\initial {{@fam @ttfam @tentt @char '137}}
\entry {\code {{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}BASE{@fam @ttfam @tentt @char '137}FILE{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}}}{12}
\entry {\code {{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}DATE{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}}}{12}
\entry {\code {{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}FILE{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}}}{12}
\entry {\code {{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}LINE{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}}}{12}
\entry {\code {{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}STDC{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}}}{12}
\entry {\code {{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}TIME{@fam @ttfam @tentt @char '137}{@fam @ttfam @tentt @char '137}}}{12}
\initial {B}
\entry {\code {BSD}}{13}
\initial {D}
\entry {\code {defined}}{31}
\initial {M}
\entry {\code {M68020}}{14}
\entry {\code {m68k}}{13}
\entry {\code {mc68000}}{13}
\initial {N}
\entry {\code {ns32000}}{14}
\initial {P}
\entry {\code {pyr}}{14}
\initial {S}
\entry {\code {sequent}}{14}
\entry {\code {sun}}{14}
\entry {\code {system header files}}{4}
\initial {U}
\entry {\code {unix}}{13}
\initial {V}
\entry {\code {vax}}{13}

View File

@ -1,69 +0,0 @@
Info file cpp.info, produced by Makeinfo, -*- Text -*- from input
file cpp.texinfo.
This file documents the GNU C Preprocessor.
Copyright (C) 1987, 1989 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 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.

Indirect:
cpp.info-1: 748
cpp.info-2: 48706

Tag Table:
(Indirect)
Node: Top750
Node: Global Actions3306
Node: Commands5809
Node: Header Files7414
Node: Header Uses7990
Node: Include Syntax9377
Node: Include Operation12390
Node: Once-Only14056
Node: Macros15867
Node: Simple Macros16779
Node: Argument Macros19826
Node: Predefined24914
Node: Standard Predefined25342
Node: Nonstandard Predefined29545
Node: Stringification32827
Node: Concatenation35666
Node: Undefining38922
Node: Redefining39944
Node: Macro Pitfalls41230
Node: Misnesting42273
Node: Macro Parentheses43281
Node: Swallow Semicolon45136
Node: Side Effects47024
Node: Self-Reference48708
Node: Argument Prescan50953
Node: Cascaded Macros55914
Node: Conditionals56935
Node: Conditional Uses58223
Node: Conditional Syntax59610
Node: #if Command60179
Node: #else Command62430
Node: #elif Command63077
Node: Deleted Code64418
Node: Conditionals-Macros64949
Node: #error Command68171
Node: Combining Sources69215
Node: Other Commands71829
Node: Output73062
Node: Invocation73993
Node: Concept Index79417
Node: Index80219

End Tag Table

File diff suppressed because it is too large Load Diff

View File

@ -1,881 +0,0 @@
Info file cpp.info, produced by Makeinfo, -*- Text -*- from input
file cpp.texinfo.
This file documents the GNU C Preprocessor.
Copyright (C) 1987, 1989 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 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.

File: cpp.info, Node: Self-Reference, Next: Argument Prescan, Prev: Side Effects, Up: Macro Pitfalls
Self-Referential Macros
.......................
A "self-referential" macro is one whose name appears in its definition.
A special feature of ANSI Standard C is that the self-reference is
not considered a macro call. It is passed into the preprocessor
output unchanged.
Let's consider an example:
#define foo (4 + foo)
where `foo' is also a variable in your program.
Following the ordinary rules, each reference to `foo' will expand
into `(4 + foo)'; then this will be rescanned and will expand into
`(4 + (4 + foo))'; and so on until it causes a fatal error (memory
full) in the preprocessor.
However, the special rule about self-reference cuts this process
short after one step, at `(4 + foo)'. Therefore, this macro
definition has the possibly useful effect of causing the program to
add 4 to the value of `foo' wherever `foo' is referred to.
In most cases, it is a bad idea to take advantage of this feature. A
person reading the program who sees that `foo' is a variable will not
expect that it is a macro as well. The reader will come across the
identifier `foo' in the program and think its value should be that of
the variable `foo', whereas in fact the value is four greater.
The special rule for self-reference applies also to "indirect"
self-reference. This is the case where a macro X expands to use a
macro `y', and `y''s expansion refers to the macro `x'. The
resulting reference to `x' comes indirectly from the expansion of
`x', so it is a self-reference and is not further expanded. Thus,
after
#define x (4 + y)
#define y (2 * x)
`x' would expand into `(4 + (2 * x))'. Clear?
But suppose `y' is used elsewhere, not from the definition of `x'.
Then the use of `x' in the expansion of `y' is not a self-reference
because `x' is not "in progress". So it does expand. However, the
expansion of `x' contains a reference to `y', and that is an indirect
self-reference now because `y' is "in progress". The result is that
`y' expands to `(2 * (4 + y))'.
It is not clear that this behavior would ever be useful, but it is
specified by the ANSI C standard, so you need to understand it.

File: cpp.info, Node: Argument Prescan, Next: Cascaded Macros, Prev: Self-Reference, Up: Macro Pitfalls
Separate Expansion of Macro Arguments
.....................................
We have explained that the expansion of a macro, including the
substituted actual arguments, is scanned over again for macro calls
to be expanded.
What really happens is more subtle: first each actual argument text
is scanned separately for macro calls. Then the results of this are
substituted into the macro body to produce the macro expansion, and
the macro expansion is scanned again for macros to expand.
The result is that the actual arguments are scanned *twice* to expand
macro calls in them.
Most of the time, this has no effect. If the actual argument
contained any macro calls, they are expanded during the first scan.
The result therefore contains no macro calls, so the second scan does
not change it. If the actual argument were substituted as given,
with no prescan, the single remaining scan would find the same macro
calls and produce the same results.
You might expect the double scan to change the results when a
self-referential macro is used in an actual argument of another macro
(*note Self-Reference::.): the self-referential macro would be
expanded once in the first scan, and a second time in the second
scan. But this is not what happens. The self-references that do not
expand in the first scan are marked so that they will not expand in
the second scan either.
The prescan is not done when an argument is stringified or
concatenated. Thus,
#define str(s) #s
#define foo 4
str (foo)
expands to `"foo"'. Once more, prescan has been prevented from
having any noticeable effect.
More precisely, stringification and concatenation use the argument as
written, in un-prescanned form. The same actual argument would be
used in prescanned form if it is substituted elsewhere without
stringification or concatenation.
#define str(s) #s lose(s)
#define foo 4
str (foo)
expands to `"foo" lose(4)'.
You might now ask, "Why mention the prescan, if it makes no difference?
And why not skip it and make the preprocessor faster?" The answer is
that the prescan does make a difference in three special cases:
* Nested calls to a macro.
* Macros that call other macros that stringify or concatenate.
* Macros whose expansions contain unshielded commas.
We say that "nested" calls to a macro occur when a macro's actual
argument contains a call to that very macro. For example, if `f' is
a macro that expects one argument, `f (f (1))' is a nested pair of
calls to `f'. The desired expansion is made by expanding `f (1)' and
substituting that into the definition of `f'. The prescan causes the
expected result to happen. Without the prescan, `f (1)' itself would
be substituted as an actual argument, and the inner use of `f' would
appear during the main scan as an indirect self-reference and would
not be expanded. Here, the prescan cancels an undesirable side
effect (in the medical, not computational, sense of the term) of the
special rule for self-referential macros.
But prescan causes trouble in certain other cases of nested macro
calls. Here is an example:
#define foo a,b
#define bar(x) lose(x)
#define lose(x) (1 + (x))
bar(foo)
We would like `bar(foo)' to turn into `(1 + (foo))', which would then
turn into `(1 + (a,b))'. But instead, `bar(foo)' expands into
`lose(a,b)', and you get an error because `lose' requires a single
argument. In this case, the problem is easily solved by the same
parentheses that ought to be used to prevent misnesting of arithmetic
operations:
#define foo (a,b)
#define bar(x) lose((x))
The problem is more serious when the operands of the macro are not
expressions; for example, when they are statements. Then parentheses
are unacceptable because they would make for invalid C code:
#define foo { int a, b; ... }
In GNU C you can shield the commas using the `({...})' construct
which turns a compound statement into an expression:
#define foo ({ int a, b; ... })
Or you can rewrite the macro definition to avoid such commas:
#define foo { int a; int b; ... }
There is also one case where prescan is useful. It is possible to
use prescan to expand an argument and then stringify it--if you use
two levels of macros. Let's add a new macro `xstr' to the example
shown above:
#define xstr(s) str(s)
#define str(s) #s
#define foo 4
xstr (foo)
This expands into `"4"', not `"foo"'. The reason for the difference
is that the argument of `xstr' is expanded at prescan (because `xstr'
does not specify stringification or concatenation of the argument).
The result of prescan then forms the actual argument for `str'.
`str' uses its argument without prescan because it performs
stringification; but it cannot prevent or undo the prescanning
already done by `xstr'.

File: cpp.info, Node: Cascaded Macros, Prev: Argument Prescan, Up: Macro Pitfalls
Cascaded Use of Macros
......................
A "cascade" of macros is when one macro's body contains a reference
to another macro. This is very common practice. For example,
#define BUFSIZE 1020
#define TABLESIZE BUFSIZE
This is not at all the same as defining `TABLESIZE' to be `1020'.
The `#define' for `TABLESIZE' uses exactly the body you specify--in
this case, `BUFSIZE'--and does not check to see whether it too is the
name of a macro.
It's only when you *use* `TABLESIZE' that the result of its expansion
is checked for more macro names.
This makes a difference if you change the definition of `BUFSIZE' at
some point in the source file. `TABLESIZE', defined as shown, will
always expand using the definition of `BUFSIZE' that is currently in
effect:
#define BUFSIZE 1020
#define TABLESIZE BUFSIZE
#undef BUFSIZE
#define BUFSIZE 37
Now `TABLESIZE' expands (in two stages) to `37'.

File: cpp.info, Node: Conditionals, Next: Combining Sources, Prev: Macros, Up: Top
Conditionals
============
In a macro processor, a "conditional" is a command that allows a part
of the program to be ignored during compilation, on some conditions.
In the C preprocessor, a conditional can test either an arithmetic
expression or whether a name is defined as a macro.
A conditional in the C preprocessor resembles in some ways an `if'
statement in C, but it is important to understand the difference
between them. The condition in an `if' statement is tested during
the execution of your program. Its purpose is to allow your program
to behave differently from run to run, depending on the data it is
operating on. The condition in a preprocessor conditional command is
tested when your program is compiled. Its purpose is to allow
different code to be included in the program depending on the
situation at the time of compilation.
* Menu:
* Uses: Conditional Uses. What conditionals are for.
* Syntax: Conditional Syntax. How conditionals are written.
* Deletion: Deleted Code. Making code into a comment.
* Macros: Conditionals-Macros. Why conditionals are used with macros.
* Errors: #error Command. Detecting inconsistent compilation parameters.

File: cpp.info, Node: Conditional Uses, Next: Conditional Syntax, Prev: Conditionals, Up: Conditionals
Why Conditionals are Used
-------------------------
Generally there are three kinds of reason to use a conditional.
* A program may need to use different code depending on the
machine or operating system it is to run on. In some cases the
code for one operating system may be erroneous on another
operating system; for example, it might refer to library
routines that do not exist on the other system. When this
happens, it is not enough to avoid executing the invalid code:
merely having it in the program makes it impossible to link the
program and run it. With a preprocessor conditional, the
offending code can be effectively excised from the program when
it is not valid.
* You may want to be able to compile the same source file into two
different programs. Sometimes the difference between the
programs is that one makes frequent time-consuming consistency
checks on its intermediate data while the other does not.
* A conditional whose condition is always false is a good way to
exclude code from the program but keep it as a sort of comment
for future reference.
Most simple programs that are intended to run on only one machine
will not need to use preprocessor conditionals.

File: cpp.info, Node: Conditional Syntax, Next: Deleted Code, Prev: Conditional Uses, Up: Conditionals
Syntax of Conditionals
----------------------
A conditional in the C preprocessor begins with a "conditional
command": `#if', `#ifdef' or `#ifndef'. *Note Conditionals-Macros::,
for info on `#ifdef' and `#ifndef'; only `#if' is explained here.
* Menu:
* If: #if Command. Basic conditionals using `#if' and `#endif'.
* Else: #else Command. Including some text if the condition fails.
* Elif: #elif Command. Testing several alternative possibilities.

File: cpp.info, Node: #if Command, Next: #else Command, Prev: Conditional Syntax, Up: Conditional Syntax
The `#if' Command
.................
The `#if' command in its simplest form consists of
#if EXPRESSION
CONTROLLED TEXT
#endif /* EXPRESSION */
The comment following the `#endif' is not required, but it is a good
practice because it helps people match the `#endif' to the
corresponding `#if'. Such comments should always be used, except in
short conditionals that are not nested. In fact, you can put
anything at all after the `#endif' and it will be ignored by the GNU
C preprocessor, but only comments are acceptable in ANSI Standard C.
EXPRESSION is a C expression of integer type, subject to stringent
restrictions. It may contain
* Integer constants, which are all regarded as `long' or `unsigned
long'.
* Character constants, which are interpreted according to the
character set and conventions of the machine and operating
system on which the preprocessor is running. The GNU C
preprocessor uses the C data type `char' for these character
constants; therefore, whether some character codes are negative
is determined by the C compiler used to compile the
preprocessor. If it treats `char' as signed, then character
codes large enough to set the sign bit will be considered
negative; otherwise, no character code is considered negative.
* Arithmetic operators for addition, subtraction, multiplication,
division, bitwise operations, shifts, comparisons, and `&&' and
`||'.
* Identifiers that are not macros, which are all treated as zero(!).
* Macro calls. All macro calls in the expression are expanded
before actual computation of the expression's value begins.
Note that `sizeof' operators and `enum'-type values are not allowed.
`enum'-type values, like all other identifiers that are not taken as
macro calls and expanded, are treated as zero.
The text inside of a conditional can include preprocessor commands.
Then the commands inside the conditional are obeyed only if that
branch of the conditional succeeds. The text can also contain other
conditional groups. However, the `#if''s and `#endif''s must balance.

File: cpp.info, Node: #else Command, Next: #elif Command, Prev: #if Command, Up: Conditional Syntax
The `#else' Command
...................
The `#else' command can be added to a conditional to provide
alternative text to be used if the condition is false. This looks like
#if EXPRESSION
TEXT-IF-TRUE
#else /* Not EXPRESSION */
TEXT-IF-FALSE
#endif /* Not EXPRESSION */
If EXPRESSION is nonzero, and the TEXT-IF-TRUE is considered
included, then `#else' acts like a failing conditional and the
TEXT-IF-FALSE is ignored. Contrariwise, if the `#if' conditional
fails, the TEXT-IF-FALSE is considered included.

File: cpp.info, Node: #elif Command, Prev: #else Command, Up: Conditional Syntax
The `#elif' Command
...................
One common case of nested conditionals is used to check for more than
two possible alternatives. For example, you might have
#if X == 1
...
#else /* X != 1 */
#if X == 2
...
#else /* X != 2 */
...
#endif /* X != 2 */
#endif /* X != 1 */
Another conditional command, `#elif', allows this to be abbreviated
as follows:
#if X == 1
...
#elif X == 2
...
#else /* X != 2 and X != 1*/
...
#endif /* X != 2 and X != 1*/
`#elif' stands for "else if". Like `#else', it goes in the middle of
a `#if'-`#endif' pair and subdivides it; it does not require a
matching `#endif' of its own. Like `#if', the `#elif' command
includes an expression to be tested.
The text following the `#elif' is processed only if the original
`#if'-condition failed and the `#elif' condition succeeeds. More
than one `#elif' can go in the same `#if'-`#endif' group. Then the
text after each `#elif' is processed only if the `#elif' condition
succeeds after the original `#if' and any previous `#elif''s within
it have failed. `#else' is equivalent to `#elif 1', and `#else' is
allowed after any number of `#elif''s, but `#elif' may not follow a
`#else'.

File: cpp.info, Node: Deleted Code, Next: Conditionals-Macros, Prev: Conditional Syntax, Up: Conditionals
Keeping Deleted Code for Future Reference
-----------------------------------------
If you replace or delete a part of the program but want to keep the
old code around as a comment for future reference, the easy way to do
this is to put `#if 0' before it and `#endif' after it.
This works even if the code being turned off contains conditionals,
but they must be entire conditionals (balanced `#if' and `#endif').

File: cpp.info, Node: Conditionals-Macros, Next: #error Command, Prev: Deleted Code, Up: Conditionals
Conditionals and Macros
-----------------------
Conditionals are rarely useful except in connection with macros. A
`#if' command whose expression uses no macros is equivalent to `#if
1' or `#if 0'; you might as well determine which one, by computing
the value of the expression yourself, and then simplify the program.
But when the expression uses macros, its value can vary from
compilation to compilation.
For example, here is a conditional that tests the expression `BUFSIZE
== 1020', where `BUFSIZE' must be a macro.
#if BUFSIZE == 1020
printf ("Large buffers!\n");
#endif /* BUFSIZE is large */
The special operator `defined' may be used in `#if' expressions to
test whether a certain name is defined as a macro. Either `defined
NAME' or `defined (NAME)' is an expression whose value is 1 if NAME
is defined as macro at the current point in the program, and 0
otherwise. For the `defined' operator it makes no difference what
the definition of the macro is; all that matters is whether there is
a definition. Thus, for example,
#if defined (vax) || defined (ns16000)
would include the following code if either of the names `vax' and
`ns16000' is defined as a macro.
If a macro is defined and later undefined with `#undef', subsequent
use of the `defined' operator will return 0, because the name is no
longer defined. If the macro is defined again with another
`#define', `defined' will recommence returning 1.
Conditionals that test just the definedness of one name are very
common, so there are two special short conditional commands for this
case. They are
`#ifdef NAME'
is equivalent to `#if defined (NAME)'.
`#ifndef NAME'
is equivalent to `#if ! defined (NAME)'.
Macro definitions can vary between compilations for several reasons.
* Some macros are predefined on each kind of machine. For
example, on a Vax, the name `vax' is a predefined macro. On
other machines, it would not be defined.
* Many more macros are defined by system header files. Different
systems and machines define different macros, or give them
different values. It is useful to test these macros with
conditionals to avoid using a system feature on a machine where
it is not implemented.
* Macros are a common way of allowing users to customize a program
for different machines or applications. For example, the macro
`BUFSIZE' might be defined in a configuration file for your
program that is included as a header file in each source file.
You would use `BUFSIZE' in a preprocessor conditional in order
to generate different code depending on the chosen configuration.
* Macros can be defined or undefined with `-D' and `-U' command
options when you compile the program. You can arrange to
compile the same source file into two different programs by
choosing a macro name to specify which program you want, writing
conditionals to test whether or how this macro is defined, and
then controlling the state of the macro with compiler command
options. *Note Invocation::.

File: cpp.info, Node: #error Command, Prev: Conditionals-Macros, Up: Conditionals
The `#error' Command
--------------------
The command `#error' causes the preprocessor to report a fatal error.
The rest of the line that follows `#error' is used as the error
message.
You would use `#error' inside of a conditional that detects a
combination of parameters which you know the program does not
properly support. For example, if you know that the program will not
run properly on a Vax, you might write
#ifdef vax
#error Won't work on Vaxen. See comments at get_last_object.
#endif
*Note Nonstandard Predefined::, for why this works.
If you have several configuration parameters that must be set up by
the installation in a consistent way, you can use conditionals to
detect an inconsistency and report it with `#error'. For example,
#if HASH_TABLE_SIZE % 2 == 0 || HASH_TABLE_SIZE % 3 == 0 \
|| HASH_TABLE_SIZE % 5 == 0
#error HASH_TABLE_SIZE should not be divisible by a small prime
#endif

File: cpp.info, Node: Combining Sources, Next: Other Commands, Prev: Conditionals, Up: Top
Combining Source Files
======================
One of the jobs of the C preprocessor is to inform the C compiler of
where each line of C code came from: which source file and which line
number.
C code can come from multiple source files if you use `#include';
both `#include' and the use of conditionals and macros can cause the
line number of a line in the preprocessor output to be different from
the line's number in the original source file. You will appreciate
the value of making both the C compiler (in error messages) and
symbolic debuggers such as GDB use the line numbers in your source
file.
The C preprocessor builds on this feature by offering a command by
which you can control the feature explicitly. This is useful when a
file for input to the C preprocessor is the output from another
program such as the `bison' parser generator, which operates on
another file that is the true source file. Parts of the output from
`bison' are generated from scratch, other parts come from a standard
parser file. The rest are copied nearly verbatim from the source
file, but their line numbers in the `bison' output are not the same
as their original line numbers. Naturally you would like compiler
error messages and symbolic debuggers to know the original source
file and line number of each line in the `bison' output.
`bison' arranges this by writing `#line' commands into the output
file. `#line' is a command that specifies the original line number
and source file name for subsequent input in the current preprocessor
input file. `#line' has three variants:
`#line LINENUM'
Here LINENUM is a decimal integer constant. This specifies that
the line number of the following line of input, in its original
source file, was LINENUM.
`#line LINENUM FILENAME'
Here LINENUM is a decimal integer constant and FILENAME is a
string constant. This specifies that the following line of
input came originally from source file FILENAME and its line
number there was LINENUM. Keep in mind that FILENAME is not
just a file name; it is surrounded by doublequote characters so
that it looks like a string constant.
`#line ANYTHING ELSE'
ANYTHING ELSE is checked for macro calls, which are expanded.
The result should be a decimal integer constant followed
optionally by a string constant, as described above.
`#line' commands alter the results of the `__FILE__' and `__LINE__'
predefined macros from that point on. *Note Standard Predefined::.

File: cpp.info, Node: Other Commands, Next: Output, Prev: Combining Sources, Up: Top
Miscellaneous Preprocessor Commands
===================================
This section describes three additional preprocessor commands. They
are not very useful, but are mentioned for completeness.
The "null command" consists of a `#' followed by a Newline, with only
whitespace (including comments) in between. A null command is
understood as a preprocessor command but has no effect on the
preprocessor output. The primary significance of the existence of
the null command is that an input line consisting of just a `#' will
produce no output, rather than a line of output containing just a
`#'. Supposedly some old C programs contain such lines.
The `#pragma' command is specified in the ANSI standard to have an
arbitrary implementation-defined effect. In the GNU C preprocessor,
`#pragma' commands are ignored, except for `#pragma once' (*note
Once-Only::.).
The `#ident' command is supported for compatibility with certain
other systems. It is followed by a line of text. On certain
systems, the text is copied into a special place in the object file;
on most systems, the text is ignored and this directive has no effect.

File: cpp.info, Node: Output, Next: Invocation, Prev: Other Commands, Up: Top
C Preprocessor Output
=====================
The output from the C preprocessor looks much like the input, except
that all preprocessor command lines have been replaced with blank
lines and all comments with spaces. Whitespace within a line is not
altered; however, a space is inserted after the expansions of most
macro calls.
Source file name and line number information is conveyed by lines of
the form
# LINENUM FILENAME FLAG
which are inserted as needed into the middle of the input (but never
within a string or character constant). Such a line means that the
following line originated in file FILENAME at line LINENUM.
The third field, FLAG, may be a number, or may be absent. It is `1'
for the beginning of a new source file, and `2' for return to an old
source file at the end of an included file. It is absent otherwise.

File: cpp.info, Node: Invocation, Next: Concept Index, Prev: Output, Up: Top
Invoking the C Preprocessor
===========================
Most often when you use the C preprocessor you will not have to
invoke it explicitly: the C compiler will do so automatically.
However, the preprocessor is sometimes useful individually.
The C preprocessor expects two file names as arguments, INFILE and
OUTFILE. The preprocessor reads INFILE together with any other files
it specifies with `#include'. All the output generated by the
combined input files is written in OUTFILE.
Either INFILE or OUTFILE may be `-', which as INFILE means to read
from standard input and as OUTFILE means to write to standard output.
Also, if OUTFILE or both file names are omitted, the standard output
and standard input are used for the omitted file names.
Here is a table of command options accepted by the C preprocessor.
Most of them can also be given when compiling a C program; they are
passed along automatically to the preprocessor when it is invoked by
the compiler.
`-P'
Inhibit generation of `#'-lines with line-number information in
the output from the preprocessor (*note Output::.). This might
be useful when running the preprocessor on something that is not
C code and will be sent to a program which might be confused by
the `#'-lines
`-C'
Do not discard comments: pass them through to the output file.
Comments appearing in arguments of a macro call will be copied
to the output before the expansion of the macro call.
`-trigraphs'
Process ANSI standard trigraph sequences. These are
three-character sequences, all starting with `??', that are
defined by ANSI C to stand for single characters. For example,
`??/' stands for `\', so `'??/n'' is a character constant for a
newline. Strictly speaking, the GNU C preprocessor does not
support all programs in ANSI Standard C unless `-trigraphs' is
used, but if you ever notice the difference it will be with
relief.
You don't want to know any more about trigraphs.
`-pedantic'
Issue warnings required by the ANSI C standard in certain cases
such as when text other than a comment follows `#else' or
`#endif'.
`-I DIRECTORY'
Add the directory DIRECTORY to the end of the list of
directories to be searched for header files (*note Include
Syntax::.). This can be used to override a system header file,
substituting your own version, since these directories are
searched before the system header file directories. If you use
more than one `-I' option, the directories are scanned in
left-to-right order; the standard system directories come after.
`-I-'
Any directories specified with `-I' options before the `-I-'
option are searched only for the case of `#include "FILE"'; they
are not searched for `#include <FILE>'.
If additional directories are specified with `-I' options after
the `-I-', these directories are searched for all `#include'
directives.
In addition, the `-I-' option inhibits the use of the current
directory as the first search directory for `#include "FILE"'.
Therefore, the current directory is searched only if it is
requested explicitly with `-I.'. Specifying both `-I-' and
`-I.' allows you to control precisely which directories are
searched before the current one and which are searched after.
`-nostdinc'
Do not search the standard system directories for header files.
Only the directories you have specified with `-I' options (and
the current directory, if appropriate) are searched.
`-D NAME'
Predefine NAME as a macro, with definition `1'.
`-D NAME=DEFINITION'
Predefine NAME as a macro, with definition DEFINITION. There
are no restrictions on the contents of DEFINITION, but if you
are invoking the preprocessor from a shell or shell-like program
you may need to use the shell's quoting syntax to protect
characters such as spaces that have a meaning in the shell syntax.
`-U NAME'
Do not predefine NAME. If both `-U' and `-D' are specified for
one name, the `-U' beats the `-D' and the name is not predefined.
`-undef'
Do not predefine any nonstandard macros.
`-d'
Instead of outputting the result of preprocessing, output a list
of `#define' commands for all the macros defined during the
execution of the preprocessor.
`-M'
Instead of outputting the result of preprocessing, output a rule
suitable for `make' describing the dependencies of the main
source file. The preprocessor outputs one `make' rule
containing the object file name for that source file, a colon,
and the names of all the included files. If there are many
included files then the rule is split into several lines using
`\'-newline.
This feature is used in automatic updating of makefiles.
`-MM'
Like `-M' but mention only the files included with `#include
"FILE"'. System header files included with `#include <FILE>'
are omitted.
`-i FILE'
Process FILE as input, discarding the resulting output, before
processing the regular input file. Because the output generated
from FILE is discarded, the only effect of `-i FILE' is to make
the macros defined in FILE available for use in the main input.

File: cpp.info, Node: Concept Index, Next: Index, Prev: Invocation, Up: Top
Concept Index
*************
* Menu:
* cascaded macros: Cascaded Macros.
* commands: Commands.
* concatenation: Concatenation.
* conditionals: Conditionals.
* header file: Header Files.
* line control: Combining Sources.
* macro body uses macro: Cascaded Macros.
* null command: Other Commands.
* options: Invocation.
* output format: Output.
* predefined macros: Predefined.
* preprocessor commands: Commands.
* redefining macros: Redefining.
* repeated inclusion: Once-Only.
* self-reference: Self-Reference.
* semicolons (after macro calls): Swallow Semicolon.
* side effects (in macro arguments): Side Effects.
* stringification: Stringification.
* undefining macros: Undefining.
* unsafe macros: Side Effects.

File: cpp.info, Node: Index, Prev: Concept Index, Up: Top
Index of Commands, Macros and Options
*************************************
* Menu:
* #elif: #elif Command.
* #else: #else Command.
* #error: #error Command.
* #ident: Other Commands.
* #if: Conditional Syntax.
* #ifdef: Conditionals-Macros.
* #ifndef: Conditionals-Macros.
* #include: Include Syntax.
* #line: Combining Sources.
* #pragma: Other Commands.
* -C: Invocation.
* -D: Invocation.
* -I: Invocation.
* -M: Invocation.
* -MM: Invocation.
* -P: Invocation.
* -U: Invocation.
* -d: Invocation.
* -i: Invocation.
* -pedantic: Invocation.
* -trigraphs: Invocation.
* -undef: Invocation.
* BSD: Nonstandard Predefined.
* M68020: Nonstandard Predefined.
* __BASE_FILE__: Standard Predefined.
* __DATE__: Standard Predefined.
* __FILE__: Standard Predefined.
* __LINE__: Standard Predefined.
* __STDC__: Standard Predefined.
* __TIME__: Standard Predefined.
* defined: Conditionals-Macros.
* m68k: Nonstandard Predefined.
* mc68000: Nonstandard Predefined.
* ns32000: Nonstandard Predefined.
* pyr: Nonstandard Predefined.
* sequent: Nonstandard Predefined.
* sun: Nonstandard Predefined.
* system header files: Header Uses.
* unix: Nonstandard Predefined.
* vax: Nonstandard Predefined.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,472 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Delayed branch scheduling pass.
Copyright (C) 1987, 1988, 1989 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the GNU CC General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
GNU CC, but only under the conditions described in the
GNU CC General Public License. A copy of this license is
supposed to have been given to you along with GNU CC so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
/* Delayed Branch Scheduling Optimization
If the HAVE_DELAYED_BRANCH macro is defined in the machine
description, this code is called by toplev.c during optimizing
compilation immediately after the final jump optimization pass
and just before assembler output generation, if delayed branch
scheduling is requested with the -fdelayed-branch switch.
Machines with delayed branch allow one or more instructions
placed *after* a branch instruction to be executed while the
hardware is off fetching the next instruction. These instructions
are executed after the branch is issued, but before the branch
actually takes effect. The decision as to whether or not
the branch is to be taken, and the address of the branch target
are fixed at the time the branch is issued, so only instructions
that do not appear in the dependency graphs for computing the
branch decision and/or target address may be relocated "after"
the branch. Some machines might have additional restrictions,
such as not allowing memory instructions or condition code
modification in the delay sequence.
Note that this scheduling pass occurs after register allocation, and
(of course) final jump optimization. This mechanism is *not* intended
to be hacked to deal with similar memory-latency pipeline scheduling
(i.e. slots after loads/stores), as tempting as that might be. The
right place to do load-store latency scheduling is prior to register
allocation, since allocation may introduce artificial dependencies
that could have been avoided; note that these artificial dependencies
are *not* reflected in the flow information, which is one reason for
the somewhat ad hoc analysis done in this pass.
The strategy and methods used are as follows. The function DBR_SCHEDULE
is called from toplev.c if the scheduling pass is to be run. That function
sets up the dump file, then scans the current function from top to bottom
for "d-blocks", which are like basic blocks (single-entry, single-exit),
with the additional condition that the last instruction in the block has
delay slots. Note that if calls have slots, d-blocks can be smaller than
basic blocks. If a basic block does not end with a delay-instruction,
it is skipped.
To re-order instructions in a d-block (see DBR_DBLOCK_SCHED), the scheduler
scans backward from the "d-instruction", trying to fill the slots. The
scheduler is somewhat conservative. Volatile memory references are
serialized (their order is never changed to avoid possible aliasing
problems). Definitions of registers are serialized (so there is no
possibility of deadlock). Since hard register dependencies are
not noted by flow analysis, the scheduler does its own simplified
tracking of the registers, memory, and condition code uses/defines
by the d-instruction and the instructions it depends on). Information
available from flow analysis is used to shortcut the analysis where
possible.
Since only data dependencies are considered by the scheduler, any
machine-specific restrictions, e.g. to keep memory instructions from
being scheduled into slots, must be explicit in the definition of
DBR_INSN_ELIGIBLE_P.
The scheduler scans backwards over the block, looking for eligible
insns to fill the slot(s). If none are found, nothing is done, and no
changes are made to the code. As eligible insns are found, they are
removed from the chain, and recorded in an INSN_LIST rtx. When all
slots are full (or the top of the d-block is reached), the *pattern*
of the d-insn is replaced with a SEQUENCE rtx, which consists of
a copy of the original d-insn followed by the slot fillers. Slot
filling instructions remain in the original relative order in the
sequence.
When the SEQUENCE pattern is encountered by final, the instructions
are output "normally", though the output code for the instructions
may test for this and alter their behavior appropriately.
*/
#include <stdio.h>
#include "config.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "flags.h"
FILE *dbr_dump_file;
/* The number of unfilled delay slots in the current sequence. */
static int slots_avail;
/* A flag, nonzero indicating that some insn that could not
go in a slot writes to memory. */
static int memw;
/* A flag, nonzero indicating that the condition code is written
by some insn that couldn't go in a delay slot. */
static int ccw;
/* Each bit is nonzero if the corresponding hard register
is written by an insn that couldn't go in a delay slot. */
static HARD_REG_SET regw;
/* A flag, set nonzero if ENOTE determines that
the current insn can't go in a delay slot because of a
data dependency detected by note_stores. */
static int eflag;
/* The insn having delay slots. Global because of the calls through
note_stores that need it. */
static rtx dinsn;
/* The insn being currently considered for a delay slot. */
static rtx insn;
/* An INSN_LIST (just like the insn field) that we use to hold
LOG_LINKS of ineligible insns. We use what flow analysis
stuff we can - this prevents exhaustive searches for write-read
dependencies in most cases. This tactic only loses on reloads
and code generated with hard regs (instead of pseudos). */
static rtx dep_insn_list;
/* Called by note_stores on "ineligible" insns to keep track of
pre-branch dependencies. */
static void
pnote (x, in)
rtx x;
rtx in;
{
switch (GET_CODE (x))
{
case REG:
if (GET_CODE (in) != SET
|| GET_CODE (SET_SRC (in)) != CALL)
SET_HARD_REG_BIT (regw, REGNO (x));
return;
case MEM:
memw = TRUE; /* this might be relaxed somewhat later */
return;
case CC0:
ccw = TRUE;
return;
case PC:
return;
default:
abort (); /* should never happen */
}
}
/* The d-block end insn is in DINSN. Initialize the flags to
start building the delay sequence. Calls PNOTE from note_stores
to track the written registers and memory. */
static void
init_flags ()
{
CLEAR_HARD_REG_SET (regw);
memw = ccw = 0;
note_stores (PATTERN (dinsn), pnote);
if (LOG_LINKS (dinsn))
dep_insn_list = copy_rtx (LOG_LINKS (dinsn));
else
dep_insn_list = 0;
slots_avail = DBR_SLOTS_AFTER (dinsn);
}
/* Called through note_stores on possibly eligible insn patterns.
Checks to see if a register written by the pattern is needed by an already
ineligible insn. Sets the global EFLAG nonzero if a dependency
is found. */
static void
enote (x, p)
rtx x;
rtx p;
{
if (eflag == 0)
{
if (GET_CODE (x) == REG)
{
if (reg_used_between_p (x, insn, dinsn))
goto lose;
if ((!FUNCTION_VALUE_REGNO_P (REGNO (x)) ||
GET_CODE (dinsn) != CALL_INSN) &&
reg_mentioned_p (x, (PATTERN (dinsn))))
goto lose;
}
else if (x == cc0_rtx &&
reg_used_between_p (x, insn, NEXT_INSN (dinsn)))
goto lose;
return;
lose:
eflag = 1;
}
}
/* Search the current dependency list DEP_INSN_LIST for INSN,
return nonzero if found. */
static int
in_dep_list_p (insn)
rtx insn;
{
rtx l;
for (l = dep_insn_list; l ; l = XEXP (l, 1))
if (insn == XEXP (l, 0)) return 1;
return 0;
}
/* Returns zero if INSN is ineligible to be put in a delay slot
of DINSN. INSN is ineligible if it:
- is in the dependency list of an ineligible insn.
- writes a hard register needed by an ineligible insn.
- reads a register written by an ineligible insn.
- refers to memory.
- sets the condition code.
- violates a machine-dependent constraint. */
static int
insn_eligible_p ()
{
rtx dest;
rtx pat = PATTERN (insn);
int i,s;
/* See if there are any explicit dependencies on this insn. */
if (in_dep_list_p (insn))
return 0;
/* Check for implicit dependencies by calling enote on each
store rtx. ENOTE makes sure that no ineligible instruction
refers to a register in a way that flow analysis
has missed or ignored. */
eflag = 0;
note_stores (PATTERN (insn), enote);
if (eflag)
return 0;
/* Check for volatile memory refs if any already ineligible. */
if (memw && volatile_refs_p (pat))
{
memw = TRUE;
return 0;
}
/* See if it refers to any regs that are clobbered by ineligibles. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (regw, i)
&& refers_to_regno_p (i, i + 1, pat, 0))
return 0;
#ifdef DBR_INSN_ELIGIBLE_P
/* Check for arbitrary machine constraints if any. */
if (! DBR_INSN_ELIGIBLE_P (insn, dinsn))
return 0;
#endif
return 1;
}
/* Add the links in LIST to the dependency list. We put them
at the front since this should make searches faster in long
d-blocks.
*/
static void
prepend_to_dep_list (list)
rtx list;
{
rtx l = copy_rtx (list);
while (XEXP (l, 1) != 0)
l = XEXP (l, 1);
XEXP (l, 1) = dep_insn_list;
dep_insn_list = l;
}
/* Update the flags for ineligible INSN - it can't be put in a delay
slot. This involves setting bits to indicate the stores of INSN, and
adding any flow-analysis dependencies of INSN's insn-list to
the ineligible list. (Should ultimately catch reloads too.) */
static void
update_flags (insn)
rtx insn;
{
rtx l;
note_stores (PATTERN (insn), pnote);
if (l = LOG_LINKS (insn))
prepend_to_dep_list (l);
}
/* Put INSN and LIST together in a SEQUENCE rtx of LENGTH, and replace
the pattern of INSN with the SEQUENCE. Include the available
slots AVAIL in the SEQUENCE insn. */
static void
emit_delay_sequence (insn, list, length, avail)
rtx insn;
rtx list;
int length;
int avail;
{
register int i = 1;
register rtx li, tem;
/* Allocate the the rtvec to hold the insns and the SEQUENCE. */
rtvec seqv = rtvec_alloc (length + 1);
rtx seq = gen_rtx (SEQUENCE, VOIDmode, seqv);
/* Make a copy of the insn having delay slots. */
tem = copy_rtx (insn);
NEXT_INSN (tem) = 0;
PREV_INSN (tem) = 0;
/* Replace the original pattern with a sequence whose
first insn is the copy. */
PATTERN (insn) = seq;
INSN_CODE (insn) = -1;
XVECEXP (seq, 0, 0) = tem;
/* Copy in the delay-slot filling insns. */
for (li = list; li; li = XEXP (li, 1))
{
XVECEXP (seq, 0, i) = XEXP (li, 0);
i++;
}
}
/* Try to reorganize code in a d-block */
static void
dbr_dblock_sched (first, last)
rtx first, last;
{
rtx delay_insn_list = 0;
int seq_len = 0;
dinsn = last;
if (first == last) return;
init_flags ();
insn = PREV_INSN (dinsn);
while (1)
{
rtx prev = PREV_INSN (insn);
rtx next = NEXT_INSN (insn);
if (GET_CODE (insn) == INSN
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER
&& GET_CODE (PATTERN (insn)) != ADDR_VEC
&& GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC)
{
if (slots_avail >= DBR_INSN_SLOTS (insn) && insn_eligible_p ())
{
/* Add this insn to the delay sequence and
update the number of slots available. */
register rtx t = delay_insn_list;
delay_insn_list = gen_rtx (INSN_LIST, VOIDmode, insn, t);
seq_len++;
slots_avail -= DBR_INSN_SLOTS (insn);
/* Now remove it from the chain. */
NEXT_INSN (prev) = next;
PREV_INSN (next) = prev;
NEXT_INSN (insn) = PREV_INSN (insn) = 0;
}
else
update_flags (insn);
}
else
if (GET_CODE (insn) != NOTE)
abort ();
if (slots_avail == 0 || insn == first)
break;
else
insn = prev;
}
/* Done. If the delay list is non-empty, emit a sequence
in place of the dinsn. */
if (delay_insn_list != 0)
emit_delay_sequence (dinsn, delay_insn_list, seq_len, slots_avail);
}
/*
Identify d-blocks of a function, which are sort of like basic
blocks, except that any instruction with delay slots defines the end
of a dblock, and dblocks that do not end in delay-instructions are
uninteresting degenerate cases.
This function finds d-blocks in the code for a function, and calls
dbr_dblock_sched on non-degenerate blocks. Called from toplev.c
if HAVE_DELAYED_BRANCH is defined and we are doing optimizing
compilation. F is the first insn of the function, DUMP_FILE
is the file to output debugging info on if requested. */
void
dbr_schedule (f, dump_file)
rtx f;
FILE *dump_file;
{
rtx first = f;
rtx insn;
/* Dump output if requested */
if (dbr_dump_file = dump_file)
fprintf (dbr_dump_file, "Delayed-branch reordering dump.\n");
/* Search for d-blocks by scanning the insns from top to bottom. */
for (insn = first; insn; insn = NEXT_INSN (insn))
{
if (DBR_SLOTS_AFTER (insn) > 0)
{
/* An insn with delay slots always terminates a d-block.
Call the scheduler to fill in the slots if possible. */
dbr_dblock_sched (first, insn);
/* Resume scanning after the end of the sequence. */
first = NEXT_INSN (dinsn);
}
else
/* Not an end of a real d-block, but need to check
if it is the end of a degenerate one. Note that
calls or jumps will only reach here if they aren't
delayed instructions. */
if (GET_CODE (insn) == CODE_LABEL ||
GET_CODE (insn) == JUMP_INSN ||
GET_CODE (insn) == CALL_INSN)
first = NEXT_INSN (insn);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +0,0 @@
#!/bin/sh
#
# ecoff-cmp file1.o file2.o
#
ld -s -L -o /tmp/foo1.$$ $1 2>1 > /dev/null
ld -s -L -o /tmp/foo2.$$ $2 2>1 > /dev/null
tail +10c /tmp/foo1.$$ > /tmp/foo3.$$
tail +10c /tmp/foo2.$$ > /tmp/foo4.$$
cmp /tmp/foo3.$$ /tmp/foo4.$$
rm -f /tmp/foo[1234].$$

File diff suppressed because it is too large Load Diff

View File

@ -1,598 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Subroutines for manipulating rtx's in semantically interesting ways.
Copyright (C) 1987 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
#include "expr.h"
/* Return an rtx for the sum of X and the integer C. */
rtx
plus_constant (x, c)
register rtx x;
register int c;
{
register RTX_CODE code = GET_CODE (x);
register enum machine_mode mode = GET_MODE (x);
int all_constant = 0;
if (c == 0)
return x;
if (code == CONST_INT)
return gen_rtx (CONST_INT, VOIDmode, (INTVAL (x) + c));
/* If adding to something entirely constant, set a flag
so that we can add a CONST around the result. */
if (code == CONST)
{
x = XEXP (x, 0);
all_constant = 1;
}
else if (code == SYMBOL_REF || code == LABEL_REF)
all_constant = 1;
/* The interesting case is adding the integer to a sum.
Look for constant term in the sum and combine
with C. For an integer constant term, we make a combined
integer. For a constant term that is not an explicit integer,
we cannot really combine, but group them together anyway. */
if (GET_CODE (x) == PLUS)
{
if (GET_CODE (XEXP (x, 0)) == CONST_INT)
{
c += INTVAL (XEXP (x, 0));
x = XEXP (x, 1);
}
else if (GET_CODE (XEXP (x, 1)) == CONST_INT)
{
c += INTVAL (XEXP (x, 1));
x = XEXP (x, 0);
}
else if (CONSTANT_P (XEXP (x, 0)))
{
return gen_rtx (PLUS, mode,
plus_constant (XEXP (x, 0), c),
XEXP (x, 1));
}
else if (CONSTANT_P (XEXP (x, 1)))
{
return gen_rtx (PLUS, mode,
XEXP (x, 0),
plus_constant (XEXP (x, 1), c));
}
#ifdef OLD_INDEXING
/* Detect adding a constant to an indexed address
of the form (PLUS (MULT (REG) (CONST)) regs-and-constants).
Keep the (MULT ...) at the top level of addition so that
the result is still suitable for indexing and constants
are combined. */
else if (GET_CODE (XEXP (x, 0)) == MULT)
{
return gen_rtx (PLUS, mode, XEXP (x, 0),
plus_constant (XEXP (x, 1), c));
}
else if (GET_CODE (XEXP (x, 1)) == MULT)
{
return gen_rtx (PLUS, mode, plus_constant (XEXP (x, 0), c),
XEXP (x, 1));
}
#endif
}
if (c != 0)
x = gen_rtx (PLUS, mode, x, gen_rtx (CONST_INT, VOIDmode, c));
if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
return x;
else if (all_constant)
return gen_rtx (CONST, mode, x);
else
return x;
}
/* If X is a sum, return a new sum like X but lacking any constant terms.
Add all the removed constant terms into *CONSTPTR.
X itself is not altered. The result != X if and only if
it is not isomorphic to X. */
rtx
eliminate_constant_term (x, constptr)
rtx x;
int *constptr;
{
int c;
register rtx x0, x1;
if (GET_CODE (x) != PLUS)
return x;
/* First handle constants appearing at this level explicitly. */
if (GET_CODE (XEXP (x, 0)) == CONST_INT)
{
*constptr += INTVAL (XEXP (x, 0));
return eliminate_constant_term (XEXP (x, 1), constptr);
}
if (GET_CODE (XEXP (x, 1)) == CONST_INT)
{
*constptr += INTVAL (XEXP (x, 1));
return eliminate_constant_term (XEXP (x, 0), constptr);
}
c = 0;
x0 = eliminate_constant_term (XEXP (x, 0), &c);
x1 = eliminate_constant_term (XEXP (x, 1), &c);
if (x1 != XEXP (x, 1) || x0 != XEXP (x, 0))
{
*constptr += c;
return gen_rtx (PLUS, GET_MODE (x), x0, x1);
}
return x;
}
/* Return an rtx for the size in bytes of the value of EXP. */
rtx
expr_size (exp)
tree exp;
{
return expand_expr (size_in_bytes (TREE_TYPE (exp)), 0, SImode, 0);
}
/* Not yet really written since C does not need it. */
rtx
lookup_static_chain (context)
rtx context;
{
abort ();
}
/* Return a copy of X in which all memory references
and all constants that involve symbol refs
have been replaced with new temporary registers.
Also emit code to load the memory locations and constants
into those registers.
If X contains no such constants or memory references,
X itself (not a copy) is returned.
X may contain no arithmetic except addition, subtraction and multiplication.
Values returned by expand_expr with 1 for sum_ok fit this constraint. */
static rtx
break_out_memory_refs (x)
register rtx x;
{
if (GET_CODE (x) == MEM || GET_CODE (x) == CONST
|| GET_CODE (x) == SYMBOL_REF)
{
register rtx temp = force_reg (Pmode, x);
mark_reg_pointer (temp);
x = temp;
}
else if (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS
|| GET_CODE (x) == MULT)
{
register rtx op0 = break_out_memory_refs (XEXP (x, 0));
register rtx op1 = break_out_memory_refs (XEXP (x, 1));
if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1))
x = gen_rtx (GET_CODE (x), Pmode, op0, op1);
}
return x;
}
/* Given a memory address or facsimile X, construct a new address,
currently equivalent, that is stable: future stores won't change it.
X must be composed of constants, register and memory references
combined with addition, subtraction and multiplication:
in other words, just what you can get from expand_expr if sum_ok is 1.
Works by making copies of all regs and memory locations used
by X and combining them the same way X does.
You could also stabilize the reference to this address
by copying the address to a register with copy_to_reg;
but then you wouldn't get indexed addressing in the reference. */
rtx
copy_all_regs (x)
register rtx x;
{
if (GET_CODE (x) == REG)
{
if (REGNO (x) != FRAME_POINTER_REGNUM)
x = copy_to_reg (x);
}
else if (GET_CODE (x) == MEM)
x = copy_to_reg (x);
else if (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS
|| GET_CODE (x) == MULT)
{
register rtx op0 = copy_all_regs (XEXP (x, 0));
register rtx op1 = copy_all_regs (XEXP (x, 1));
if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1))
x = gen_rtx (GET_CODE (x), Pmode, op0, op1);
}
return x;
}
/* Return something equivalent to X but valid as a memory address
for something of mode MODE. When X is not itself valid, this
works by copying X or subexpressions of it into registers. */
rtx
memory_address (mode, x)
enum machine_mode mode;
register rtx x;
{
register rtx oldx;
/* By passing constant addresses thru registers
we get a chance to cse them. */
if (! cse_not_expected && CONSTANT_P (x))
return force_reg (Pmode, x);
/* Accept a QUEUED that refers to a REG
even though that isn't a valid address.
On attempting to put this in an insn we will call protect_from_queue
which will turn it into a REG, which is valid. */
if (GET_CODE (x) == QUEUED
&& GET_CODE (QUEUED_VAR (x)) == REG)
return x;
/* We get better cse by rejecting indirect addressing at this stage.
Let the combiner create indirect addresses where appropriate.
For now, generate the code so that the subexpressions useful to share
are visible. But not if cse won't be done! */
oldx = x;
if (! cse_not_expected && GET_CODE (x) != REG)
x = break_out_memory_refs (x);
/* At this point, any valid address is accepted. */
GO_IF_LEGITIMATE_ADDRESS (mode, x, win);
/* If it was valid before but breaking out memory refs invalidated it,
use it the old way. */
if (memory_address_p (mode, oldx))
goto win2;
/* Perform machine-dependent transformations on X
in certain cases. This is not necessary since the code
below can handle all possible cases, but machine-dependent
transformations can make better code. */
LEGITIMIZE_ADDRESS (x, oldx, mode, win);
/* PLUS and MULT can appear in special ways
as the result of attempts to make an address usable for indexing.
Usually they are dealt with by calling force_operand, below.
But a sum containing constant terms is special
if removing them makes the sum a valid address:
then we generate that address in a register
and index off of it. We do this because it often makes
shorter code, and because the addresses thus generated
in registers often become common subexpressions. */
if (GET_CODE (x) == PLUS)
{
int constant_term = 0;
rtx y = eliminate_constant_term (x, &constant_term);
if (constant_term == 0
|| ! memory_address_p (mode, y))
return force_operand (x, 0);
y = plus_constant (copy_to_reg (y), constant_term);
if (! memory_address_p (mode, y))
return force_operand (x, 0);
return y;
}
if (GET_CODE (x) == MULT || GET_CODE (x) == MINUS)
return force_operand (x, 0);
/* If we have a register that's an invalid address,
it must be a hard reg of the wrong class. Copy it to a pseudo. */
if (GET_CODE (x) == REG)
return copy_to_reg (x);
/* Last resort: copy the value to a register, since
the register is a valid address. */
return force_reg (Pmode, x);
win2:
x = oldx;
win:
if (flag_force_addr && optimize && GET_CODE (x) != REG
/* Don't copy an addr via a reg if it is one of our stack slots.
If we did, it would cause invalid REG_EQUIV notes for parms. */
&& ! (GET_CODE (x) == PLUS
&& (XEXP (x, 0) == frame_pointer_rtx
|| XEXP (x, 0) == arg_pointer_rtx)))
{
if (general_operand (x, Pmode))
return force_reg (Pmode, x);
else
return force_operand (x, 0);
}
return x;
}
/* Like `memory_address' but pretend `flag_force_addr' is 0. */
rtx
memory_address_noforce (mode, x)
enum machine_mode mode;
rtx x;
{
int ambient_force_addr = flag_force_addr;
rtx val;
flag_force_addr = 0;
val = memory_address (mode, x);
flag_force_addr = ambient_force_addr;
return val;
}
/* Return a modified copy of X with its memory address copied
into a temporary register to protect it from side effects.
If X is not a MEM, it is returned unchanged (and not copied).
Perhaps even if it is a MEM, if there is no need to change it. */
rtx
stabilize (x)
rtx x;
{
register rtx addr;
if (GET_CODE (x) != MEM)
return x;
addr = XEXP (x, 0);
if (rtx_unstable_p (addr))
{
rtx temp = copy_all_regs (addr);
rtx mem;
if (GET_CODE (temp) != REG)
temp = copy_to_reg (temp);
mem = gen_rtx (MEM, GET_MODE (x), temp);
/* Mark returned memref with in_struct
if it's in an array or structure. */
if (GET_CODE (addr) == PLUS || MEM_IN_STRUCT_P (x))
MEM_IN_STRUCT_P (mem) = 1;
return mem;
}
return x;
}
/* Copy the value or contents of X to a new temp reg and return that reg. */
rtx
copy_to_reg (x)
rtx x;
{
register rtx temp = gen_reg_rtx (GET_MODE (x));
/* If not an operand, must be an address with PLUS and MULT so
do the computation. */
if (! general_operand (x, VOIDmode))
x = force_operand (x, temp);
if (x != temp)
emit_move_insn (temp, x);
return temp;
}
/* Like copy_to_reg but always give the new register mode Pmode
in case X is a constant. */
rtx
copy_addr_to_reg (x)
rtx x;
{
return copy_to_mode_reg (Pmode, x);
}
/* Like copy_to_reg but always give the new register mode MODE
in case X is a constant. */
rtx
copy_to_mode_reg (mode, x)
enum machine_mode mode;
rtx x;
{
register rtx temp = gen_reg_rtx (mode);
/* If not an operand, must be an address with PLUS and MULT so
do the computation. */
if (! general_operand (x, VOIDmode))
x = force_operand (x, temp);
if (GET_MODE (x) != mode && GET_MODE (x) != VOIDmode)
abort ();
if (x != temp)
emit_move_insn (temp, x);
return temp;
}
/* Load X into a register if it is not already one.
Use mode MODE for the register.
X should be valid for mode MODE, but it may be a constant which
is valid for all integer modes; that's why caller must specify MODE.
The caller must not alter the value in the register we return,
since we mark it as a "constant" register. */
rtx
force_reg (mode, x)
enum machine_mode mode;
rtx x;
{
register rtx temp, insn;
if (GET_CODE (x) == REG)
return x;
temp = gen_reg_rtx (mode);
insn = emit_move_insn (temp, x);
/* Let optimizers know that TEMP's value never changes
and that X can be substituted for it. */
if (CONSTANT_P (x))
REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUIV, x, REG_NOTES (insn));
return temp;
}
/* If X is a memory ref, copy its contents to a new temp reg and return
that reg. Otherwise, return X. */
rtx
force_not_mem (x)
rtx x;
{
register rtx temp;
if (GET_CODE (x) != MEM || GET_MODE (x) == BLKmode)
return x;
temp = gen_reg_rtx (GET_MODE (x));
emit_move_insn (temp, x);
return temp;
}
/* Copy X to TARGET (if it's nonzero and a reg)
or to a new temp reg and return that reg. */
rtx
copy_to_suggested_reg (x, target)
rtx x, target;
{
register rtx temp;
if (target && GET_CODE (target) == REG)
temp = target;
else
temp = gen_reg_rtx (GET_MODE (x));
emit_move_insn (temp, x);
return temp;
}
/* Adjust the stack pointer by ADJUST (an rtx for a number of bytes).
This pops when ADJUST is positive. ADJUST need not be constant. */
void
adjust_stack (adjust)
rtx adjust;
{
adjust = protect_from_queue (adjust, 0);
#ifdef STACK_GROWS_DOWNWARD
emit_insn (gen_add2_insn (stack_pointer_rtx, adjust));
#else
emit_insn (gen_sub2_insn (stack_pointer_rtx, adjust));
#endif
}
/* Adjust the stack pointer by minus ADJUST (an rtx for a number of bytes).
This pushes when ADJUST is positive. ADJUST need not be constant. */
void
anti_adjust_stack (adjust)
rtx adjust;
{
adjust = protect_from_queue (adjust, 0);
#ifdef STACK_GROWS_DOWNWARD
emit_insn (gen_sub2_insn (stack_pointer_rtx, adjust));
#else
emit_insn (gen_add2_insn (stack_pointer_rtx, adjust));
#endif
}
/* Round the size of a block to be pushed up to the boundary required
by this machine. SIZE is the desired size, which need not be constant. */
rtx
round_push (size)
rtx size;
{
#ifdef STACK_BOUNDARY
int align = STACK_BOUNDARY / BITS_PER_UNIT;
if (align == 1)
return size;
if (GET_CODE (size) == CONST_INT)
{
int new = (INTVAL (size) + align - 1) / align * align;
if (INTVAL (size) != new)
size = gen_rtx (CONST_INT, VOIDmode, new);
}
else
{
size = expand_divmod (0, CEIL_DIV_EXPR, Pmode, size,
gen_rtx (CONST_INT, VOIDmode, align),
0, 1);
size = expand_mult (Pmode, size,
gen_rtx (CONST_INT, VOIDmode, align),
0, 1);
}
#endif /* STACK_BOUNDARY */
return size;
}
/* Return an rtx representing the register or memory location
in which a scalar value of data type VALTYPE
was returned by a function call to function FUNC.
FUNC is a FUNCTION_DECL node if the precise function is known,
otherwise 0. */
rtx
hard_function_value (valtype, func)
tree valtype;
tree func;
{
return FUNCTION_VALUE (valtype, func);
}
/* Return an rtx representing the register or memory location
in which a scalar value of mode MODE was returned by a library call. */
rtx
hard_libcall_value (mode)
enum machine_mode mode;
{
return LIBCALL_VALUE (mode);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,409 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Definitions for code generation pass of GNU compiler.
Copyright (C) 1987 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Macros to access the slots of a QUEUED rtx.
Here rather than in rtl.h because only the expansion pass
should ever encounter a QUEUED. */
/* The variable for which an increment is queued. */
#define QUEUED_VAR(P) XEXP (P, 0)
/* If the increment has been emitted, this is the insn
that does the increment. It is zero before the increment is emitted. */
#define QUEUED_INSN(P) XEXP (P, 1)
/* If a pre-increment copy has been generated, this is the copy
(it is a temporary reg). Zero if no copy made yet. */
#define QUEUED_COPY(P) XEXP (P, 2)
/* This is the body to use for the insn to do the increment.
It is used to emit the increment. */
#define QUEUED_BODY(P) XEXP (P, 3)
/* Next QUEUED in the queue. */
#define QUEUED_NEXT(P) XEXP (P, 4)
/* This is the 4th arg to `expand_expr'.
EXPAND_SUM means it is ok to return a PLUS rtx or MULT rtx.
EXPND_CONST_ADDRESS means it is ok to return a MEM whose address
is a constant that is not a legitimate address. */
enum expand_modifier {EXPAND_NORMAL, EXPAND_SUM, EXPAND_CONST_ADDRESS};
/* If this is nonzero, we do not bother generating VOLATILE
around volatile memory references, and we are willing to
output indirect addresses. If cse is to follow, we reject
indirect addresses so a useful potential cse is generated;
if it is used only once, instruction combination will produce
the same indirect address eventually. */
extern int cse_not_expected;
/* List (chain of EXPR_LISTs) of pseudo-regs of SAVE_EXPRs.
So we can mark them all live at the end of the function, if stupid. */
extern rtx save_expr_regs;
extern int current_function_calls_alloca;
/* This is the offset from the arg pointer to the place where the first
anonymous arg can be found, if there is one. */
extern rtx current_function_arg_offset_rtx;
/* Nonzero means stack pops must not be deferred, and deferred stack
pops must not be output. It is nonzero inside a function call,
inside a conditional expression, inside a statement expression,
and in other cases as well. */
extern int inhibit_defer_pop;
#define NO_DEFER_POP (inhibit_defer_pop += 1)
#define OK_DEFER_POP (inhibit_defer_pop -= 1)
#ifdef TREE_CODE /* Don't lose if tree.h not included. */
/* Structure to record the size of a sequence of arguments
as the sum of a tree-expression and a constant. */
struct args_size
{
int constant;
tree var;
};
#endif
/* Add the value of the tree INC to the `struct args_size' TO. */
#define ADD_PARM_SIZE(TO, INC) \
{ tree inc = (INC); \
if (TREE_CODE (inc) == INTEGER_CST) \
(TO).constant += TREE_INT_CST_LOW (inc); \
else if ((TO).var == 0) \
(TO).var = inc; \
else \
(TO).var = genop (PLUS_EXPR, (TO).var, inc); }
#define SUB_PARM_SIZE(TO, DEC) \
{ tree dec = (DEC); \
if (TREE_CODE (dec) == INTEGER_CST) \
(TO).constant -= TREE_INT_CST_LOW (dec); \
else if ((TO).var == 0) \
(TO).var = genop (MINUS_EXPR, integer_zero_node, dec); \
else \
(TO).var = genop (MINUS_EXPR, (TO).var, dec); }
/* Convert the implicit sum in a `struct args_size' into an rtx. */
#define ARGS_SIZE_RTX(SIZE) \
((SIZE).var == 0 ? gen_rtx (CONST_INT, VOIDmode, (SIZE).constant) \
: plus_constant (expand_expr ((SIZE).var, 0, VOIDmode, 0), \
(SIZE).constant))
/* Supply a default definition for FUNCTION_ARG_PADDING:
usually pad upward, but pad short args downward on big-endian machines. */
enum direction {none, upward, downward}; /* Value has this type. */
#ifndef FUNCTION_ARG_PADDING
#ifdef BYTES_BIG_ENDIAN
#define FUNCTION_ARG_PADDING(mode, size) \
(((mode) == BLKmode \
? (GET_CODE (size) == CONST_INT \
&& INTVAL (size) < PARM_BOUNDARY / BITS_PER_UNIT) \
: GET_MODE_BITSIZE (mode) < PARM_BOUNDARY) \
? downward : upward)
#else
#define FUNCTION_ARG_PADDING(mode, size) upward
#endif
#endif
/* Nonzero if type TYPE should be returned in memory
(even though its mode is not BLKmode).
Most machines can use the following default definition. */
#ifndef RETURN_IN_MEMORY
#define RETURN_IN_MEMORY(type) 0
#endif
/* Optabs are tables saying how to generate insn bodies
for various machine modes and numbers of operands.
Each optab applies to one operation.
For example, add_optab applies to addition.
The insn_code slot is the enum insn_code that says how to
generate an insn for this operation on a particular machine mode.
It is CODE_FOR_nothing if there is no such insn on the target machine.
The `lib_call' slot is the name of the library function that
can be used to perform the operation.
A few optabs, such as move_optab and cmp_optab, are used
by special code. */
/* Everything that uses expr.h needs to define enum insn_code
but we don't list it in the Makefile dependencies just for that. */
#include "insn-codes.h"
typedef struct optab
{
enum rtx_code code;
struct {
enum insn_code insn_code;
char *lib_call;
} handlers [NUM_MACHINE_MODES];
} * optab;
/* Given an enum insn_code, access the function to construct
the body of that kind of insn. */
#define GEN_FCN(CODE) (*insn_gen_function[(int) (CODE)])
extern rtx (*insn_gen_function[]) ();
extern optab add_optab;
extern optab sub_optab;
extern optab smul_optab; /* Signed multiply */
extern optab umul_optab; /* Unsigned multiply */
extern optab smul_widen_optab; /* Signed multiply with result
one machine mode wider than args */
extern optab umul_widen_optab;
extern optab sdiv_optab; /* Signed divide */
extern optab sdivmod_optab; /* Signed divide-and-remainder in one */
extern optab udiv_optab;
extern optab udivmod_optab;
extern optab smod_optab; /* Signed remainder */
extern optab umod_optab;
extern optab flodiv_optab; /* Optab for floating divide. */
extern optab ftrunc_optab; /* Convert float to integer in float fmt */
extern optab and_optab; /* Logical and */
extern optab andcb_optab; /* Logical and with complement of 2nd arg */
extern optab ior_optab; /* Logical or */
extern optab xor_optab; /* Logical xor */
extern optab ashl_optab; /* Arithmetic shift left */
extern optab ashr_optab; /* Arithmetic shift right */
extern optab lshl_optab; /* Logical shift left */
extern optab lshr_optab; /* Logical shift right */
extern optab rotl_optab; /* Rotate left */
extern optab rotr_optab; /* Rotate right */
extern optab mov_optab; /* Move instruction. */
extern optab movstrict_optab; /* Move, preserving high part of register. */
extern optab cmp_optab; /* Compare insn; two operands. */
extern optab tst_optab; /* tst insn; compare one operand against 0 */
/* Unary operations */
extern optab neg_optab; /* Negation */
extern optab abs_optab; /* Abs value */
extern optab one_cmpl_optab; /* Bitwise not */
extern optab ffs_optab; /* Find first bit set */
/* Passed to expand_binop and expand_unop to say which options to try to use
if the requested operation can't be open-coded on the requisite mode.
Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using a library call.
Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try using a wider mode.
OPTAB_MUST_WIDEN says try widening and don't try anything else. */
enum optab_methods
{
OPTAB_DIRECT,
OPTAB_LIB,
OPTAB_WIDEN,
OPTAB_LIB_WIDEN,
OPTAB_MUST_WIDEN
};
typedef rtx (*rtxfun) ();
/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
gives the gen_function to make a branch to test that condition. */
extern rtxfun bcc_gen_fctn[NUM_RTX_CODE];
/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
gives the gen_function to make a store-condition insn
to test that condition. */
extern rtxfun setcc_gen_fctn[NUM_RTX_CODE];
/* Expand a binary operation given optab and rtx operands. */
rtx expand_binop ();
/* Expand a binary operation with both signed and unsigned forms. */
rtx sign_expand_binop ();
/* Expand a unary arithmetic operation given optab rtx operand. */
rtx expand_unop ();
/* Arguments MODE, RTX: return an rtx for the negation of that value.
May emit insns. */
rtx negate_rtx ();
/* Initialize the tables that control conversion between fixed and
floating values. */
void init_fixtab ();
void init_floattab ();
/* Generate code for a FIX_EXPR. */
void expand_fix ();
/* Generate code for a FLOAT_EXPR. */
void expand_float ();
/* Create but don't emit one rtl instruction to add one rtx into another.
Modes must match.
Likewise for subtraction and for just copying.
These do not call protect_from_queue; caller must do so. */
rtx gen_add2_insn ();
rtx gen_sub2_insn ();
rtx gen_move_insn ();
/* Emit one rtl instruction to store zero in specified rtx. */
void emit_clr_insn ();
/* Emit one rtl insn to store 1 in specified rtx assuming it contains 0. */
void emit_0_to_1_insn ();
/* Emit one rtl insn to compare two rtx's. */
void emit_cmp_insn ();
/* Emit some rtl insns to move data between rtx's, converting machine modes.
Both modes must be floating or both fixed. */
void convert_move ();
/* Convert an rtx to specified machine mode and return the result. */
rtx convert_to_mode ();
/* Emit code to push some arguments and call a library routine,
storing the value in a specified place. Calling sequence is
complicated. */
void emit_library_call ();
/* Given an rtx that may include add and multiply operations,
generate them as insns and return a pseudo-reg containing the value.
Useful after calling expand_expr with 1 as sum_ok. */
rtx force_operand ();
/* Return an rtx for the size in bytes of the value of an expr. */
rtx expr_size ();
/* Return an rtx for the sum of an rtx and an integer. */
rtx plus_constant ();
rtx lookup_static_chain ();
/* Return an rtx like arg but sans any constant terms.
Returns the original rtx if it has no constant terms.
The constant terms are added and stored via a second arg. */
rtx eliminate_constant_term ();
/* Convert arg to a valid memory address for specified machine mode,
by emitting insns to perform arithmetic if nec. */
rtx memory_address ();
/* Like `memory_address' but pretent `flag_force_addr' is 0. */
rtx memory_address_noforce ();
/* Return a memory reference like MEMREF, but with its mode changed
to MODE and its address changed to ADDR.
(VOIDmode means don't change the mode.
NULL for ADDR means don't change the address.) */
rtx change_address ();
/* Return 1 if two rtx's are equivalent in structure and elements. */
int rtx_equal_p ();
/* Given rtx, return new rtx whose address won't be affected by
any side effects. It has been copied to a new temporary reg. */
rtx stabilize ();
/* Given an rtx, copy all regs it refers to into new temps
and return a modified copy that refers to the new temps. */
rtx copy_all_regs ();
/* Copy given rtx to a new temp reg and return that. */
rtx copy_to_reg ();
/* Like copy_to_reg but always make the reg Pmode. */
rtx copy_addr_to_reg ();
/* Like copy_to_reg but always make the reg the specified mode MODE. */
rtx copy_to_mode_reg ();
/* Copy given rtx to given temp reg and return that. */
rtx copy_to_suggested_reg ();
/* Copy a value to a register if it isn't already a register.
Args are mode (in case value is a constant) and the value. */
rtx force_reg ();
/* Return given rtx, copied into a new temp reg if it was in memory. */
rtx force_not_mem ();
/* Remove some bytes from the stack. An rtx says how many. */
void adjust_stack ();
/* Add some bytes to the stack. An rtx says how many. */
void anti_adjust_stack ();
/* Emit code to copy function value to a new temp reg and return that reg. */
rtx function_value ();
/* Return an rtx that refers to the value returned by a function
in its original home. This becomes invalid if any more code is emitted. */
rtx hard_function_value ();
/* Return an rtx that refers to the value returned by a library call
in its original home. This becomes invalid if any more code is emitted. */
rtx hard_libcall_value ();
/* Emit code to copy function value to a specified place. */
void copy_function_value ();
/* Given an rtx, return an rtx for a value rounded up to a multiple
of STACK_BOUNDARY / BITS_PER_UNIT. */
rtx round_push ();
rtx store_bit_field ();
rtx extract_bit_field ();
rtx expand_shift ();
rtx expand_bit_and ();
rtx expand_mult ();
rtx expand_divmod ();
rtx expand_mult_add ();
rtx get_structure_value_addr ();
rtx expand_stmt_expr ();
void jumpifnot ();
void jumpif ();
void do_jump ();
rtx assemble_static_space ();

File diff suppressed because it is too large Load Diff

View File

@ -1,109 +0,0 @@
#!/bin/sh
#
# NAME:
# fixcpp - fix CPP errors
#
# SYNOPSIS:
# fixcpp [-c][-p patch_file][-b bak_dir][-n new_dir] files(s)
#
# DESCRIPTION:
# For each named file, use sed(1) to fixup any descriptive
# text after #else or #endif or that is not properly
# commented as this causes ANSI compilers to generate
# unnecessary warnings.
#
# Naturally this script is not guaranteed to be bullit
# proof, use of -n or -b is advisable!
#
# -c causes fixcpp to make sure that only files that
# needed changing are affected by returning the original
# file to its original location if no changes were needed.
#
# -p causes fixcpp to append to a patch file the context
# diffs of the changes wraught.
#
# SEE ALSO:
# sed(1)
#
# AMENDED:
# 90/08/08 22:46:32 (sjg)
#
# RELEASED:
# 90/08/08 22:46:34 v1.4
#
# SCCSID:
# @(#)fixcpp.sh 1.4 90/08/08 22:46:32 (sjg)
#
# @(#)Copyright (c) 1990 Simon J. Gerraty
#
# This is free software. It comes with NO WARRANTY.
# Everyone is granted permission to copy, modify and
# redistribute this source code provided that all
# recipients are given similar rights, and that the above
# copyright notice and this notice are preserved in all
# copies.
TMPF=/tmp/fixcpp.$$
NEWDIR=
BAKDIR=
PATCHF=
CHECK=
set -- `getopt "cp:b:n:" $*`
if [ $? != 0 ]; then
echo "$0 [-c][-p patch_file][-b bakup_dir][-n new_dir] file [file ...]" >&2
exit 1
fi
for i in $*
do
case $i in
-c) CHECK=yes; shift;;
-p) PATCHF=$2; shift 2;;
-b) BAKDIR=$2; shift 2;;
-n) NEWDIR=$2; shift 2;;
--) shift; break;;
esac
done
NEWDIR=${NEWDIR:-.}
if [ $BAKDIR ]; then
if [ ! -d $BAKDIR ]; then
echo "$0: no such directory -- $BAKDIR" >&2
exit 1
fi
fi
for i in $*
do
if [ $BAKDIR ]; then
mv $i $BAKDIR
infile=$BAKDIR/$i
else
if [ "$NEWDIR" = "." ]; then
mv $i ${TMPF}
infile=${TMPF}
else
infile=$i
fi
fi
sed -e 's;^#\([ ]*e[nl][^ ]*[ ][ ]*\)\([^/ ][^\*].*\);#\1/* \2 */;' -e 's;^#\([ ]*e[nl][^ ]*[ ][ ]*\)\([^/ ]\)$;#\1/* \2 */;' $infile >${NEWDIR}/$i
if [ "${CHECK}" = "yes" -o ${PATCHF} ]; then
if cmp -s $infile ${NEWDIR}/$i ; then
if [ "${CHECK}" = "yes" ]; then
if [ $BAKDIR ]; then
mv $infile ${NEWDIR}/$i
else
rm ${NEWDIR}/$i
fi
fi
else
if [ $PATCHF ]; then
diff -c $infile ${NEWDIR}/$i >> ${PATCHF}
fi
fi
fi
done
rm -f ${TMPF}

View File

@ -1,481 +0,0 @@
#! /bin/sh
# Install modified versions of certain ANSI-incompatible system header files
# which are fixed to work correctly with ANSI C
# and placed in a directory that GNU C will search.
# This works properly on a Sun in system version 3.4;
# for other versions, you had better check.
# Directory containing the original header files.
INCLUDES=${2-${INCLUDES-/usr/include}}
# Directory in which to store the results.
LIB=${LIB-/usr/local/lib/gcc-include}
# Make sure it exists.
if [ ! -d $LIB ]; then
mkdir $LIB || exit 1
fi
# Determine whether this system has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
rm -f $LIB/ShouldNotExist
LINKS=true
else
LINKS=false
fi
echo Finding directories and links to directories
cd ${INCLUDES}
# Find all directories and all symlinks that point to directories.
# Put the list in $files.
# Each time we find a symlink, add it to newdirs
# so that we do another find within the dir the link points to.
# Note that $files may have duplicates in it;
# later parts of this file are supposed to ignore them.
dirs="."
levels=2
while [ -n "$dirs" ] && [ $levels -gt 0 ]
do
levels=`expr $levels - 1`
newdirs=
for d in $dirs
do
echo " Searching $INCLUDES/$d"
if [ "$d" != . ]
then
d=$d/.
fi
# Find all directories under $d, relative to $d, excluding $d itself.
files="$files `find $d -type d -print | \
sed -e '/\/\.$/d' -e '/^\.$/d'`"
# Find all links to directories.
# Using `-exec test -d' in find fails on some systems,
# and trying to run test via sh fails on others,
# so this is the simplest alternative left.
# First find all the links, then test each one.
theselinks=
$LINKS && \
theselinks=`find $d -type l -print`
for d1 in $theselinks --dummy--
do
# If the link points to a directory,
# add that dir to $newdirs
if [ -d $d1 ]
then
newdirs="$newdirs $d1"
fi
done
done
files="$files $newdirs"
dirs="$newdirs"
done
dirs=
echo "All directories (including links to directories):"
echo $files
for file in $files; do
rm -rf $LIB/$file
if [ ! -d $LIB/$file ]
then mkdir $LIB/$file
fi
done
mkdir $LIB/root
# treetops gets an alternating list
# of old directories to copy
# and the new directories to copy to.
treetops="${INCLUDES} ${LIB}"
if $LINKS; then
echo 'Making symbolic directory links'
for file in $files; do
dest=`ls -ld $file | sed -n 's/.*-> //p'`
if [ "$dest" ]; then
cwd=`pwd`
# In case $dest is relative, get to $file's dir first.
cd ${INCLUDES}
cd `echo ./$file | sed -n 's&[^/]*$&&p'`
# Check that the target directory exists.
# Redirections changed to avoid bug in sh on Ultrix.
(cd $dest) > /dev/null 2>&1
if [ $? = 0 ]; then
cd $dest
# X gets the dir that the link actually leads to.
x=`pwd`
# If a link points to ., make a similar link to .
if [ $x = $INCLUDES ]; then
echo $file '->' . ': Making link'
rm -fr ${LIB}/$file > /dev/null 2>&1
ln -s . ${LIB}/$file > /dev/null 2>&1
# If link leads back into ${INCLUDES},
# make a similar link here.
elif expr $x : "${INCLUDES}/.*" > /dev/null; then
# Y gets the actual target dir name, relative to ${INCLUDES}.
y=`echo $x | sed -n "s&${INCLUDES}/&&p"`
echo $file '->' $y ': Making link'
rm -fr ${LIB}/$file > /dev/null 2>&1
ln -s ${LIB}/$y ${LIB}/$file > /dev/null 2>&1
else
# If the link is to a dir $target outside ${INCLUDES},
# repoint the link at ${INCLUDES}/root$target
# and process $target into ${INCLUDES}/root$target
# treat this directory as if it actually contained the files.
echo $file '->' root$x ': Making link'
if [ -d $LIB/root$x ]
then true
else
dirname=root$x/
dirmade=.
cd $LIB
while [ x$dirname != x ]; do
component=`echo $dirname | sed -e 's|/.*$||'`
mkdir $component >/dev/null 2>&1
cd $component
dirmade=$dirmade/$component
dirname=`echo $dirname | sed -e 's|[^/]*/||'`
done
fi
rm -fr ${LIB}/$file > /dev/null 2>&1
ln -s ${LIB}/root$x ${LIB}/$file > /dev/null 2>&1
treetops="$treetops $x ${LIB}/root$x"
fi
fi
cd $cwd
fi
done
fi
set - $treetops
while [ $# != 0 ]; do
# $1 is an old directory to copy, and $2 is the new directory to copy to.
cd ${INCLUDES}
cd $1
# The same dir can appear more than once in treetops.
# There's no need to scan it more than once.
if [ -f $2/DONE ]
then
files=
else
touch $2/DONE
echo Fixing directory $1 into $2
# Check .h files which are symlinks as well as those which are files.
# A link to a header file will not be processed by anything but this.
if $LINKS; then
files=`find . -name '*.h' \( -type f -o -type l \) -print`
else
files=`find . -name '*.h' -type f -print`
fi
echo Checking header files
fi
# Note that BSD43_* are used on recent MIPS systems.
for file in $files; do
# This call to egrep is essential, since checking a file with egrep
# is much faster than actually trying to fix it.
# It is also essential that most files *not* match!
# Thus, matching every #endif is unacceptable.
# But the argument to egrep must be kept small, or many versions of egrep
# won't be able to handle it.
# rms: I removed `|#[el].*if.*[^/ ]' because it made egrep fail.
if egrep '[ _]_IO|CTRL|#define.NULL|#[el]*if.*([0-9]|sparc|vax|sun|pyr)' $file > /dev/null; then
echo Fixing $file
if [ -r $file ]; then
cp $file $2/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w $2/$file
# Following two lines removed.
# s%^\([ ]*#[ ]*endif[ ]*\)\([^/ ].*\)$%\1/* \2 */%
# s%^\([ ]*#[ ]*else[ ]*\)\([^/ ].*\)$%\1/* \2 */%
sed -e '
:loop
/\\$/ N
/\\$/ b loop
/[ ]_IO[A-Z]*[ ]*(/ s/(\(.\),/('\''\1'\'',/
/[ ]BSD43__IO[A-Z]*[ ]*(/ s/(\(.\),/('\''\1'\'',/
/#define._IO/ s/'\''x'\''/x/g
/#define.BSD43__IO/ s/'\''x'\''/x/g
/[^A-Z]CTRL[ ]*(/ s/\([^'\'']\))/'\''\1'\'')/
/#define.CTRL/ s/'\''c'\''/c/g
/#define._CTRL/ s/'\''c'\''/c/g
/#define.BSD43_CTRL/ s/'\''c'\''/c/g
/#if.* m68k$/ s/m68k/__m68k__/g
/#if.*defined *(m68k)/ s/m68k/__m68k__/g
' $2/$file > $2/$file.sed
mv $2/$file.sed $2/$file
if cmp $file $2/$file >/dev/null 2>&1; then
echo Deleting $2/$file\; no fixes were needed.
rm $2/$file
fi
fi
fi
done
shift; shift
done
cd ${INCLUDES}
# Fix one other error in this file: a mismatched quote not inside a C comment.
file=sundev/vuid_event.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file comment
ex ${LIB}/$file <<EOF
g/doesn't/s/doesn't/does not/
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Fix this Sun file to avoid intefering with stddef.h.
file=sys/stdtypes.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file comment
ex ${LIB}/$file <<EOF
/size_t.*;/
i
#ifndef _SIZE_T
#define _SIZE_T
.
/size_t/+1
i
#endif
.
/ptrdiff_t.*;/
i
#ifndef _PTRDIFF_T
#define _PTRDIFF_T
.
/ptrdiff_t/+1
i
#endif
.
/wchar_t.*;/
i
#ifndef _WCHAR_T
#define _WCHAR_T
.
/wchar_t/+1
i
#endif
.
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Fix an error in this file: a missing semi-colon at the end of the statsswtch
# structure definition.
file=rpcsvc/rstat.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, definition of statsswtch
ex ${LIB}/$file <<EOF
g/boottime$/s//&;/
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Fix an error in this file: a missing semi-colon at the end of the nodeent
# structure definition.
file=netdnet/dnetdb.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, definition of nodeent
ex ${LIB}/$file <<EOF
g/na_addr/s//&;/
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Check for bad #ifdef line (in Ultrix 4.1)
file=sys/file.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/rpcsvc 2>&-
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, bad \#ifdef line
ex ${LIB}/$file <<EOF
g/^#ifdef KERNEL && !defined/
s/#ifdef KERNEL && !defined/#if defined(KERNEL) \&\& !defined/
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Check for superfluous `static' (in Ultrix 4.2)
file=machine/cpu.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/machine 2>&-
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, superfluous static
ex ${LIB}/$file <<EOF
g/^static struct tlb_pid_state/
s/static//
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
else
# This file has an alternative name, mips/cpu.h. Fix that name, too.
if cmp machine/cpu.h mips/cpu.h > /dev/null 2>& 1; then
mkdir ${LIB}/mips 2>&-
ln ${LIB}/$file ${LIB}/mips/cpu.h
fi
fi
fi
# Deal with yet another challenge, this in X11/Xmu.h
file=X11/Xmu.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/X11 2>&-
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file sprintf declaration
ex ${LIB}/$file <<EOF
/^extern char \* sprintf();$/c
#ifndef __STDC__
extern char * sprintf();
#endif /* !defined __STDC__ */
.
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Check for missing ';' in struct
file=netinet/ip.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/netinet 2>&-
sed -e '/^struct/,/^};/s/}$/};/' $file > ${LIB}/$file
cmp $file ${LIB}/$file >/dev/null 2>&1 && rm -f ${LIB}/$file
fi
fi
# Fix the CAT macro in memvar.h.
file=pixrect/memvar.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/pixrect 2>&-
sed -e '/^#define.CAT(a,b)/ i\
#ifdef __STDC__ \
#define CAT(a,b) a##b\
#else
/^#define.CAT(a,b)/ a\
#endif
' $file > ${LIB}/$file
cmp $file ${LIB}/$file >/dev/null 2>&1 && rm -f ${LIB}/$file
fi
fi
# Check for yet more missing ';' in struct (in SunOS 4.0.x)
file=rpcsvc/rusers.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/rpcsvc 2>&-
sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' $file > ${LIB}/$file
cmp $file ${LIB}/$file >/dev/null 2>&1 && rm -f ${LIB}/$file
fi
fi
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`
for file in $files; do
rmdir $LIB/$file > /dev/null 2>&1
done
if $LINKS; then
echo 'Making internal symbolic non-directory links'
cd ${INCLUDES}
files=`find . -type l -print`
for file in $files; do
dest=`ls -ld $file | sed -n 's/.*-> //p'`
if expr "$dest" : '[^/].*' > /dev/null; then
target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"`
if [ -f $target ]; then
ln -s $dest ${LIB}/$file >/dev/null 2>&1
fi
fi
done
fi
exit 0

View File

@ -1,389 +0,0 @@
#! /bin/sh
# Install modified versions of certain ANSI-incompatible system header files
# which are fixed to work correctly with ANSI C
# and placed in a directory that GNU C will search.
# This works properly on a Sun in system version 3.4;
# for other versions, you had better check.
# Directory containing the original header files.
INCLUDES=${2-${INCLUDES-/usr/include}}
# Directory in which to store the results.
LIB=${LIB-/usr/local/lib/gcc-include}
# Make sure it exists.
if [ ! -d $LIB ]; then
mkdir $LIB || exit 1
fi
# Determine whether this system has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
rm -f $LIB/ShouldNotExist
LINKS=true
else
LINKS=false
fi
echo 'Making directories:'
cd ${INCLUDES}
if $LINKS; then
files=`ls -LR | sed -n s/:$//p`
else
files=`find . -type d -print | sed '/^.$/d'`
fi
for file in $files; do
rm -rf $LIB/$file
if [ ! -d $LIB/$file ]
then mkdir $LIB/$file
fi
done
# treetops gets an alternating list
# of old directories to copy
# and the new directories to copy to.
treetops="${INCLUDES} ${LIB}"
if $LINKS; then
echo 'Making internal symbolic directory links'
for file in $files; do
dest=`ls -ld $file | sed -n 's/.*-> //p'`
if [ "$dest" ]; then
cwd=`pwd`
# In case $dest is relative, get to $file's dir first.
cd ${INCLUDES}
cd `echo ./$file | sed -n 's&[^/]*$&&p'`
# Check that the target directory exists.
# Redirections changed to avoid bug in sh on Ultrix.
(cd $dest) > /dev/null 2>&1
if [ $? = 0 ]; then
cd $dest
# X gets the dir that the link actually leads to.
x=`pwd`
# If link leads back into ${INCLUDES},
# make a similar link here.
if expr $x : '${INCLUDES}/.*' > /dev/null; then
# Y gets the actual target dir name, relative to ${INCLUDES}.
y=`echo $x | sed -n 's&${INCLUDES}/&&p'`
echo $file '->' $y ': Making link'
rm -fr ${LIB}/$file > /dev/null 2>&1
ln -s ${LIB}/$y ${LIB}/$file > /dev/null 2>&1
else
# If the link is to outside ${INCLUDES},
# treat this directory as if it actually contained the files.
# This line used to have $dest instead of $x.
# $dest seemed to be wrong for links found in subdirectories
# of ${INCLUDES}. Does this change break anything?
treetops="$treetops $x ${LIB}/$file"
fi
fi
cd $cwd
fi
done
fi
set - $treetops
while [ $# != 0 ]; do
# $1 is an old directory to copy, and $2 is the new directory to copy to.
echo "Finding header files in $1:"
cd ${INCLUDES}
cd $1
files=`find . -name '*.h' -type f -print`
echo 'Checking header files:'
# Note that BSD43_* are used on recent MIPS systems.
for file in $files; do
if egrep '[ ]_IO[A-Z]*\(|[ ]BSD43__IO[A-Z]*\(|#define._IO|#define.BSD43__IO|CTRL' $file > /dev/null; then
echo Fixing $file
if [ -r $file ]; then
cp $file $2/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w $2/$file
sed -e '
:loop
/\\$/ N
/\\$/ b loop
/[ ]_IO[A-Z]*[ ]*(/ s/(\(.\),/('\''\1'\'',/
/[ ]BSD43__IO[A-Z]*[ ]*(/ s/(\(.\),/('\''\1'\'',/
/#define._IO/ s/'\''x'\''/x/g
/#define.BSD43__IO/ s/'\''x'\''/x/g
/[^A-Z]CTRL[ ]*(/ s/\([^'\'']\))/'\''\1'\'')/
/#define.CTRL/ s/'\''c'\''/c/g
/#define._CTRL/ s/'\''c'\''/c/g
/#define.BSD43_CTRL/ s/'\''c'\''/c/g
/#if.* m68k$/ s/m68k/__m68k__/g
/#if.*defined *(m68k)/ s/m68k/__m68k__/g
' $2/$file > $2/$file.sed
mv $2/$file.sed $2/$file
if cmp $file $2/$file >/dev/null 2>&1; then
echo Deleting $2/$file\; no fixes were needed.
rm $2/$file
fi
fi
fi
done
shift; shift
done
cd ${INCLUDES}
# Fix one other error in this file: a mismatched quote not inside a C comment.
file=sundev/vuid_event.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file comment
ex ${LIB}/$file <<EOF
g/doesn't/s/doesn't/does not/
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Fix this Sun file to avoid intefering with stddef.h.
file=sys/stdtypes.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file comment
ex ${LIB}/$file <<EOF
/size_t.*;/
i
#ifndef _SIZE_T
#define _SIZE_T
.
/size_t/+1
i
#endif
.
/ptrdiff_t.*;/
i
#ifndef _PTRDIFF_T
#define _PTRDIFF_T
.
/ptrdiff_t/+1
i
#endif
.
/wchar_t.*;/
i
#ifndef _WCHAR_T
#define _WCHAR_T
.
/wchar_t/+1
i
#endif
.
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Fix an error in this file: a missing semi-colon at the end of the statsswtch
# structure definition.
file=rpcsvc/rstat.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, definition of statsswtch
ex ${LIB}/$file <<EOF
g/boottime$/s//&;/
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Fix an error in this file: a missing semi-colon at the end of the nodeent
# structure definition.
file=netdnet/dnetdb.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, definition of nodeent
ex ${LIB}/$file <<EOF
g/na_addr/s//&;/
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Check for bad #ifdef line (in Ultrix 4.1)
file=sys/file.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/rpcsvc 2>&-
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, bad \#ifdef line
ex ${LIB}/$file <<EOF
g/^#ifdef KERNEL && !defined/
s/#ifdef KERNEL && !defined/#if defined(KERNEL) \&\& !defined/
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Check for superfluous `static' (in Ultrix 4.2)
file=machine/cpu.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/machine 2>&-
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, superfluous static
ex ${LIB}/$file <<EOF
g/^static struct tlb_pid_state/
s/static//
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
else
# This file has an alternative name, mips/cpu.h. Fix that name, too.
if cmp machine/cpu.h mips/cpu.h > /dev/null 2>& 1; then
mkdir ${LIB}/mips 2>&-
ln ${LIB}/$file ${LIB}/mips/cpu.h
fi
fi
fi
# Deal with yet another challenge, this in X11/Xmu.h
file=X11/Xmu.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/X11 2>&-
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file sprintf declaration
ex ${LIB}/$file <<EOF
/^extern char \* sprintf();$/c
#ifndef __STDC__
extern char * sprintf();
#endif /* !defined __STDC__ */
.
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Check for missing ';' in struct
file=netinet/ip.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/netinet 2>&-
sed -e '/^struct/,/^};/s/}$/};/' $file > ${LIB}/$file
cmp $file ${LIB}/$file >/dev/null 2>&1 && rm -f ${LIB}/$file
fi
fi
# Fix the CAT macro in memvar.h.
file=pixrect/memvar.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/pixrect 2>&-
sed -e '/^#define.CAT(a,b)/ i\
#ifdef __STDC__ \
#define CAT(a,b) a##b\
#else
/^#define.CAT(a,b)/ a\
#endif
' $file > ${LIB}/$file
cmp $file ${LIB}/$file >/dev/null 2>&1 && rm -f ${LIB}/$file
fi
fi
# Check for yet more missing ';' in struct (in SunOS 4.0.x)
file=rpcsvc/rusers.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/rpcsvc 2>&-
sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' $file > ${LIB}/$file
cmp $file ${LIB}/$file >/dev/null 2>&1 && rm -f ${LIB}/$file
fi
fi
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`
for file in $files; do
rmdir $LIB/$file > /dev/null 2>&1
done
if $LINKS; then
echo 'Making internal symbolic non-directory links'
cd ${INCLUDES}
files=`find . -type l -print`
for file in $files; do
dest=`ls -ld $file | sed -n 's/.*-> //p'`
if expr "$dest" : '[^/].*' > /dev/null; then
target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"`
if [ -f $target ]; then
ln -s $dest ${LIB}/$file >/dev/null 2>&1
fi
fi
done
fi
exit 0

View File

@ -1,261 +0,0 @@
#! /bin/sh
# Install modified versions of certain ANSI-incompatible system header files
# which are fixed to work correctly with ANSI C
# and placed in a directory that GNU C will search.
# This works properly on a Sun in system version 3.4;
# for other versions, you had better check.
# Directory in which to store the results.
LIB=${LIB-/usr/local/lib/gcc-include}
# Make sure it exists.
if [ ! -d $LIB ]; then
mkdir $LIB || exit 1
fi
# Determine whether this system has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
rm -f $LIB/ShouldNotExist
LINKS=true
else
LINKS=false
fi
echo 'Making directories:'
cd /usr/include
if $LINKS; then
files=`ls -LR | sed -n s/:$//p`
else
files=`find . -type d -print | sed '/^.$/d'`
fi
for file in $files; do
rm -rf $LIB/$file
if [ ! -d $LIB/$file ]
then mkdir $LIB/$file
fi
done
# treetops gets an alternating list
# of old directories to copy
# and the new directories to copy to.
treetops="/usr/include ${LIB}"
if $LINKS; then
echo 'Making internal symbolic directory links'
for file in $files; do
dest=`ls -ld $file | sed -n 's/.*-> //p'`
if [ "$dest" ]; then
cwd=`pwd`
# In case $dest is relative, get to $file's dir first.
cd /usr/include
cd `echo ./$file | sed -n 's&[^/]*$&&p'`
# Check that the target directory exists.
# Redirections changed to avoid bug in sh on Ultrix.
(cd $dest) > /dev/null 2>&1
if [ $? = 0 ]; then
cd $dest
# X gets the dir that the link actually leads to.
x=`pwd`
# If link leads back into /usr/include,
# make a similar link here.
if expr $x : '/usr/include/.*' > /dev/null; then
# Y gets the actual target dir name, relative to /usr/include.
y=`echo $x | sed -n 's&/usr/include/&&p'`
echo $file '->' $y ': Making link'
rm -fr ${LIB}/$file > /dev/null 2>&1
ln -s ${LIB}/$y ${LIB}/$file > /dev/null 2>&1
else
# If the link is to outside /usr/include,
# treat this directory as if it actually contained the files.
# This line used to have $dest instead of $x.
# $dest seemed to be wrong for links found in subdirectories
# of /usr/include. Does this change break anything?
treetops="$treetops $x ${LIB}/$file"
fi
fi
cd $cwd
fi
done
fi
set - $treetops
while [ $# != 0 ]; do
# $1 is an old directory to copy, and $2 is the new directory to copy to.
echo "Finding header files in $1:"
cd /usr/include
cd $1
files=`find . -name '*.h' -type f -print`
echo 'Checking header files:'
for file in $files; do
if egrep '[ ]_IO[A-Z]*\(|#define._IO|CTRL|#machine|#lint' $file > /dev/null; then
echo Fixing $file
if [ -r $file ]; then
cp $file $2/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w $2/$file
sed -e '
:loop
/\\$/ N
/\\$/ b loop
/[ ]_IO[A-Z]*[ ]*(/ s/(\(.\),/('\''\1'\'',/
/#define._IO/ s/'\''x'\''/x/g
/[^A-Z]CTRL[ ]*(/ s/\([^'\'']\))/'\''\1'\'')/
/#define.CTRL/ s/'\''c'\''/c/g
/#define._CTRL/ s/'\''c'\''/c/g
/^[ ]*#[ ]*if/ s/#machine/defined/g
/^[ ]*#[ ]*elif/ s/#machine/defined/g
/^[ ]*#[ ]*if/ s/#lint *(on)/defined(lint)/g
/^[ ]*#[ ]*elif/ s/#lint *(on)/defined(lint)/g
' $2/$file > $2/$file.sed
mv $2/$file.sed $2/$file
if cmp $file $2/$file >/dev/null 2>&1; then
echo Deleting $2/$file\; no fixes were needed.
rm $2/$file
fi
fi
fi
done
shift; shift
done
cd /usr/include
# Fix one other error in this file: a mismatched quote not inside a C comment.
file=sundev/vuid_event.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file comment
ex ${LIB}/$file <<EOF
g/doesn't/s/doesn't/does not/
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Fix an error in this file: a missing semi-colon at the end of the statsswtch
# structure definition.
file=rpcsvc/rstat.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, definition of statsswtch
ex ${LIB}/$file <<EOF
g/boottime$/s//&;/
wq
EOF
if cmp $file $2/$file >/dev/null 2>&1; then
echo Deleting $2/$file\; no fixes were needed.
rm $2/$file
fi
fi
# Deal with yet another challenge, this in X11/Xmu.h
file=X11/Xmu.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/X11 2>&-
cp $file ${LIB}/$file >/dev/null 2>&1 \
|| echo "Can't copy $file"
chmod +w ${LIB}/$file
fi
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file sprintf declaration
ex ${LIB}/$file <<EOF
/^extern char \* sprintf();$/c
#ifndef __STDC__
extern char * sprintf();
#endif /* !defined __STDC__ */
.
wq
EOF
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
echo Deleting ${LIB}/$file\; no fixes were needed.
rm ${LIB}/$file
fi
fi
# Check for missing ';' in struct
file=netinet/ip.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/netinet 2>&-
sed -e '/^struct/,/^};/s/}$/};/' $file > ${LIB}/$file
cmp $file ${LIB}/$file >&- && rm -f ${LIB}/$file
fi
fi
# Fix the CAT macro in memvar.h.
file=pixrect/memvar.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/pixrect 2>&-
sed -e '/^#define.CAT(a,b)/ s/IDENT(a)b/a##b/g' $file > ${LIB}/$file
cmp $file ${LIB}/$file >&- && rm -f ${LIB}/$file
fi
fi
# Check for yet more missing ';' in struct (in SunOS 4.0.x)
file=rpcsvc/rusers.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/rpcsvc 2>&-
sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' $file > ${LIB}/$file
cmp $file ${LIB}/$file >&- && rm -f ${LIB}/$file
fi
fi
# Check for yet more missing ';' in struct (in SunOS 4.0.x)
file=rpcsvc/rusers.h
if [ -r $file ]; then
if [ ! -r ${LIB}/$file ]; then
mkdir ${LIB}/rpcsvc 2>&-
sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' $file > ${LIB}/$file
cmp $file ${LIB}/$file >&- && rm -f ${LIB}/$file
fi
fi
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`
for file in $files; do
rmdir $LIB/$file > /dev/null 2>&1
done
if $LINKS; then
echo 'Making internal symbolic non-directory links'
cd /usr/include
files=`find . -type l -print`
for file in $files; do
dest=`ls -ld $file | sed -n 's/.*-> //p'`
if expr "$dest" : '[^/].*' > /dev/null; then
target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"`
if [ -f $target ]; then
ln -s $dest ${LIB}/$file >/dev/null 2>&1
fi
fi
done
fi
exit 0

View File

@ -1,214 +0,0 @@
/*
* This file is part of the Alliance CAD System
* Copyright (C) Laboratoire LIP6 - Département ASIM
* Universite Pierre et Marie Curie
*
* Home page : http://www-asim.lip6.fr/alliance/
* E-mail : mailto:alliance-users@asim.lip6.fr
*
* This progam 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.
*
* Alliance VLSI CAD System 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 the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Compilation switch flag definitions for GNU CC.
Copyright (C) 1987, 1988 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC 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 1, or (at your option)
any later version.
GNU CC 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 GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Name of the input .c file being compiled. */
extern char *main_input_filename;
/* 1 => write gdb debugging output (using symout.c).
2 => write dbx debugging output (using dbxout.c).
3 => write sdb debugging output (using sdbout.c). */
enum debugger { NO_DEBUG = 0, GDB_DEBUG = 1, DBX_DEBUG = 2, SDB_DEBUG = 3,
EXTENDED_DBX_DEBUG = 4 };
extern enum debugger write_symbols;
/* Nonzero means use GDB-only extensions of DBX format. */
extern int use_gdb_dbx_extensions;
/* Nonzero means do optimizations. -opt. */
extern int optimize;
/* Nonzero means do stupid register allocation. -noreg.
This and `optimize' are controlled by different switches in cc1,
but normally cc controls them both with the -O switch. */
extern int obey_regdecls;
/* Don't print functions as they are compiled and don't print
times taken by the various passes. -quiet. */
extern int quiet_flag;
/* Don't print warning messages. -w. */
extern int inhibit_warnings;
/* Do print extra warnings (such as for uninitialized variables). -W. */
extern int extra_warnings;
/* Nonzero to warn about unused local variables. */
extern int warn_unused;
/* Nonzero means warn about all declarations which shadow others. */
extern int warn_shadow;
/* Warn if a switch on an enum fails to have a case for every enum value. */
extern int warn_switch;
/* Nonzero means warn about any identifiers that match in the first N
characters. The value N is in `id_clash_len'. */
extern int warn_id_clash;
extern int id_clash_len;
/* Nonzero if generating code to do profiling. */
extern int profile_flag;
/* Nonzero if generating code to do profiling on the basis of basic blocks. */
extern int profile_block_flag;
/* Nonzero for -pedantic switch: warn about anything
that standard C forbids. */
extern int pedantic;
/* Now the symbols that are set with `-f' switches. */
/* Nonzero means `char' should be signed. */
extern int flag_signed_char;
/* Nonzero means give an enum type only as many bytes as it needs. */
extern int flag_short_enums;
/* Nonzero for -fcaller-saves: allocate values in regs that need to
be saved across function calls, if that produces overall better code.
Optional now, so people can test it. */
extern int flag_caller_saves;
/* Nonzero for -fpcc-struct-return: return values the same way PCC does. */
extern int flag_pcc_struct_return;
/* Nonzero for -fforce-mem: load memory value into a register
before arithmetic on it. This makes better cse but slower compilation. */
extern int flag_force_mem;
/* Nonzero for -fforce-addr: load memory address into a register before
reference to memory. This makes better cse but slower compilation. */
extern int flag_force_addr;
/* Nonzero for -fdefer-pop: don't pop args after each function call;
instead save them up to pop many calls' args with one insns. */
extern int flag_defer_pop;
/* Nonzero for -ffloat-store: don't allocate floats and doubles
in extended-precision registers. */
extern int flag_float_store;
/* Nonzero for -fcombine-regs:
allow instruction combiner to combine an insn
that just copies one reg to another. */
extern int flag_combine_regs;
/* Nonzero enables strength-reduction in loop.c. */
extern int flag_strength_reduce;
/* Nonzero for -fwritable-strings:
store string constants in data segment and don't uniquize them. */
extern int flag_writable_strings;
/* Nonzero means don't put addresses of constant functions in registers.
Used for compiling the Unix kernel, where strange substitutions are
done on the assembly output. */
extern int flag_no_function_cse;
/* Nonzero for -fomit-frame-pointer:
don't make a frame pointer in simple functions that don't require one. */
extern int flag_omit_frame_pointer;
/* This isn't a flag, but everyone who needs flag_omit_frame_pointer
also needs this.
Nonzero means current function must be given a frame pointer.
Set in stmt.c if anything is allocated on the stack there.
Set in reload1.c if anything is allocated on the stack there. */
extern int frame_pointer_needed;
/* Nonzero to inhibit use of define_optimization peephole opts. */
extern int flag_no_peephole;
/* Nonzero means all references through pointers are volatile. */
extern int flag_volatile;
/* Nonzero means make functions that look like good inline candidates
go inline. */
extern int flag_inline_functions;
/* Nonzero for -fkeep-inline-functions: even if we make a function
go inline everywhere, keep its defintion around for debugging
purposes. */
extern int flag_keep_inline_functions;
/* Nonzero if we are only using compiler to check syntax errors. */
extern int flag_syntax_only;
/* Nonzero means make the text shared if supported. */
extern int flag_shared_data;
/* Nonzero means put things in delayed-branch slots if supported. */
extern int flag_delayed_branch;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More