8sa1-gcc/gcc/fixinc
Zack Weinberg 78a0d70cdf frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once.
* frame.c (find_fde): Convert for loop to do-while so compiler
	sees it's always executed at least once.
	* libgcc2.c (BBINBUFSIZE): Kill.
	(__bb_init_prg): Use fgets.
	(__bb_exit_trace_func): Don't paste strings.
	* unroll.c (unroll_loop): Initialize unroll_type, not
	unroll_number, and tweak logic to match.

	* i386.c (ix86_expand_int_movcc): Add explicit 'return 0' in
	all failure paths.
	(ix86_flags_dependant): Likewise.  Disentangle control flow.
	(ix86_sched_reorder): Break guts out to
	ix86_sched_reorder_pentium and ix86_sched_reorder_ppro.
	(ix86_sched_reorder_ppro): Initialize pair2 and insnp before
	any possible use.

	* i386.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Don't
	use string concatenation.  Don't save and restore esi.

	* fixinc/Makefile.in (fixincl.sh): Don't depend on inclhack.def.
	(machname.h): Remove script to separate file.  Use two-step
	sequence so target is not created if script fails.
	* fixinc/gen-machname.h: New file.  Handle case where no non-reserved
	identifiers are defined.
	* fixinc/fixlib.c (mn_get_regexps): Return a flag: if MN_NAME_PAT is
	an empty string, machine_name doesn't need to do anything at
	all.
	(is_cxx_header): Add more cases to regexp.
	* fixinc/fixlib.h: Update prototype.
	* fixinc/fixtests.c, fixinc/fixfixes.c: Update callers of
	mn_get_regexps.
	* fixinc/fixincl.c: Define NO_BOGOSITY.

	* fixinc/inclhack.def (no_double_slash, else_endif_label): Ifdef out.
	(hp_sysfile): Add missing comma.
	(math_exception): Put the wrapper ifdefs at the beginning and
	the end of the file.
	* fixinc/fixincl.x, fixinc/inclhack.sh: Regenerate.

From-SVN: r31744
2000-02-01 23:51:38 +00:00
..
fixfixes.c frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
fixinc.dgux
fixinc.interix
fixinc.irix fixinc.irix: Use unique filenames for writing into /tmp, 2000-02-01 21:42:05 +00:00
fixinc.ptx fixinc.irix: Use unique filenames for writing into /tmp, 2000-02-01 21:42:05 +00:00
fixinc.sco fixinc.irix: Use unique filenames for writing into /tmp, 2000-02-01 21:42:05 +00:00
fixinc.svr4 fixinc.irix: Use unique filenames for writing into /tmp, 2000-02-01 21:42:05 +00:00
fixinc.winnt fixinc.irix: Use unique filenames for writing into /tmp, 2000-02-01 21:42:05 +00:00
fixinc.wrap
fixincl.c frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
fixincl.sh inclhack.def: Fixes to play nicer with FreeBSD, and corrections to comments. 2000-01-25 08:06:23 +00:00
fixincl.tpl inclhack.def: Fixes to play nicer with FreeBSD, and corrections to comments. 2000-01-25 08:06:23 +00:00
fixincl.x frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
fixlib.c frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
fixlib.h frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
fixtests.c frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
gen-machname.h frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
genfixes
gnu-regex.c Makefile.in (machname.h): SunOS 4 sed can't handle a file with one line and no trailing newline. 2000-01-26 07:37:30 +00:00
gnu-regex.h Makefile.in (fixinc.sh): Depend on specs. 2000-01-20 18:25:12 +00:00
hackshell.tpl
inclhack.def frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
inclhack.sh frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
inclhack.tpl inclhack.def: Fixes to play nicer with FreeBSD, and corrections to comments. 2000-01-25 08:06:23 +00:00
Makefile.in frame.c (find_fde): Convert for loop to do-while so compiler sees it's always executed at least once. 2000-02-01 23:51:38 +00:00
mkfixinc.sh
procopen.c
README
server.c
server.h

FIXINCLUDES OPERATION
=====================

See also:  http://autogen.linuxbox.com/fixincludes

The set of fixes required was distilled down to just the data required
to specify what needed to happen for each fix.  Those data were edited
into a new file named gcc/fixinc/inclhack.def.  A program called
AutoGen (http://autogen.linuxbox.com) uses these definitions to
instantiate several different templates (gcc/fixinc/*.tpl) that then
produces a fixincludes replacement shell script (inclhack.sh), a
replacement binary program (fixincl.x) and a script to drive the
binary fixincl.sh).

If there is no special purpose script, then mkfixinc.sh will try to
compile, link and test execute the binary version.  If it cannot be
successfully built, the shell version will be used instead.  If
mkfixinc.sh determines that your system needs machine-specific fixes
that have not yet been applied to inclhack.def, it will install and
use the current fixinc.* for that system instead.

Usually, the mkfixinc.sh script will be able to detect when
the binary is not runable.  If you do have problems, however,
please try configuring "--without-fast-fixincludes".  Thank you.

Regards,
	Bruce <autogen@linuxbox.com>



POSSIBLE PROBLEMS
=================

There may be some systems on which the fixinc binary program appears
to be functional, but fails to work.  If you are experiencing this
problem, then copy the script ${src}/gcc/fixinc/inclhack.sh into
${builddir}/gcc/fixinc.sh and run make again.

And, *please* also report the problem with a description of
the failure mode (symptoms) and the output from:

        egcs/config.guess

to me:  Bruce Korb <autogen@linuxbox.com>



GCC MAINTAINER INFORMATION
==========================

If you are having some problem with a system header that is either
broken by the manufacturer, or is broken by the fixinclude process,
then you will need to alter or add information to the include fix
definitions file, ``inclhack.def''.  Please also send relevant
information to gcc-bugs@gcc.gnu.org, gcc-patches@gcc.gnu.org and,
please, to me:  autogen@linuxbox.com.

Here are the rules for making fixes in the inclhack.def file:

1.  Every fix must have a "hackname" that is compatible with C syntax
    for variable names and is unique without regard to alphabetic case.
    Please keep them alphabetical by this name.  :-)

2.  If the problem is known to exist only in certain files,
    then name each such file with a "files = " entry.

3.  It is relatively expensive to fire off a process to fix a source
    file, therefore write apply tests to avoid unnecessary fix
    processes.  The preferred apply tests are "select", "bypass" and
    "c_test" because they are performed internally.  "test" sends
    a command to a server shell that actually fires off one or more
    processes to do the testing.  Avoid it, if you can, but it is
    still more efficient than a fix process.  Also available is
    "mach".  If the target machine matches any of the named
    globbing-style patterns, then the machine name test will pass.
    It is desired, however, to limit the use of this test.

    These tests are required to:

    1.  Be positive for all header files that require the fix.

    It is desireable to:

    2.  Be negative as often as possible whenever the fix is not
        required, avoiding the process overhead.

    It is nice if:

    3.  The expression is as simple as possible to both
        process and uderstand by people.  :-)

        Please take advantage of the fact AutoGen will glue
        together string fragments.  It helps.  Also take note
        that double quote strings and single quote strings have
        different formation rules.  Double quote strings are
        a tiny superset of C string syntax.  Single quote strings
        follow shell single quote string formation rules, except
        that the backslash is processed before '\\', '\'' and '#'
        characters (using C character syntax).

    Examples of test specifications:

      hackname = broken_assert_stdio;
      files    = assert.h;
      select   = stderr;
      bypass   = "include.*stdio.h";

    The ``broken_assert_stdio'' fix will be applied only to a file
    named "assert.h" if it contains the string "stderr" _and_ it
    does _not_ contain the expression "include.*stdio.h".

      hackname = no_double_slash;
      c_test   = "double_slash";

    The ``no_double_slash'' fix will be applied if the
    ``double_slash_test()'' function says to.  See ``fixtests.c''
    for documentation on how to include new functions into that
    module.

4.  There are currently four methods of fixing a file:

    1.  a series of sed expressions.  Each will be an individual
        "-e" argument to a single invocation of sed.

    2.  a shell script.  These scripts are _required_ to read all
        of stdin in order to avoid pipe stalls.  They may choose to
        discard the input.

    3.  A C language subroutine method for both tests and fixes.

    4.  Replacement text.  If the replacement is empty, then
        no fix is applied.  Otherwise, the replacement text is written
        to the output file and no further fixes are applied.

        Replacement text "fixes" must be first in this file!!

    Examples of fixes:
    ------------------

      hackname = AAA_ki_iface;
      replace; /* empty replacement -> no fixing the file */

    When this ``fix'' is invoked, it will prevent any fixes
    from being applied.

    ------------------

      hackname = AAB_svr4_no_varargs;
      replace  = "/* This file was generated by fixincludes.  */\n"
                 "#ifndef _SYS_VARARGS_H\n"
                 "#define _SYS_VARARGS_H\n\n"

                 "#ifdef __STDC__\n"
                 "#include <stdarg.h>\n"
                 "#else\n"
                 "#include <varargs.h>\n"
                 "#endif\n\n"

                 "#endif  /* _SYS_VARARGS_H */\n";

    When this ``fix'' is invoked, the replacement text will be
    emitted into the replacement include file.  No further fixes
    will be applied.

    ------------------

      hackname = dec_intern_asm;
      files    = c_asm.h;
      sed = "/^[ \t]*float[ \t]*fasm/i\\\n#ifdef __DECC\n";
      sed = "/^[ \t]*#[ \t]*pragma[ \t]*intrinsic([ \t]*dasm/a\\\n"
            "#endif\n";

    When this ``fix'' is invoked, sed will be run on the original
    file with two "-e" arguments.  Since these arguments have double
    quoted string values, the strings actually passed to ``sed''
    will have been processed in the same fashion that the C compiler
    processes its string specifications.  Including the concatenation
    of the two pieces of the second sed "-e" argument.

    ------------------

      hackname = m88k_multi_incl;
      shell    =
        "echo Fixing $file, to protect against multiple inclusion. >&2
        cpp_wrapper=`echo $file | sed -e 's,\\.,_,g' -e 's,/,_,g'`
        echo \"#ifndef __GCC_GOT_${cpp_wrapper}_\"
        echo \"#define __GCC_GOT_${cpp_wrapper}_\"
        cat
        echo \"#endif /* ! __GCC_GOT_${cpp_wrapper}_ */\"";

    This is a shell script fix.  Note the ``cat'' without any arguments.
    This will drain stdin.  If the contents of the file were to be
    discarded, you would have to have something like ``cat > /dev/null''
    in the script.

    ------------------

      hackname = no_double_slash;
      c_fix    = "no_double_slash";

    This specifies a fix to be supplied via a hand coded internal
    function named ``no_double_slash_fix()''.  See ``fixfixes.c''
    for documentation on how to include new functions into that
    module.