gcc/gcc/gcc.c

7974 lines
223 KiB
C
Raw Normal View History

1992-02-01 06:15:32 +01:00
/* Compiler driver program that can handle many languages.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
1992-02-01 06:15:32 +01:00
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
This file is part of GCC.
1992-02-01 06:15:32 +01:00
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC 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.
1992-02-01 06:15:32 +01:00
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC 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.
1992-02-01 06:15:32 +01:00
You should have received a copy of the GNU General Public License
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
along with GCC; see the file COPYING. If not, write to the Free
2005-06-25 04:02:01 +02:00
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
1992-02-01 06:15:32 +01:00
This paragraph is here to try to keep Sun CC from dying.
The number of chars here seems crucial!!!! */
/* This program is the user interface to the C compiler and possibly to
other compilers. It is used because compilation is a complicated procedure
which involves running several programs and passing temporary files between
them, forwarding the users switches to those programs selectively,
and deleting the temporary files at the end.
CC recognizes how to compile each input file by suffixes in the file names.
Once it knows which kind of compilation to perform, the procedure for
compilation is specified by a string called a "spec". */
/* A Short Introduction to Adding a Command-Line Option.
Before adding a command-line option, consider if it is really
necessary. Each additional command-line option adds complexity and
is difficult to remove in subsequent versions.
In the following, consider adding the command-line argument
`--bar'.
1. Each command-line option is specified in the specs file. The
notation is described below in the comment entitled "The Specs
Language". Read it.
2. In this file, add an entry to "option_map" equating the long
`--' argument version and any shorter, single letter version. Read
the comments in the declaration of "struct option_map" for an
explanation. Do not omit the first `-'.
3. Look in the "specs" file to determine which program or option
list should be given the argument, e.g., "cc1_options". Add the
appropriate syntax for the shorter option version to the
corresponding "const char *" entry in this file. Omit the first
`-' from the option. For example, use `-bar', rather than `--bar'.
4. If the argument takes an argument, e.g., `--baz argument1',
modify either DEFAULT_SWITCH_TAKES_ARG or
DEFAULT_WORD_SWITCH_TAKES_ARG in gcc.h. Omit the first `-'
from `--baz'.
5. Document the option in this file's display_help(). If the
option is passed to a subprogram, modify its corresponding
function, e.g., cppinit.c:print_help() or toplev.c:display_help(),
instead.
6. Compile and test. Make sure that your new specs file is being
read. For example, use a debugger to investigate the value of
"specs_file" in main(). */
#include "config.h"
Major cutover to using system.h: * Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o, c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o, caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o, dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o, expr.o, final.o, flow.o, function.o, getpwd.o, global.o, integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o, prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o, reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o, rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o, tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend on system.h. * alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c, c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c, caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c, dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c, expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c, integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c, prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c, reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c, rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c, stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c, xcoffout.c: Include system.h. Organize include ordering so that stdarg/varargs comes before other system headers. Remove spurious casts of functions assured of a prototype in system.h. From-SVN: r18726
1998-03-20 15:58:42 +01:00
#include "system.h"
#include "coretypes.h"
#include "multilib.h" /* before tm.h */
#include "tm.h"
Major cutover to using system.h: * Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o, c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o, caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o, dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o, expr.o, final.o, flow.o, function.o, getpwd.o, global.o, integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o, prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o, reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o, rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o, tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend on system.h. * alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c, c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c, caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c, dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c, expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c, integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c, prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c, reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c, rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c, stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c, xcoffout.c: Include system.h. Organize include ordering so that stdarg/varargs comes before other system headers. Remove spurious casts of functions assured of a prototype in system.h. From-SVN: r18726
1998-03-20 15:58:42 +01:00
#include <signal.h>
#if ! defined( SIGCHLD ) && defined( SIGCLD )
# define SIGCHLD SIGCLD
#endif
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
#include "xregex.h"
#include "obstack.h"
#include "intl.h"
#include "prefix.h"
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
#include "gcc.h"
#include "flags.h"
re PR target/26885 (-m64 -m32 no longer creates 32-bit object) gcc/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Makefile.in (GCC_OBJS): New. (OBJS-common): Add opts-common.o. (xgcc$(exeext)): Replace gcc.o with $(GCC_OBJS). (cpp$(exeext)): Likewise. (gcc.o): Also depend on opts.h. (opts-common.o): New. * common.opt (gcoff): Add Negative(gdwarf-2). (gdwarf-2): Add Negative(gstabs). (gstabs): Add Negative(gstabs+). (gstabs+): Add Negative(gvms). (gvms): Add Negative(gxcoff). (gxcoff): Add Negative(gxcoff+). (gxcoff+): Add Negative(gcoff). * config/i386/i386.opt (m32): Add Negative(m64). (m64): Add Negative(m32). * doc/options.texi: Document the Negative option. * gcc.c: Include "opts.h". (main): Call prune_options after expandargv. * optc-gen.awk: Generate common declarations for all flag variables in options.c. Output the neg_index field. * opts.c (find_opt): Moved to ... * opts-common.c: Here. New file. * opts.h (cl_option): Add a neg_index field. (find_opt): New. (prune_options): Likewise. gcc/cp/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (GXX_OBJS): Replace gcc.o with $(GCC_OBJS). gcc/fortran/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (GFORTRAN_D_OBJS): Replace gcc.o with $(GCC_OBJS). gcc/java/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in ($(GCJ)$(exeext)): Replace gcc.o with $(GCC_OBJS). gcc/treelang/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (gtreelang$(exeext)): Replace gcc.o with $(GCC_OBJS). From-SVN: r113824
2006-05-16 16:27:18 +02:00
#include "opts.h"
/* By default there is no special suffix for target executables. */
/* FIXME: when autoconf is fixed, remove the host check - dj */
#if defined(TARGET_EXECUTABLE_SUFFIX) && defined(HOST_EXECUTABLE_SUFFIX)
#define HAVE_TARGET_EXECUTABLE_SUFFIX
1992-02-01 06:15:32 +01:00
#endif
/* By default there is no special suffix for host executables. */
#ifdef HOST_EXECUTABLE_SUFFIX
#define HAVE_HOST_EXECUTABLE_SUFFIX
#else
#define HOST_EXECUTABLE_SUFFIX ""
#endif
/* By default, the suffix for target object files is ".o". */
#ifdef TARGET_OBJECT_SUFFIX
#define HAVE_TARGET_OBJECT_SUFFIX
#else
#define TARGET_OBJECT_SUFFIX ".o"
#endif
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
/* Most every one is fine with LIBRARY_PATH. For some, it conflicts. */
#ifndef LIBRARY_PATH_ENV
#define LIBRARY_PATH_ENV "LIBRARY_PATH"
#endif
1997-12-07 01:31:01 +01:00
#ifndef HAVE_KILL
#define kill(p,s) raise(s)
#endif
1992-02-01 06:15:32 +01:00
/* If a stage of compilation returns an exit status >= 1,
compilation of that file ceases. */
#define MIN_FATAL_STATUS 1
/* Flag set by cppspec.c to 1. */
int is_cpp_driver;
/* Flag set to nonzero if an @file argument has been supplied to gcc. */
static bool at_file_supplied;
[multiple changes] Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR> * gcov.c (DIR_SEPARATOR): Provide default. (output_data): Add test for MS-DOS format absolute filename. (fancy_abort): Correct program name. (open_files): Open all files in binary mode. * libgcc2.c (__bb_exit_func): Likewise. * profile.c (init_branch_prob): Specify binary when opening files. * flags.h (flag_unwind_tables): New decl. * toplev.c (flag_unwind_table): New definition. (f_options): Add -funwind-tables. (decode_g_option): Clarify warning when unknown -g option is given. (rest_of_compilation): If inside an inlined external function, pretend we are just being declared. * dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables. (dwarf2out_frame_finish): Likewise. Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com> * flow.c (propagate_block): When the last reference to a label before an ADDR_VEC is deleted because the reference is a dead store, delete the ADDR_VEC. Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt> * fold-const.c (merge_ranges): In not in0, but in1, handle upper bounds equal like subset case. Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com> * dbxout.c (dbxout_parms): Generate a second stabs line for parameters passed in a register but moved to the stack. Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr> * gcc.c (pass_exit_codes, greatest_status): New variables. (struct option_map): Add entry for "--pass-exit-codes". (execute): Update greatest_status if error. (display_help): Add documentation for -pass-exit-codes. (process_command): Handle -pass-exit-codes. (main): Look at pass_exit_codes and greatest_status on call to exit. Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * reload.c (find_reloads): Refine test for no input reload case to not includes reloads emitted after insn. * function.c (find_temp_slots_from_address): Handle sum involving a register that points to a temp slot. (update_temp_slot_address): Make recursive call if both old and new are PLUS with a common operand. * calls.c (expand_call): Mark temp slot for result as having address taken. * rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case. * gcc.c (process_command): Add standard_exec_prefix with "GCC" component as well as "BINUTILS". * integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS. * integrate.c (copy_rtx_and_substitute): Likewise. (expand_inline_function, integrate_parm_decls, integrate_decl_tree): All callers changed. * unroll.c (inital_reg_note_copy, copy_loop_body): Likewise. * dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use gdb extensions, write size of type; also be more consistent in using references when this is a subtype. * pa.md (extv, extzv, insv): Use define_expand to reject constant that is out of range. * loop.c (unknown_constant_address_altered): New variable. (prescan_loop): Initialize it. (note_addr_stored): Set it for RTX_UNCHANGING_P MEM. (invariant_p, case MEM): Remove handling for volatile and readony; check new variable if readonly. (check_dbra_loop): Chdeck unknown_constant_address_altered. * cse.c (canon_hash, case MEM): Do not record if BLKmode. (addr_affects_sp_p): Removed from note_mem_written and only define #ifdef AUTO_INC_DEC. * alpha.c (input_operand, case ADDRESSOF): Treat as REG. * regclass.c (record_reg_classes): Properly handle register move directions. * varasm.c (initializer_constant_valid_p, case MINUS_EXPR): Don't think valid if both operands are invalid. (struct constant_descriptor): New field RTL. (mark_const_hash_entry): Mark it. (record_constant{,_rtx}): Initialize it. (output_constant_def): Allocate RTL in permanent obstack and save in table. ({record,compare}_constant_1): Modes must match for CONSTRUCTOR of ARRAY_TYPE. * c-common.h (initializer_constant_valid_p): Delete decl from here. * output.h (initializer_constant_valid_p): Move decl to here. * c-common.c (initializer_constant_valid_p): Delete function from here. * varasm.c (initializer_constant_valid_p): Move function to here. * tree.h (STRIP_SIGN_NOPS): New macro. * fold-const.c (optimize_minmax_comparison): New function. (invert_truthvalue, case WITH_RECORD_EXPR): New case. (fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS. (fold, case EQ_EXPR): Call optimize_minmax_comparison and add cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and widening conversions. (fold, case LE_EXPR): Rework changing unsigned to signed comparisons to look at size of mode, not precision of type; also add missing cases. (optimize_bit_field_compare, decode_field_reference): Don't try to optimize COMPONENT_REF of a PLACEHOLDER_EXPR. * dwarf2out.c (ctype.h): Include. (dwarf2out_set_demangle_name_func): New function. (size_of_line_info): Deleted. (output_line_info): Compute size of line info table from difference of labels. (base_type_die, add_name_attribute): Call demangle function, if any. (field_byte_offset): Use bits per word for variable length fields. (gen_array_type_die): Add array name. (gen_subprogram_die): Ignore DECL_INLINE if -fno-inline. (dwarf2out_add_library_unit_info): New function. * explow.c (set_stack_check_libfunc): New function. (stack_check_libfunc): New static variable. (probe_stack_range): Allow front-end to set up a libfunc to call. * combine.c (simplify_comparison): When making comparison in wider mode, check for having commuted an AND and a SUBREG. (contains_muldiv): New function. (try_combine): Call it when dividing a PARALLEL. (simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart. (simplify_comparison, case ASHIFTRT): Recognize sign-extension of a PLUS. (record_value_for_reg): If TEM is a binary operation with two CLOBBERs, use one of the CLOBBERs instead. (if_then_else_cond): If comparing against zero, just return thing being compared. * optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x). Don't generate shifts and subtract if have conditional arithmetic. * rtl.h (delete_barrier): New declaration. * jump.c (jump_optimize): Set up to handle conditional call. In conditional arithmetic case, handle CALL_INSN followed by a BARRIER. (delete_barrier): New function. * rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode. * recog.c (nonmemory_operand): Accept ADDRESSOF. * tree.c (build_type_attribute_variant): Push to obstack of ttype around type_hash_canon call. * expr.c (placeholder_list): Move decl to file scope. (expand_expr): Don't force access to volatile just because its address is taken. If ignoring reference operations, just expand the operands. (expand_expr, case COMPONENT_REF): Propagate EXPAND_CONST_ADDRESS to recursive call when expanding inner. Refine test for using bitfield operations vs pointer punning. (expand_expr, case CONVERT_EXPR): If converting to BLKmode UNION_TYPE from BLKmode, just return inner object. Use proper mode in store_field call. Properly set sizes of object to store and total size in store_field call for convert to union. (expand_expr, case ARRAY_REF): If OP0 is in a register, put it in memory (like for ADDR_EXPR). Also, don't put constant in register if we'll want it in memory. (readonly_fields_p): New function. (expand_expr, case INDIRECT_REF): Call it if LHS. (expand_assignment): Handle a RESULT_DECL where DECL_RTL is a PARALLEL. (do_jump, case WITH_RECORD_EXPR): New case. (get_inner_reference): Always go inside a CONVERT_EXPR and NOP_EXPR if both modes are the same. (store_field): Use bitfield operations if size of bitsize is not same as size of RHS's type. Check for bitpos not a multiple of alignment in BLKmode case. Do block move in largest possible alignment. (store_constructor): Set BITSIZE to -1 for variable size and properly in case of array of BLKmode. (expand_expr_unaligned): New function. (do_compare_and_jump): Call it. * mips/iris5.h (SWITCHES_NEED_SPACES): New macro. * collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES does not include 'o'. * function.c (instantiate_virtual_regs_1, case SET): Handle case where both SET_DEST and SET_SRC reference a virtual register. (gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG. * integrate.c (expand_inline_function): Handle case of setting virtual stack vars register (from built in setjmp); when parameter lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early. (subst_constant): Add new parm, MEMONLY. (expand_inline_function, integrate_parm_decls): Pass new parm. (integrate_decl_tree): Likewise. (copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P. (try_constants): Call subst_constants twice, with MEMONLY 0 and 1. (copy_rtx_and_substitute, case SET): Add explicit calls to copy_rtx_and_substitute for both sides. * stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for constraints. (pushcase{,_range}): Convert to NOMINAL_TYPE after checking for within INDEX_TYPE, instead of before. (fixup_gotos): Use f->target_rtl, not the next insn, since latter may be from a later fixup. (expand_value_return): Correctly convert VAL when promoting function return; support RETURN_REG being a PARALLEL. (expand_return): When checking for result in regs and having cleanup, consider PARALLEL in DECL_RTL as being in regs. From-SVN: r30299
1999-11-01 02:11:22 +01:00
/* Flag saying to pass the greatest exit code returned by a sub-process
to the calling program. */
static int pass_exit_codes;
/* Definition of string containing the arguments given to configure. */
#include "configargs.h"
/* Flag saying to print the directories gcc will search through looking for
programs, libraries, etc. */
static int print_search_dirs;
/* Flag saying to print the full filename of this file
as found through our usual search mechanism. */
static const char *print_file_name = NULL;
1996-07-04 00:07:53 +02:00
/* As print_file_name, but search for executable file. */
static const char *print_prog_name = NULL;
/* Flag saying to print the relative path we'd use to
find libgcc.a given the current compiler flags. */
static int print_multi_directory;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
/* Flag saying to print the relative path we'd use to
find OS libraries given the current compiler flags. */
static int print_multi_os_directory;
/* Flag saying to print the list of subdirectories and
compiler flags used to select them in a standard form. */
static int print_multi_lib;
1998-07-13 19:20:29 +02:00
/* Flag saying to print the command line options understood by gcc and its
sub-processes. */
static int print_help_list;
re PR bootstrap/31020 (cannot write in </test/gnu/gcc/objdir/prev-gcc/../gcc/./include>) fixincludes: * mkheaders.in: Fix headers for each multilib required. gcc: PR bootstrap/31020 * configure.ac (CROSS_SYSTEM_HEADER_DIR, build_system_header_dir): Define using $${sysroot_headers_suffix}. * configure: Regenerate. * cppdefault.c (cpp_include_defaults): Make FIXED_INCLUDE_DIR a multilib-suffixed directory if SYSROOT_HEADERS_SUFFIX_SPEC defined. * doc/invoke.texi (-print-sysroot-headers-suffix): Document. * gcc.c (print_sysroot_headers_suffix): New. (option_map): Include --print-sysroot-headers-suffix. (display_help): Mention -print-sysroot-headers-suffix. (process_command): Handle -print-sysroot-headers-suffix. (do_spec_1): Append multilib directory to include-fixed path if sysroot suffixes in use. (main): Handle -print-sysroot-headers-suffix. * Makefile.in (start.encap): Don't depend on xlimits.h (xlimits.h): Remove. (stmp-int-hdrs): Don't depend on xlimits.h. Inline generation of limits.h for each multilib in fixinc_list. (fixinc_list, s-fixinc_list): New. (stmp-fixinc): Depend on fixinc_list. If not copying headers, generate them for each multilib in fixinc_list. (stmp-fixproto): Use include-fixed. Run fixproto for each multilib in fixinc_list. (mostlyclean): Don't remove xlimits.h. (clean): Remove include-fixed. (real-install-headers-tar, real-install-headers-cpio, real-install-headers-cp): Don't copy include, only include-fixed. (install-mkheaders): Depend on fixinc_list. Don't depend on xlimits.h. Save limits.h files for each multilib in fixinc_list. Always save mkinstalldirs. Preserve ${sysroot_headers_suffix} in SYSTEM_HEADER_DIR setting in mkheaders.conf. From-SVN: r122620
2007-03-06 16:50:28 +01:00
/* Flag saying to print the sysroot suffix used for searching for
headers. */
static int print_sysroot_headers_suffix;
1992-02-01 06:15:32 +01:00
/* Flag indicating whether we should print the command and arguments */
static int verbose_flag;
/* Flag indicating whether we should ONLY print the command and
arguments (like verbose_flag) without executing the command.
Displayed arguments are quoted so that the generated command
line is suitable for execution. This is intended for use in
shell scripts to capture the driver-generated command line. */
static int verbose_only_flag;
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
/* Flag indicating how to print command line options of sub-processes. */
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
static int print_subprocess_help;
/* Flag indicating whether we should report subprocess execution times
(if this is supported by the system - see pexecute.c). */
static int report_times;
/* Nonzero means place this string before uses of /, so that include
and library files can be found in an alternate location. */
#ifdef TARGET_SYSTEM_ROOT
static const char *target_system_root = TARGET_SYSTEM_ROOT;
#else
static const char *target_system_root = 0;
#endif
/* Nonzero means pass the updated target_system_root to the compiler. */
static int target_system_root_changed;
/* Nonzero means append this string to target_system_root. */
static const char *target_sysroot_suffix = 0;
/* Nonzero means append this string to target_system_root for headers. */
static const char *target_sysroot_hdrs_suffix = 0;
1992-02-01 06:15:32 +01:00
/* Nonzero means write "temp" files in source directory
and use the source file's name in them, and don't delete them. */
static int save_temps_flag;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
/* Nonzero means pass multiple source files to the compiler at one time. */
static int combine_flag = 0;
/* Nonzero means use pipes to communicate between subprocesses.
Overridden by either of the above two flags. */
static int use_pipes;
/* The compiler version. */
1992-02-01 06:15:32 +01:00
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
static const char *compiler_version;
/* The target version specified with -V */
static const char *const spec_version = DEFAULT_TARGET_VERSION;
1992-02-01 06:15:32 +01:00
/* The target machine specified with -b. */
static const char *spec_machine = DEFAULT_TARGET_MACHINE;
1992-02-01 06:15:32 +01:00
/* Nonzero if cross-compiling.
When -b is used, the value comes from the `specs' file. */
#ifdef CROSS_DIRECTORY_STRUCTURE
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
static const char *cross_compile = "1";
#else
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
static const char *cross_compile = "0";
#endif
#ifdef MODIFY_TARGET_NAME
/* Information on how to alter the target name based on a command-line
switch. The only case we support now is simply appending or deleting a
string to or from the end of the first part of the configuration name. */
static const struct modify_target
{
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
const char *const sw;
const enum add_del {ADD, DELETE} add_del;
const char *const str;
}
modify_target[] = MODIFY_TARGET_NAME;
#endif
/* The number of errors that have occurred; the link phase will not be
run if this is nonzero. */
static int error_count = 0;
[multiple changes] Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR> * gcov.c (DIR_SEPARATOR): Provide default. (output_data): Add test for MS-DOS format absolute filename. (fancy_abort): Correct program name. (open_files): Open all files in binary mode. * libgcc2.c (__bb_exit_func): Likewise. * profile.c (init_branch_prob): Specify binary when opening files. * flags.h (flag_unwind_tables): New decl. * toplev.c (flag_unwind_table): New definition. (f_options): Add -funwind-tables. (decode_g_option): Clarify warning when unknown -g option is given. (rest_of_compilation): If inside an inlined external function, pretend we are just being declared. * dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables. (dwarf2out_frame_finish): Likewise. Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com> * flow.c (propagate_block): When the last reference to a label before an ADDR_VEC is deleted because the reference is a dead store, delete the ADDR_VEC. Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt> * fold-const.c (merge_ranges): In not in0, but in1, handle upper bounds equal like subset case. Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com> * dbxout.c (dbxout_parms): Generate a second stabs line for parameters passed in a register but moved to the stack. Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr> * gcc.c (pass_exit_codes, greatest_status): New variables. (struct option_map): Add entry for "--pass-exit-codes". (execute): Update greatest_status if error. (display_help): Add documentation for -pass-exit-codes. (process_command): Handle -pass-exit-codes. (main): Look at pass_exit_codes and greatest_status on call to exit. Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * reload.c (find_reloads): Refine test for no input reload case to not includes reloads emitted after insn. * function.c (find_temp_slots_from_address): Handle sum involving a register that points to a temp slot. (update_temp_slot_address): Make recursive call if both old and new are PLUS with a common operand. * calls.c (expand_call): Mark temp slot for result as having address taken. * rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case. * gcc.c (process_command): Add standard_exec_prefix with "GCC" component as well as "BINUTILS". * integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS. * integrate.c (copy_rtx_and_substitute): Likewise. (expand_inline_function, integrate_parm_decls, integrate_decl_tree): All callers changed. * unroll.c (inital_reg_note_copy, copy_loop_body): Likewise. * dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use gdb extensions, write size of type; also be more consistent in using references when this is a subtype. * pa.md (extv, extzv, insv): Use define_expand to reject constant that is out of range. * loop.c (unknown_constant_address_altered): New variable. (prescan_loop): Initialize it. (note_addr_stored): Set it for RTX_UNCHANGING_P MEM. (invariant_p, case MEM): Remove handling for volatile and readony; check new variable if readonly. (check_dbra_loop): Chdeck unknown_constant_address_altered. * cse.c (canon_hash, case MEM): Do not record if BLKmode. (addr_affects_sp_p): Removed from note_mem_written and only define #ifdef AUTO_INC_DEC. * alpha.c (input_operand, case ADDRESSOF): Treat as REG. * regclass.c (record_reg_classes): Properly handle register move directions. * varasm.c (initializer_constant_valid_p, case MINUS_EXPR): Don't think valid if both operands are invalid. (struct constant_descriptor): New field RTL. (mark_const_hash_entry): Mark it. (record_constant{,_rtx}): Initialize it. (output_constant_def): Allocate RTL in permanent obstack and save in table. ({record,compare}_constant_1): Modes must match for CONSTRUCTOR of ARRAY_TYPE. * c-common.h (initializer_constant_valid_p): Delete decl from here. * output.h (initializer_constant_valid_p): Move decl to here. * c-common.c (initializer_constant_valid_p): Delete function from here. * varasm.c (initializer_constant_valid_p): Move function to here. * tree.h (STRIP_SIGN_NOPS): New macro. * fold-const.c (optimize_minmax_comparison): New function. (invert_truthvalue, case WITH_RECORD_EXPR): New case. (fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS. (fold, case EQ_EXPR): Call optimize_minmax_comparison and add cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and widening conversions. (fold, case LE_EXPR): Rework changing unsigned to signed comparisons to look at size of mode, not precision of type; also add missing cases. (optimize_bit_field_compare, decode_field_reference): Don't try to optimize COMPONENT_REF of a PLACEHOLDER_EXPR. * dwarf2out.c (ctype.h): Include. (dwarf2out_set_demangle_name_func): New function. (size_of_line_info): Deleted. (output_line_info): Compute size of line info table from difference of labels. (base_type_die, add_name_attribute): Call demangle function, if any. (field_byte_offset): Use bits per word for variable length fields. (gen_array_type_die): Add array name. (gen_subprogram_die): Ignore DECL_INLINE if -fno-inline. (dwarf2out_add_library_unit_info): New function. * explow.c (set_stack_check_libfunc): New function. (stack_check_libfunc): New static variable. (probe_stack_range): Allow front-end to set up a libfunc to call. * combine.c (simplify_comparison): When making comparison in wider mode, check for having commuted an AND and a SUBREG. (contains_muldiv): New function. (try_combine): Call it when dividing a PARALLEL. (simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart. (simplify_comparison, case ASHIFTRT): Recognize sign-extension of a PLUS. (record_value_for_reg): If TEM is a binary operation with two CLOBBERs, use one of the CLOBBERs instead. (if_then_else_cond): If comparing against zero, just return thing being compared. * optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x). Don't generate shifts and subtract if have conditional arithmetic. * rtl.h (delete_barrier): New declaration. * jump.c (jump_optimize): Set up to handle conditional call. In conditional arithmetic case, handle CALL_INSN followed by a BARRIER. (delete_barrier): New function. * rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode. * recog.c (nonmemory_operand): Accept ADDRESSOF. * tree.c (build_type_attribute_variant): Push to obstack of ttype around type_hash_canon call. * expr.c (placeholder_list): Move decl to file scope. (expand_expr): Don't force access to volatile just because its address is taken. If ignoring reference operations, just expand the operands. (expand_expr, case COMPONENT_REF): Propagate EXPAND_CONST_ADDRESS to recursive call when expanding inner. Refine test for using bitfield operations vs pointer punning. (expand_expr, case CONVERT_EXPR): If converting to BLKmode UNION_TYPE from BLKmode, just return inner object. Use proper mode in store_field call. Properly set sizes of object to store and total size in store_field call for convert to union. (expand_expr, case ARRAY_REF): If OP0 is in a register, put it in memory (like for ADDR_EXPR). Also, don't put constant in register if we'll want it in memory. (readonly_fields_p): New function. (expand_expr, case INDIRECT_REF): Call it if LHS. (expand_assignment): Handle a RESULT_DECL where DECL_RTL is a PARALLEL. (do_jump, case WITH_RECORD_EXPR): New case. (get_inner_reference): Always go inside a CONVERT_EXPR and NOP_EXPR if both modes are the same. (store_field): Use bitfield operations if size of bitsize is not same as size of RHS's type. Check for bitpos not a multiple of alignment in BLKmode case. Do block move in largest possible alignment. (store_constructor): Set BITSIZE to -1 for variable size and properly in case of array of BLKmode. (expand_expr_unaligned): New function. (do_compare_and_jump): Call it. * mips/iris5.h (SWITCHES_NEED_SPACES): New macro. * collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES does not include 'o'. * function.c (instantiate_virtual_regs_1, case SET): Handle case where both SET_DEST and SET_SRC reference a virtual register. (gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG. * integrate.c (expand_inline_function): Handle case of setting virtual stack vars register (from built in setjmp); when parameter lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early. (subst_constant): Add new parm, MEMONLY. (expand_inline_function, integrate_parm_decls): Pass new parm. (integrate_decl_tree): Likewise. (copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P. (try_constants): Call subst_constants twice, with MEMONLY 0 and 1. (copy_rtx_and_substitute, case SET): Add explicit calls to copy_rtx_and_substitute for both sides. * stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for constraints. (pushcase{,_range}): Convert to NOMINAL_TYPE after checking for within INDEX_TYPE, instead of before. (fixup_gotos): Use f->target_rtl, not the next insn, since latter may be from a later fixup. (expand_value_return): Correctly convert VAL when promoting function return; support RETURN_REG being a PARALLEL. (expand_return): When checking for result in regs and having cleanup, consider PARALLEL in DECL_RTL as being in regs. From-SVN: r30299
1999-11-01 02:11:22 +01:00
/* Greatest exit code of sub-processes that has been encountered up to
now. */
static int greatest_status = 1;
1992-02-01 06:15:32 +01:00
/* This is the obstack which we use to allocate many strings. */
static struct obstack obstack;
/* This is the obstack to build an environment variable to pass to
collect2 that describes all of the relevant switches of what to
pass the compiler in building the list of pointers to constructors
and destructors. */
static struct obstack collect_obstack;
/* Forward declaration for prototypes. */
struct path_prefix;
struct prefix_list;
static void init_spec (void);
static void store_arg (const char *, int, int);
static char *load_specs (const char *);
static void read_specs (const char *, int);
static void set_spec (const char *, const char *);
static struct compiler *lookup_compiler (const char *, size_t, const char *);
static char *build_search_list (const struct path_prefix *, const char *,
bool, bool);
static void putenv_from_prefixes (const struct path_prefix *, const char *,
bool);
static int access_check (const char *, int);
static char *find_a_file (const struct path_prefix *, const char *, int, bool);
static void add_prefix (struct path_prefix *, const char *, const char *,
int, int, int);
static void add_sysrooted_prefix (struct path_prefix *, const char *,
const char *, int, int, int);
static void translate_options (int *, const char *const **);
static char *skip_whitespace (char *);
static void delete_if_ordinary (const char *);
static void delete_temp_files (void);
static void delete_failure_queue (void);
static void clear_failure_queue (void);
static int check_live_switch (int, int);
static const char *handle_braces (const char *);
static inline bool input_suffix_matches (const char *, const char *);
static inline bool switch_matches (const char *, const char *, int);
static inline void mark_matching_switches (const char *, const char *, int);
static inline void process_marked_switches (void);
static const char *process_brace_body (const char *, const char *, const char *, int, int);
static const struct spec_function *lookup_spec_function (const char *);
static const char *eval_spec_function (const char *, const char *);
static const char *handle_spec_function (const char *);
static char *save_string (const char *, int);
static void set_collect_gcc_options (void);
static int do_spec_1 (const char *, int, const char *);
static int do_spec_2 (const char *);
static void do_option_spec (const char *, const char *);
static void do_self_spec (const char *);
static const char *find_file (const char *);
static int is_directory (const char *, bool);
static const char *validate_switches (const char *);
static void validate_all_switches (void);
static inline void validate_switches_from_spec (const char *);
static void give_switch (int, int);
static int used_arg (const char *, int);
static int default_arg (const char *, int);
static void set_multilib_dir (void);
static void print_multilib_info (void);
static void perror_with_name (const char *);
static void fatal_ice (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
static void notice (const char *, ...) ATTRIBUTE_PRINTF_1;
static void display_help (void);
static void add_preprocessor_option (const char *, int);
static void add_assembler_option (const char *, int);
static void add_linker_option (const char *, int);
static void process_command (int, const char **);
static int execute (void);
static void alloc_args (void);
static void clear_args (void);
static void fatal_error (int);
#if defined(ENABLE_SHARED_LIBGCC) && !defined(REAL_LIBGCC_SPEC)
static void init_gcc_specs (struct obstack *, const char *, const char *,
const char *);
#endif
#if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
static const char *convert_filename (const char *, int, int);
#endif
static const char *getenv_spec_function (int, const char **);
static const char *if_exists_spec_function (int, const char **);
static const char *if_exists_else_spec_function (int, const char **);
re PR libobjc/11572 (GNU libobjc no longer compiled on Darwin) 2004-09-15 Andrew Pinski <pinskia@physics.uc.edu> PR target/11572 * c-incpath.h (target_c_incpath_s): Add extra_pre_includes. Add two parameters to extra_includes. (C_INCPATH_INIT): Remove. * c-incpath.c (register_include_chains): Call extra_pre_includes before adding the standard include directory. Update call to extra_includes. (!defined TARGET_EXTRA_INCLUDES): Update hook_void_charptr_charptr_int and add !define TARGET_EXTRA_PRE_INCLUDES. (!define TARGET_EXTRA_INCLUDES): Define as hook_void_charptr_charptr_int. (!define TARGET_EXTRA_PRE_INCLUDES): Likewise. (target_c_incpath): Always declare. * fixinclude.c (defined TARGET_EXTRA_INCLUDES): Declare a empty function. (define TARGET_EXTRA_PRE_INCLUDES): Likewise. * config/darwin.h: (darwin_register_frameworks): Update for the two new parameters. (darwin_register_objc_includes): Add prototype. (TARGET_EXTRA_PRE_INCLUDES): Define. * config/darwin-c.c (darwin_register_objc_includes): New function. (darwin_register_frameworks): Update for the two new parameters. (target_c_incpath): Remove. * config/t-darwin (darwin-c.o): Add $(PREPROCESSOR_DEFINES) to the compile line. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Document the two new parameters. (TARGET_EXTRA_PRE_INCLUDES): Document. * gcc.c (spec_function): Add replace-outfile. (replace_outfile_spec_function): New function. * config/darwin.h (LINK_SPEC): Add replace -lobjc with -lobjc-gnu if -fgnu-runtime is supplied. * invoke.texi (replace-outfile): Document. From-SVN: r87588
2004-09-16 08:49:59 +02:00
static const char *replace_outfile_spec_function (int, const char **);
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
static const char *version_compare_spec_function (int, const char **);
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
static const char *include_spec_function (int, const char **);
static const char *print_asm_header_spec_function (int, const char **);
1992-02-01 06:15:32 +01:00
/* The Specs Language
Specs are strings containing lines, each of which (if not blank)
1992-02-01 06:15:32 +01:00
is made up of a program name, and arguments separated by spaces.
The program name must be exact and start from root, since no path
is searched and it is unreliable to depend on the current working directory.
Redirection of input or output is not supported; the subprograms must
accept filenames saying what files to read and write.
In addition, the specs can contain %-sequences to substitute variable text
or for conditional text. Here is a table of all defined %-sequences.
Note that spaces are not generated automatically around the results of
expanding these sequences; therefore, you can concatenate them together
or with constant text in a single argument.
%% substitute one % into the program name or argument.
%i substitute the name of the input file being processed.
%b substitute the basename of the input file being processed.
This is the substring up to (and not including) the last period
and not including the directory.
%B same as %b, but include the file suffix (text after the last period).
%gSUFFIX
substitute a file name that has suffix SUFFIX and is chosen
once per compilation, and mark the argument a la %d. To reduce
exposure to denial-of-service attacks, the file name is now
chosen in a way that is hard to predict even when previously
chosen file names are known. For example, `%g.s ... %g.o ... %g.s'
might turn into `ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s'. SUFFIX matches
the regexp "[.0-9A-Za-z]*%O"; "%O" is treated exactly as if it
had been pre-processed. Previously, %g was simply substituted
with a file name chosen once per compilation, without regard
to any appended suffix (which was therefore treated just like
ordinary text), making such attacks more likely to succeed.
%|SUFFIX
like %g, but if -pipe is in effect, expands simply to "-".
%mSUFFIX
like %g, but if -pipe is in effect, expands to nothing. (We have both
%| and %m to accommodate differences between system assemblers; see
the AS_NEEDS_DASH_FOR_PIPED_INPUT target macro.)
%uSUFFIX
like %g, but generates a new temporary file name even if %uSUFFIX
was already seen.
%USUFFIX
substitutes the last file name generated with %uSUFFIX, generating a
new one if there is no such last file name. In the absence of any
%uSUFFIX, this is just like %gSUFFIX, except they don't share
the same suffix "space", so `%g.s ... %U.s ... %g.s ... %U.s'
would involve the generation of two distinct file names, one
for each `%g.s' and another for each `%U.s'. Previously, %U was
simply substituted with a file name chosen for the previous %u,
without regard to any appended suffix.
%jSUFFIX
substitutes the name of the HOST_BIT_BUCKET, if any, and if it is
writable, and if save-temps is off; otherwise, substitute the name
of a temporary file, just like %u. This temporary file is not
meant for communication between processes, but rather as a junk
disposal mechanism.
%.SUFFIX
substitutes .SUFFIX for the suffixes of a matched switch's args when
it is subsequently output with %*. SUFFIX is terminated by the next
space or %.
1992-02-01 06:15:32 +01:00
%d marks the argument containing or following the %d as a
temporary file name, so that that file will be deleted if CC exits
successfully. Unlike %g, this contributes no text to the argument.
%w marks the argument containing or following the %w as the
"output file" of this compilation. This puts the argument
into the sequence of arguments that %o will substitute later.
%V indicates that this compilation produces no "output file".
1992-02-01 06:15:32 +01:00
%W{...}
like %{...} but mark last argument supplied within
as a file to be deleted on failure.
%o substitutes the names of all the output files, with spaces
automatically placed around them. You should write spaces
around the %o as well or the results are undefined.
%o is for use in the specs for running the linker.
Input files whose names have no recognized suffix are not compiled
at all, but they are included among the output files, so they will
be linked.
%O substitutes the suffix for object files. Note that this is
handled specially when it immediately follows %g, %u, or %U
(with or without a suffix argument) because of the need for
those to form complete file names. The handling is such that
%O is treated exactly as if it had already been substituted,
except that %g, %u, and %U do not currently support additional
SUFFIX characters following %O as they would following, for
example, `.o'.
%I Substitute any of -iprefix (made from GCC_EXEC_PREFIX), -isysroot
(made from TARGET_SYSTEM_ROOT), -isystem (made from COMPILER_PATH
and -B options) and -imultilib as necessary.
1992-02-01 06:15:32 +01:00
%s current argument is the name of a library or startup file of some sort.
Search for that file in a standard list of directories
and substitute the full name found.
%eSTR Print STR as an error message. STR is terminated by a newline.
Use this when inconsistent options are detected.
%nSTR Print STR as a notice. STR is terminated by a newline.
1992-02-01 06:15:32 +01:00
%x{OPTION} Accumulate an option for %X.
%X Output the accumulated linker options specified by compilations.
%Y Output the accumulated assembler options specified by compilations.
%Z Output the accumulated preprocessor options specified by compilations.
1992-02-01 06:15:32 +01:00
%a process ASM_SPEC as a spec.
This allows config.h to specify part of the spec for running as.
%A process ASM_FINAL_SPEC as a spec. A capital A is actually
used here. This can be used to run a post-processor after the
assembler has done its job.
%D Dump out a -L option for each directory in startfile_prefixes.
If multilib_dir is set, extra entries are generated with it affixed.
1992-02-01 06:15:32 +01:00
%l process LINK_SPEC as a spec.
%L process LIB_SPEC as a spec.
%G process LIBGCC_SPEC as a spec.
%R Output the concatenation of target_system_root and
target_sysroot_suffix.
1992-02-01 06:15:32 +01:00
%S process STARTFILE_SPEC as a spec. A capital S is actually used here.
%E process ENDFILE_SPEC as a spec. A capital E is actually used here.
%C process CPP_SPEC as a spec.
1992-02-01 06:15:32 +01:00
%1 process CC1_SPEC as a spec.
%2 process CC1PLUS_SPEC as a spec.
%* substitute the variable part of a matched option. (See below.)
Note that each comma in the substituted string is replaced by
a single space.
%<S remove all occurrences of -S from the command line.
Note - this command is position dependent. % commands in the
spec string before this one will see -S, % commands in the
spec string after this one will not.
%<S* remove all occurrences of all switches beginning with -S from the
command line.
%:function(args)
Call the named function FUNCTION, passing it ARGS. ARGS is
first processed as a nested spec string, then split into an
argument vector in the usual fashion. The function returns
a string which is processed as if it had appeared literally
as part of the current spec.
1992-02-01 06:15:32 +01:00
%{S} substitutes the -S switch, if that switch was given to CC.
If that switch was not specified, this substitutes nothing.
Here S is a metasyntactic variable.
%{S*} substitutes all the switches specified to CC whose names start
with -S. This is used for -o, -I, etc; switches that take
1992-02-01 06:15:32 +01:00
arguments. CC considers `-o foo' as being one switch whose
name starts with `o'. %{o*} would substitute this text,
including the space; thus, two arguments would be generated.
%{S*&T*} likewise, but preserve order of S and T options (the order
of S and T in the spec is not significant). Can be any number
of ampersand-separated variables; for each the wild card is
optional. Useful for CPP as %{D*&U*&A*}.
%{S:X} substitutes X, if the -S switch was given to CC.
%{!S:X} substitutes X, if the -S switch was NOT given to CC.
%{S*:X} substitutes X if one or more switches whose names start
with -S was given to CC. Normally X is substituted only
once, no matter how many such switches appeared. However,
if %* appears somewhere in X, then X will be substituted
once for each matching switch, with the %* replaced by the
part of that switch that matched the '*'.
%{.S:X} substitutes X, if processing a file with suffix S.
%{!.S:X} substitutes X, if NOT processing a file with suffix S.
%{,S:X} substitutes X, if processing a file which will use spec S.
%{!,S:X} substitutes X, if NOT processing a file which will use spec S.
%{S|T:X} substitutes X if either -S or -T was given to CC. This may be
combined with '!', '.', ',', and '*' as above binding stronger
than the OR.
If %* appears in X, all of the alternatives must be starred, and
only the first matching alternative is substituted.
%{S:X; if S was given to CC, substitutes X;
T:Y; else if T was given to CC, substitutes Y;
:D} else substitutes D. There can be as many clauses as you need.
This may be combined with '.', '!', ',', '|', and '*' as above.
%(Spec) processes a specification defined in a specs file as *Spec:
%[Spec] as above, but put __ around -D arguments
1992-02-01 06:15:32 +01:00
The conditional text X in a %{S:X} or similar construct may contain
1992-02-01 06:15:32 +01:00
other nested % constructs or spaces, or even newlines. They are
processed as usual, as described above. Trailing white space in X is
ignored. White space may also appear anywhere on the left side of the
colon in these constructs, except between . or * and the corresponding
word.
1992-02-01 06:15:32 +01:00
The -O, -f, -m, and -W switches are handled specifically in these
constructs. If another value of -O or the negated form of a -f, -m, or
-W switch is found later in the command line, the earlier switch
value is ignored, except with {S*} where S is just one letter; this
passes all matching options.
The character | at the beginning of the predicate text is used to indicate
that a command should be piped to the following command, but only if -pipe
is specified.
1992-02-01 06:15:32 +01:00
Note that it is built into CC which switches take arguments and which
do not. You might think it would be useful to generalize this to
allow each compiler's spec to say which switches take arguments. But
this cannot be done in a consistent fashion. CC cannot even decide
which input files have been specified without knowing which switches
take arguments, and it must know which input files to compile in order
to tell which compilers to run.
CC also knows implicitly that arguments starting in `-l' are to be
treated as compiler output files, and passed to the linker in their
proper position among the other output files. */
/* Define the macros used for specs %a, %l, %L, %S, %C, %1. */
1992-02-01 06:15:32 +01:00
/* config.h can define ASM_SPEC to provide extra args to the assembler
or extra switch-translations. */
#ifndef ASM_SPEC
#define ASM_SPEC ""
#endif
/* config.h can define ASM_FINAL_SPEC to run a post processor after
the assembler has run. */
#ifndef ASM_FINAL_SPEC
#define ASM_FINAL_SPEC ""
#endif
/* config.h can define CPP_SPEC to provide extra args to the C preprocessor
or extra switch-translations. */
#ifndef CPP_SPEC
#define CPP_SPEC ""
#endif
/* config.h can define CC1_SPEC to provide extra args to cc1 and cc1plus
or extra switch-translations. */
#ifndef CC1_SPEC
#define CC1_SPEC ""
#endif
/* config.h can define CC1PLUS_SPEC to provide extra args to cc1plus
or extra switch-translations. */
#ifndef CC1PLUS_SPEC
#define CC1PLUS_SPEC ""
#endif
/* config.h can define LINK_SPEC to provide extra args to the linker
or extra switch-translations. */
#ifndef LINK_SPEC
#define LINK_SPEC ""
#endif
/* config.h can define LIB_SPEC to override the default libraries. */
#ifndef LIB_SPEC
#define LIB_SPEC "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
#endif
/* mudflap specs */
#ifndef MFWRAP_SPEC
/* XXX: valid only for GNU ld */
/* XXX: should exactly match hooks provided by libmudflap.a */
#define MFWRAP_SPEC " %{static: %{fmudflap|fmudflapth: \
--wrap=malloc --wrap=free --wrap=calloc --wrap=realloc\
--wrap=mmap --wrap=munmap --wrap=alloca\
2005-07-17 04:29:00 +02:00
} %{fmudflapth: --wrap=pthread_create\
}} %{fmudflap|fmudflapth: --wrap=main}"
#endif
#ifndef MFLIB_SPEC
#define MFLIB_SPEC "%{fmudflap|fmudflapth: -export-dynamic}"
#endif
/* config.h can define LIBGCC_SPEC to override how and when libgcc.a is
included. */
#ifndef LIBGCC_SPEC
#if defined(REAL_LIBGCC_SPEC)
#define LIBGCC_SPEC REAL_LIBGCC_SPEC
#elif defined(LINK_LIBGCC_SPECIAL_1)
/* Have gcc do the search for libgcc.a. */
#define LIBGCC_SPEC "libgcc.a%s"
#else
#define LIBGCC_SPEC "-lgcc"
#endif
1992-02-01 06:15:32 +01:00
#endif
/* config.h can define STARTFILE_SPEC to override the default crt0 files. */
#ifndef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}"
1992-02-01 06:15:32 +01:00
#endif
/* config.h can define SWITCHES_NEED_SPACES to control which options
require spaces between the option and the argument. */
1992-02-01 06:15:32 +01:00
#ifndef SWITCHES_NEED_SPACES
#define SWITCHES_NEED_SPACES ""
#endif
/* config.h can define ENDFILE_SPEC to override the default crtn files. */
#ifndef ENDFILE_SPEC
#define ENDFILE_SPEC ""
#endif
#ifndef LINKER_NAME
#define LINKER_NAME "collect2"
#endif
/* Define ASM_DEBUG_SPEC to be a spec suitable for translating '-g'
to the assembler. */
#ifndef ASM_DEBUG_SPEC
# if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO) \
&& defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
# define ASM_DEBUG_SPEC \
(PREFERRED_DEBUGGING_TYPE == DBX_DEBUG \
? "%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}}" \
: "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}")
# else
# if defined(DBX_DEBUGGING_INFO) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
# define ASM_DEBUG_SPEC "%{g*:--gstabs}"
# endif
# if defined(DWARF2_DEBUGGING_INFO) && defined(HAVE_AS_GDWARF2_DEBUG_FLAG)
# define ASM_DEBUG_SPEC "%{g*:--gdwarf2}"
# endif
# endif
#endif
#ifndef ASM_DEBUG_SPEC
# define ASM_DEBUG_SPEC ""
#endif
/* Here is the spec for running the linker, after compiling all files. */
/* This is overridable by the target in case they need to specify the
-lgcc and -lc order specially, yet not require them to override all
of LINK_COMMAND_SPEC. */
#ifndef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
#endif
2005-07-02 10:52:21 +02:00
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector:}"
#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}"
2005-07-02 10:52:21 +02:00
#endif
#endif
configure.in (HAVE_LD_PIE): Check for ld -pie. * configure.in (HAVE_LD_PIE): Check for ld -pie. * config.in: Rebuilt. * configure: Rebuilt. * toplev.c (flag_pie, flag_shlib): New variables. (f_options): Add -fpie and -fPIE. (parse_options_and_default_flags): Set flag_pic if -fpie/-fPIE. Set flag_shlib if flag_pic and not -fpie/-fPIE. * flags.h (flag_pic, flag_shlib): Add. * varasm.c (default_binds_local_p): Use flag_shlib instead of flag_pic. * gcc.c (LINK_PIE_SPEC): Define. (LINK_COMMAND_SPEC): Use LINK_PIE_SPEC. (option_map): Add --pie -> -pie mapping. * config/sol2.h (ASM_SPEC): Handle -fpie the same way as -fpic and -fPIE the same way as -fPIC. * config/openbsd.h (ASM_SPEC): Likewise. * config/frv/frv.h (ASM_SPEC): Likewise. * config/arm/linux-gas.h (SUBTARGET_CPP_SPEC): Likewise. * config/arm/semi.h (ASM_SPEC): Likewise. * config/arm/netbsd-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise. * config/freebsd-spec.h (FBSD_CPP_SPEC): Likewise. * config/i386/beos-elf.h (CC1_SPEC): Likewise. * config/i386/freebsd-aout.h (ASM_SPEC): Likewise. * config/m68k/linux.h (CPP_SPEC): Likewise. * config/m68k/netbsd.h (ASM_SPEC): Likewise. * config/m68k/openbsd.h (ASM_SPEC): Likewise. * config/m68k/netbsd-elf.h (ASM_SPEC): Likewise. * config/mips/linux.h (SUBTARGET_CPP_SPEC): Likewise. * config/mips/openbsd.h (SUBTARGET_ASM_SPEC): Likewise. * config/pa/pa-linux.h (CPP_SPEC): Likewise. * config/netbsd-aout.h (ASM_SPEC): Likewise. * config/rs6000/sysv4.h (ASM_SPEC, CPP_SYSV_SPEC): Likewise. * config/rs6000/vxworks.h (CPP_SPEC): Likewise. * config/sparc/linux.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise. * config/sparc/linux64.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise. * config/sparc/sparc.h (ASM_SPEC): Likewise. * config/sparc/sp64-elf.h (ASM_SPEC): Likewise. * config/sparc/sysv4.h (ASM_SPEC): Likewise. * config/sparc/netbsd-elf.h (ASM_SPEC): Likewise. * config/sparc/openbsd64.h (ASM_SPEC): Likewise. * config/cris/linux.h (CRIS_ASM_SUBTARGET_SPEC): Likewise. * config/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Handle -pie. Simplify. * config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/i386/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/ia64/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/rs6000/sysv4.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/rs6000/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/sparc/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/sparc/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * doc/invoke.texi: Document -pie, -fpie and -fPIE options. From-SVN: r67359
2003-06-03 11:06:55 +02:00
#ifndef LINK_PIE_SPEC
#ifdef HAVE_LD_PIE
#define LINK_PIE_SPEC "%{pie:-pie} "
#else
#define LINK_PIE_SPEC "%{pie:} "
#endif
#endif
/* -u* was put back because both BSD and SysV seem to support it. */
/* %{static:} simply prevents an error message if the target machine
doesn't handle -static. */
/* We want %{T*} after %{L*} and %D so that it can be used to specify linker
scripts which exist in user specified directories, or in standard
directories. */
#ifndef LINK_COMMAND_SPEC
#define LINK_COMMAND_SPEC "\
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
configure.in (HAVE_LD_PIE): Check for ld -pie. * configure.in (HAVE_LD_PIE): Check for ld -pie. * config.in: Rebuilt. * configure: Rebuilt. * toplev.c (flag_pie, flag_shlib): New variables. (f_options): Add -fpie and -fPIE. (parse_options_and_default_flags): Set flag_pic if -fpie/-fPIE. Set flag_shlib if flag_pic and not -fpie/-fPIE. * flags.h (flag_pic, flag_shlib): Add. * varasm.c (default_binds_local_p): Use flag_shlib instead of flag_pic. * gcc.c (LINK_PIE_SPEC): Define. (LINK_COMMAND_SPEC): Use LINK_PIE_SPEC. (option_map): Add --pie -> -pie mapping. * config/sol2.h (ASM_SPEC): Handle -fpie the same way as -fpic and -fPIE the same way as -fPIC. * config/openbsd.h (ASM_SPEC): Likewise. * config/frv/frv.h (ASM_SPEC): Likewise. * config/arm/linux-gas.h (SUBTARGET_CPP_SPEC): Likewise. * config/arm/semi.h (ASM_SPEC): Likewise. * config/arm/netbsd-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise. * config/freebsd-spec.h (FBSD_CPP_SPEC): Likewise. * config/i386/beos-elf.h (CC1_SPEC): Likewise. * config/i386/freebsd-aout.h (ASM_SPEC): Likewise. * config/m68k/linux.h (CPP_SPEC): Likewise. * config/m68k/netbsd.h (ASM_SPEC): Likewise. * config/m68k/openbsd.h (ASM_SPEC): Likewise. * config/m68k/netbsd-elf.h (ASM_SPEC): Likewise. * config/mips/linux.h (SUBTARGET_CPP_SPEC): Likewise. * config/mips/openbsd.h (SUBTARGET_ASM_SPEC): Likewise. * config/pa/pa-linux.h (CPP_SPEC): Likewise. * config/netbsd-aout.h (ASM_SPEC): Likewise. * config/rs6000/sysv4.h (ASM_SPEC, CPP_SYSV_SPEC): Likewise. * config/rs6000/vxworks.h (CPP_SPEC): Likewise. * config/sparc/linux.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise. * config/sparc/linux64.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise. * config/sparc/sparc.h (ASM_SPEC): Likewise. * config/sparc/sp64-elf.h (ASM_SPEC): Likewise. * config/sparc/sysv4.h (ASM_SPEC): Likewise. * config/sparc/netbsd-elf.h (ASM_SPEC): Likewise. * config/sparc/openbsd64.h (ASM_SPEC): Likewise. * config/cris/linux.h (CRIS_ASM_SUBTARGET_SPEC): Likewise. * config/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Handle -pie. Simplify. * config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/i386/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/ia64/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/rs6000/sysv4.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/rs6000/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/sparc/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/sparc/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * doc/invoke.texi: Document -pie, -fpie and -fPIE options. From-SVN: r67359
2003-06-03 11:06:55 +02:00
%(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
%{fopenmp:%:include(libgomp.spec)%(link_gomp)} %(mflib)\
%{fprofile-arcs|fprofile-generate|coverage:-lgcov}\
%{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif
#ifndef LINK_LIBGCC_SPEC
/* Generate -L options for startfile prefix list. */
# define LINK_LIBGCC_SPEC "%D"
#endif
#ifndef STARTFILE_PREFIX_SPEC
# define STARTFILE_PREFIX_SPEC ""
#endif
#ifndef SYSROOT_SPEC
# define SYSROOT_SPEC "--sysroot=%R"
#endif
#ifndef SYSROOT_SUFFIX_SPEC
# define SYSROOT_SUFFIX_SPEC ""
#endif
#ifndef SYSROOT_HEADERS_SUFFIX_SPEC
# define SYSROOT_HEADERS_SUFFIX_SPEC ""
#endif
static const char *asm_debug;
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
static const char *cpp_spec = CPP_SPEC;
static const char *cc1_spec = CC1_SPEC;
static const char *cc1plus_spec = CC1PLUS_SPEC;
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
2005-07-02 10:52:21 +02:00
static const char *link_ssp_spec = LINK_SSP_SPEC;
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
static const char *asm_spec = ASM_SPEC;
static const char *asm_final_spec = ASM_FINAL_SPEC;
static const char *link_spec = LINK_SPEC;
static const char *lib_spec = LIB_SPEC;
static const char *mfwrap_spec = MFWRAP_SPEC;
static const char *mflib_spec = MFLIB_SPEC;
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
static const char *link_gomp_spec = "";
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
static const char *libgcc_spec = LIBGCC_SPEC;
static const char *endfile_spec = ENDFILE_SPEC;
static const char *startfile_spec = STARTFILE_SPEC;
static const char *switches_need_spaces = SWITCHES_NEED_SPACES;
static const char *linker_name_spec = LINKER_NAME;
static const char *link_command_spec = LINK_COMMAND_SPEC;
static const char *link_libgcc_spec = LINK_LIBGCC_SPEC;
static const char *startfile_prefix_spec = STARTFILE_PREFIX_SPEC;
static const char *sysroot_spec = SYSROOT_SPEC;
static const char *sysroot_suffix_spec = SYSROOT_SUFFIX_SPEC;
static const char *sysroot_hdrs_suffix_spec = SYSROOT_HEADERS_SUFFIX_SPEC;
/* Standard options to cpp, cc1, and as, to reduce duplication in specs.
There should be no need to override these in target dependent files,
but we need to copy them to the specs file so that newer versions
of the GCC driver can correctly drive older tool chains with the
appropriate -B options. */
/* When cpplib handles traditional preprocessing, get rid of this, and
call cc1 (or cc1obj in objc/lang-specs.h) from the main specs so
that we default the front end language better. */
static const char *trad_capable_cpp =
"cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}";
/* We don't wrap .d files in %W{} since a missing .d file, and
therefore no dependency entry, confuses make into thinking a .o
file that happens to exist is up-to-date. */
static const char *cpp_unique_options =
"%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}}\
Add framework support for darwin. * c-incpath.c: Include target.h and machmode.h. (add_path): Use a consistent style for cpp_dir. Initialize p->construct to 0. (add_cpp_dir_path): New. (register_include_chains): Add use of extra_includes callback. (hook_void_int): Add. (target_c_incpath): Add. * c-incpath.h (add_cpp_dir_path): New. (target_c_incpath_s): Add. (target_c_incpath): Add. (C_INCPATH_INIT): Add. * c-opts.c (c_common_missing_argument, c_common_handle_option): Add -F argument processing. * c.opt: Add -F argument processing. * gcc.c (trad_capable_cpp): Add -F argument processing. * cppfiles.c (find_file_in_dir): Update to use construct callback. (search_path_exhausted, cpp_get_path, cpp_get_buffer, cpp_get_prev): New. (_cpp_find_file): Use search_path_exhausted. (make_cpp_dir): Initialize construct to 0. * cpplib.h (missing_header_cb cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New. (cpp_callbacks): Add missing_header (cpp_dir): Add construct. * target-def.h: (TARGET_OPTF): New. * hooks.c (hook_void_int, hook_void_charptr): Add. * hooks.h (hook_void_int, hook_void_charptr): Add. * Makefile.in (c-incpath.o) : Add $(TARGET_H) and $(MACHMODE_H) dependencies. * doc/invoke.texi (Darwin Options): Document -F. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Add. (TARGET_OPTF): Add. * fix-header.c (target_c_incpath): Add. * config/darwin-c.c: Add c-incpath.h include. (using_frameworks, find_subframework_file, find_subframework_header, add_system_framework_path, frameworks_in_use, num_frameworks, max_frameworks, add_framework, find_framework, struct framework_header, framework_header_dirs, framework_construct_pathname, find_subframework_file, add_system_framework_path, add_framework_path, framework_defaults, darwin_register_frameworks, find_subframework_header): Add. * config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New. (TARGET_OPTION_TRANSLATE_TABLE): Add -framework support. (CPP_SPEC): Add __APPLE_CC__ support. * t-darwin (darwin-c.o): Add c-incpath.h dependency. From-SVN: r78875
2004-03-04 01:18:54 +01:00
%{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I\
%{MD:-MD %{!o:%b.d}%{o*:%.d%*}}\
%{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
%{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
%{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\
%{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\
%{H} %C %{D*&U*&A*} %{i*} %Z %i\
%{fmudflap:-D_MUDFLAP -include mf-runtime.h}\
%{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\
%{E|M|MM:%W{o*}}";
/* This contains cpp options which are common with cc1_options and are passed
only when preprocessing only to avoid duplication. We pass the cc1 spec
options to the preprocessor so that it the cc1 spec may manipulate
options used to set target flags. Those special target flags settings may
in turn cause preprocessor symbols to be defined specially. */
static const char *cpp_options =
"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
%{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*}\
%{undef} %{save-temps:-fpch-preprocess}";
/* This contains cpp options which are not passed when the preprocessor
output will be used by another program. */
static const char *cpp_debug_options = "%{d*}";
/* NB: This is shared amongst all front-ends. */
static const char *cc1_options =
"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}\
%{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\
%{v:-version} %{pg:-p} %{p} %{f*} %{undef}\
%{Qn:-fno-ident} %{--help:--help}\
%{--target-help:--target-help}\
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
%{--help=*:--help=%(VALUE)}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
%{fsyntax-only:-o %j} %{-param*}\
%{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\
%{coverage:-fprofile-arcs -ftest-coverage}";
static const char *asm_options =
"%{ftarget-help:%:print-asm-header()} \
%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
static const char *invoke_as =
#ifdef AS_NEEDS_DASH_FOR_PIPED_INPUT
"%{!S:-o %|.s |\n as %(asm_options) %|.s %A }";
#else
"%{!S:-o %|.s |\n as %(asm_options) %m.s %A }";
#endif
/* Some compilers have limits on line lengths, and the multilib_select
and/or multilib_matches strings can be very long, so we build them at
run time. */
static struct obstack multilib_obstack;
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
static const char *multilib_select;
static const char *multilib_matches;
static const char *multilib_defaults;
static const char *multilib_exclusions;
/* Check whether a particular argument is a default argument. */
#ifndef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "" }
#endif
static const char *const multilib_defaults_raw[] = MULTILIB_DEFAULTS;
1992-02-01 06:15:32 +01:00
#ifndef DRIVER_SELF_SPECS
#define DRIVER_SELF_SPECS ""
#endif
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
/* Adding -fopenmp should imply pthreads. This is particularly important
for targets that use different start files and suchlike. */
#ifndef GOMP_SELF_SPECS
#define GOMP_SELF_SPECS "%{fopenmp: -pthread}"
#endif
static const char *const driver_self_specs[] = {
DRIVER_SELF_SPECS, GOMP_SELF_SPECS
};
#ifndef OPTION_DEFAULT_SPECS
#define OPTION_DEFAULT_SPECS { "", "" }
#endif
struct default_spec
{
const char *name;
const char *spec;
};
static const struct default_spec
option_default_specs[] = { OPTION_DEFAULT_SPECS };
struct user_specs
{
1996-10-29 22:21:57 +01:00
struct user_specs *next;
const char *filename;
1996-10-29 22:21:57 +01:00
};
static struct user_specs *user_specs_head, *user_specs_tail;
#ifndef SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR)
1992-02-01 06:15:32 +01:00
#endif
#ifndef WORD_SWITCH_TAKES_ARG
#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
1992-02-01 06:15:32 +01:00
#endif
#ifdef HAVE_TARGET_EXECUTABLE_SUFFIX
/* This defines which switches stop a full compilation. */
#define DEFAULT_SWITCH_CURTAILS_COMPILATION(CHAR) \
((CHAR) == 'c' || (CHAR) == 'S')
#ifndef SWITCH_CURTAILS_COMPILATION
#define SWITCH_CURTAILS_COMPILATION(CHAR) \
DEFAULT_SWITCH_CURTAILS_COMPILATION(CHAR)
#endif
#endif
1992-02-01 06:15:32 +01:00
/* Record the mapping from file suffixes for compilation specs. */
struct compiler
{
const char *suffix; /* Use this compiler for input files
1992-02-01 06:15:32 +01:00
whose names end in this suffix. */
const char *spec; /* To use this compiler, run this spec. */
const char *cpp_spec; /* If non-NULL, substitute this spec
for `%C', rather than the usual
cpp_spec. */
const int combinable; /* If nonzero, compiler can deal with
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
multiple source files at once (IMA). */
const int needs_preprocessing; /* If nonzero, source files need to
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
be run through a preprocessor. */
1992-02-01 06:15:32 +01:00
};
/* Pointer to a vector of `struct compiler' that gives the spec for
compiling a file, based on its suffix.
A file that does not end in any of these suffixes will be passed
unchanged to the loader and nothing else will be done to it.
An entry containing two 0s is used to terminate the vector.
If multiple entries match a file, the last matching one is used. */
static struct compiler *compilers;
/* Number of entries in `compilers', not counting the null terminator. */
static int n_compilers;
/* The default list of file name suffixes and their compilation specs. */
static const struct compiler default_compilers[] =
1992-02-01 06:15:32 +01:00
{
/* Add lists of suffixes of known languages here. If those languages
were not present when we built the driver, we will hit these copies
and be given a more meaningful error than "file not used since
linking is not done". */
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
{".m", "#Objective-C", 0, 0, 0}, {".mi", "#Objective-C", 0, 0, 0},
{".mm", "#Objective-C++", 0, 0, 0}, {".M", "#Objective-C++", 0, 0, 0},
{".mii", "#Objective-C++", 0, 0, 0},
{".cc", "#C++", 0, 0, 0}, {".cxx", "#C++", 0, 0, 0},
{".cpp", "#C++", 0, 0, 0}, {".cp", "#C++", 0, 0, 0},
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
{".c++", "#C++", 0, 0, 0}, {".C", "#C++", 0, 0, 0},
{".CPP", "#C++", 0, 0, 0}, {".ii", "#C++", 0, 0, 0},
{".ads", "#Ada", 0, 0, 0}, {".adb", "#Ada", 0, 0, 0},
{".f", "#Fortran", 0, 0, 0}, {".for", "#Fortran", 0, 0, 0},
{".fpp", "#Fortran", 0, 0, 0}, {".F", "#Fortran", 0, 0, 0},
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
{".FOR", "#Fortran", 0, 0, 0}, {".FPP", "#Fortran", 0, 0, 0},
{".f90", "#Fortran", 0, 0, 0}, {".f95", "#Fortran", 0, 0, 0},
{".F90", "#Fortran", 0, 0, 0}, {".F95", "#Fortran", 0, 0, 0},
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
{".r", "#Ratfor", 0, 0, 0},
{".p", "#Pascal", 0, 0, 0}, {".pas", "#Pascal", 0, 0, 0},
{".java", "#Java", 0, 0, 0}, {".class", "#Java", 0, 0, 0},
{".zip", "#Java", 0, 0, 0}, {".jar", "#Java", 0, 0, 0},
/* Next come the entries for C. */
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
{".c", "@c", 0, 1, 1},
1992-02-01 06:15:32 +01:00
{"@c",
/* cc1 has an integrated ISO C preprocessor. We should invoke the
c-common.c, [...]: Delete code implementing -traditional mode. * c-common.c, c-common.h, c-decl.c, c-lex.c, c-parse.in, c-tree.h, c-typeck.c, cppexp.c, cpplex.c, cpplib.c, cpplib.h, cppmacro.c, objc/lang-specs.h, objc/objc-act.c, builtin-types.def, builtins.def, dwarf2out.c, dwarfout.c, gcc.c, toplev.c: Delete code implementing -traditional mode. * ada/misc.c, ch/ch-tree.h, ch/decl.c, cp/decl2.c, f/com.c, f/lex.c, f/top.c, java/builtins.c, java/decl.c: Delete traditional-mode-related code copied from the C front end but not used, or used only to permit the compiler to link. * doc/bugreport.texi, doc/cpp.texi, doc/extend.texi, doc/invoke.texi, doc/standards.texi, doc/trouble.texi: Document removal of -traditional mode for compilation, and remove documentation only relevant to that mode. * config/nextstep.h, config/ptx4.h, config/svr4.h, config/convex/convex.h, config/d30v/d30v.h, config/i386/dgux.h, config/i386/osf1elf.h, config/i386/osfelf.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/sol2.h, config/m68k/a-ux.h, config/m68k/hp310.h, config/m88k/dgux.h, config/m88k/dguxbcs.h, config/m88k/luna.h, config/m88k/m88k.c, config/m88k/m88k.h, config/m88k/openbsd.h, config/mips/abi64.h, config/mips/osfrose.h, config/mips/svr4-5.h, config/mips/svr4-t.h, config/sparc/sol2-sld-64.h, config/sparc/sol2.h, config/stormy16/stormy16.h: Remove all references to -traditional from target specs. Delete all mention of the no-longer-necessary TRADITIONAL_RETURN_FLOAT macro. Also delete a couple of commented-out definitions of DOLLARS_IN_IDENTIFIERS, with (incorrect) commentary referring to -traditional. * system.h: Poison TRADITIONAL_RETURN_FLOAT. * doc/tm.texi: Remove mention of TRADITIONAL_RETURN_FLOAT macro. * testsuite/gcc.c-torture/execute/920730-1t.c, testsuite/gcc.c-torture/execute/920730-1t.x, testsuite/gcc.dg/ext-glob.c: Delete test cases, only relevant to -traditional. From-SVN: r50110
2002-02-27 19:48:07 +01:00
external preprocessor if -save-temps is given. */
"%{E|M|MM:%(trad_capable_cpp) %(cpp_options) %(cpp_debug_options)}\
%{!E:%{!M:%{!MM:\
c-common.c, [...]: Delete code implementing -traditional mode. * c-common.c, c-common.h, c-decl.c, c-lex.c, c-parse.in, c-tree.h, c-typeck.c, cppexp.c, cpplex.c, cpplib.c, cpplib.h, cppmacro.c, objc/lang-specs.h, objc/objc-act.c, builtin-types.def, builtins.def, dwarf2out.c, dwarfout.c, gcc.c, toplev.c: Delete code implementing -traditional mode. * ada/misc.c, ch/ch-tree.h, ch/decl.c, cp/decl2.c, f/com.c, f/lex.c, f/top.c, java/builtins.c, java/decl.c: Delete traditional-mode-related code copied from the C front end but not used, or used only to permit the compiler to link. * doc/bugreport.texi, doc/cpp.texi, doc/extend.texi, doc/invoke.texi, doc/standards.texi, doc/trouble.texi: Document removal of -traditional mode for compilation, and remove documentation only relevant to that mode. * config/nextstep.h, config/ptx4.h, config/svr4.h, config/convex/convex.h, config/d30v/d30v.h, config/i386/dgux.h, config/i386/osf1elf.h, config/i386/osfelf.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/sol2.h, config/m68k/a-ux.h, config/m68k/hp310.h, config/m88k/dgux.h, config/m88k/dguxbcs.h, config/m88k/luna.h, config/m88k/m88k.c, config/m88k/m88k.h, config/m88k/openbsd.h, config/mips/abi64.h, config/mips/osfrose.h, config/mips/svr4-5.h, config/mips/svr4-t.h, config/sparc/sol2-sld-64.h, config/sparc/sol2.h, config/stormy16/stormy16.h: Remove all references to -traditional from target specs. Delete all mention of the no-longer-necessary TRADITIONAL_RETURN_FLOAT macro. Also delete a couple of commented-out definitions of DOLLARS_IN_IDENTIFIERS, with (incorrect) commentary referring to -traditional. * system.h: Poison TRADITIONAL_RETURN_FLOAT. * doc/tm.texi: Remove mention of TRADITIONAL_RETURN_FLOAT macro. * testsuite/gcc.c-torture/execute/920730-1t.c, testsuite/gcc.c-torture/execute/920730-1t.x, testsuite/gcc.dg/ext-glob.c: Delete test cases, only relevant to -traditional. From-SVN: r50110
2002-02-27 19:48:07 +01:00
%{traditional|ftraditional:\
%eGNU C no longer supports -traditional without -E}\
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
%{!combine:\
%{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i} \n\
cc1 -fpreprocessed %{save-temps:%b.i} %{!save-temps:%g.i} \
%(cc1_options)}\
%{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
cc1 %(cpp_unique_options) %(cc1_options)}}}\
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
%{!fsyntax-only:%(invoke_as)}} \
%{combine:\
%{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i}}\
%{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
cc1 %(cpp_unique_options) %(cc1_options)}}\
%{!fsyntax-only:%(invoke_as)}}}}}}", 0, 1, 1},
1992-02-01 06:15:32 +01:00
{"-",
"%{!E:%e-E or -x required when input is from standard input}\
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
%(trad_capable_cpp) %(cpp_options) %(cpp_debug_options)", 0, 0, 0},
{".h", "@c-header", 0, 0, 0},
1992-02-01 06:15:32 +01:00
{"@c-header",
/* cc1 has an integrated ISO C preprocessor. We should invoke the
external preprocessor if -save-temps is given. */
"%{E|M|MM:%(trad_capable_cpp) %(cpp_options) %(cpp_debug_options)}\
%{!E:%{!M:%{!MM:\
%{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i} \n\
cc1 -fpreprocessed %{save-temps:%b.i} %{!save-temps:%g.i} \
%(cc1_options)\
-o %g.s %{!o*:--output-pch=%i.gch}\
%W{o*:--output-pch=%*}%V}\
%{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
cc1 %(cpp_unique_options) %(cc1_options)\
-o %g.s %{!o*:--output-pch=%i.gch}\
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
%W{o*:--output-pch=%*}%V}}}}}}", 0, 0, 0},
{".i", "@cpp-output", 0, 1, 0},
1992-02-01 06:15:32 +01:00
{"@cpp-output",
"%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
{".s", "@assembler", 0, 1, 0},
1992-02-01 06:15:32 +01:00
{"@assembler",
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 1, 0},
{".S", "@assembler-with-cpp", 0, 1, 0},
1992-02-01 06:15:32 +01:00
{"@assembler-with-cpp",
#ifdef AS_NEEDS_DASH_FOR_PIPED_INPUT
"%(trad_capable_cpp) -lang-asm %(cpp_options)\
%{E|M|MM:%(cpp_debug_options)}\
%{!M:%{!MM:%{!E:%{!S:-o %|.s |\n\
as %(asm_debug) %(asm_options) %|.s %A }}}}"
#else
"%(trad_capable_cpp) -lang-asm %(cpp_options)\
%{E|M|MM:%(cpp_debug_options)}\
%{!M:%{!MM:%{!E:%{!S:-o %|.s |\n\
as %(asm_debug) %(asm_options) %m.s %A }}}}"
#endif
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
, 0, 1, 0},
#include "specs.h"
/* Mark end of table. */
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
{0, 0, 0, 0, 0}
1992-02-01 06:15:32 +01:00
};
/* Number of elements in default_compilers, not counting the terminator. */
static const int n_default_compilers = ARRAY_SIZE (default_compilers) - 1;
1992-02-01 06:15:32 +01:00
/* A vector of options to give to the linker.
These options are accumulated by %x,
1992-02-01 06:15:32 +01:00
and substituted into the linker command with %X. */
static int n_linker_options;
static char **linker_options;
/* A vector of options to give to the assembler.
These options are accumulated by -Wa,
and substituted into the assembler command with %Y. */
static int n_assembler_options;
static char **assembler_options;
/* A vector of options to give to the preprocessor.
These options are accumulated by -Wp,
and substituted into the preprocessor command with %Z. */
static int n_preprocessor_options;
static char **preprocessor_options;
1992-02-01 06:15:32 +01:00
/* Define how to map long options into short ones. */
/* This structure describes one mapping. */
struct option_map
{
/* The long option's name. */
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
const char *const name;
/* The equivalent short option. */
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
const char *const equivalent;
/* Argument info. A string of flag chars; NULL equals no options.
a => argument required.
o => argument optional.
j => join argument to equivalent, making one word.
* => require other text after NAME as an argument. */
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
const char *const arg_info;
};
/* This is the table of mappings. Mappings are tried sequentially
for each option encountered; the first one that matches, wins. */
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
static const struct option_map option_map[] =
{
{"--all-warnings", "-Wall", 0},
{"--ansi", "-ansi", 0},
{"--assemble", "-S", 0},
{"--assert", "-A", "a"},
{"--classpath", "-fclasspath=", "aj"},
{"--bootclasspath", "-fbootclasspath=", "aj"},
{"--CLASSPATH", "-fclasspath=", "aj"},
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
{"--combine", "-combine", 0},
{"--comments", "-C", 0},
{"--comments-in-macros", "-CC", 0},
{"--compile", "-c", 0},
{"--debug", "-g", "oj"},
{"--define-macro", "-D", "aj"},
{"--dependencies", "-M", 0},
{"--dump", "-d", "a"},
{"--dumpbase", "-dumpbase", "a"},
{"--encoding", "-fencoding=", "aj"},
{"--entry", "-e", 0},
{"--extra-warnings", "-W", 0},
{"--extdirs", "-fextdirs=", "aj"},
{"--for-assembler", "-Wa", "a"},
{"--for-linker", "-Xlinker", "a"},
{"--force-link", "-u", "a"},
{"--coverage", "-coverage", 0},
{"--imacros", "-imacros", "a"},
{"--include", "-include", "a"},
{"--include-barrier", "-I-", 0},
{"--include-directory", "-I", "aj"},
{"--include-directory-after", "-idirafter", "a"},
{"--include-prefix", "-iprefix", "a"},
{"--include-with-prefix", "-iwithprefix", "a"},
{"--include-with-prefix-before", "-iwithprefixbefore", "a"},
{"--include-with-prefix-after", "-iwithprefix", "a"},
{"--language", "-x", "a"},
{"--library-directory", "-L", "a"},
{"--machine", "-m", "aj"},
{"--machine-", "-m", "*j"},
{"--no-integrated-cpp", "-no-integrated-cpp", 0},
{"--no-line-commands", "-P", 0},
{"--no-precompiled-includes", "-noprecomp", 0},
{"--no-standard-includes", "-nostdinc", 0},
{"--no-standard-libraries", "-nostdlib", 0},
{"--no-warnings", "-w", 0},
{"--optimize", "-O", "oj"},
{"--output", "-o", "a"},
{"--output-class-directory", "-foutput-class-dir=", "ja"},
{"--param", "--param", "a"},
{"--pass-exit-codes", "-pass-exit-codes", 0},
{"--pedantic", "-pedantic", 0},
{"--pedantic-errors", "-pedantic-errors", 0},
configure.in (HAVE_LD_PIE): Check for ld -pie. * configure.in (HAVE_LD_PIE): Check for ld -pie. * config.in: Rebuilt. * configure: Rebuilt. * toplev.c (flag_pie, flag_shlib): New variables. (f_options): Add -fpie and -fPIE. (parse_options_and_default_flags): Set flag_pic if -fpie/-fPIE. Set flag_shlib if flag_pic and not -fpie/-fPIE. * flags.h (flag_pic, flag_shlib): Add. * varasm.c (default_binds_local_p): Use flag_shlib instead of flag_pic. * gcc.c (LINK_PIE_SPEC): Define. (LINK_COMMAND_SPEC): Use LINK_PIE_SPEC. (option_map): Add --pie -> -pie mapping. * config/sol2.h (ASM_SPEC): Handle -fpie the same way as -fpic and -fPIE the same way as -fPIC. * config/openbsd.h (ASM_SPEC): Likewise. * config/frv/frv.h (ASM_SPEC): Likewise. * config/arm/linux-gas.h (SUBTARGET_CPP_SPEC): Likewise. * config/arm/semi.h (ASM_SPEC): Likewise. * config/arm/netbsd-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise. * config/freebsd-spec.h (FBSD_CPP_SPEC): Likewise. * config/i386/beos-elf.h (CC1_SPEC): Likewise. * config/i386/freebsd-aout.h (ASM_SPEC): Likewise. * config/m68k/linux.h (CPP_SPEC): Likewise. * config/m68k/netbsd.h (ASM_SPEC): Likewise. * config/m68k/openbsd.h (ASM_SPEC): Likewise. * config/m68k/netbsd-elf.h (ASM_SPEC): Likewise. * config/mips/linux.h (SUBTARGET_CPP_SPEC): Likewise. * config/mips/openbsd.h (SUBTARGET_ASM_SPEC): Likewise. * config/pa/pa-linux.h (CPP_SPEC): Likewise. * config/netbsd-aout.h (ASM_SPEC): Likewise. * config/rs6000/sysv4.h (ASM_SPEC, CPP_SYSV_SPEC): Likewise. * config/rs6000/vxworks.h (CPP_SPEC): Likewise. * config/sparc/linux.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise. * config/sparc/linux64.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise. * config/sparc/sparc.h (ASM_SPEC): Likewise. * config/sparc/sp64-elf.h (ASM_SPEC): Likewise. * config/sparc/sysv4.h (ASM_SPEC): Likewise. * config/sparc/netbsd-elf.h (ASM_SPEC): Likewise. * config/sparc/openbsd64.h (ASM_SPEC): Likewise. * config/cris/linux.h (CRIS_ASM_SUBTARGET_SPEC): Likewise. * config/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Handle -pie. Simplify. * config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/i386/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/ia64/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/rs6000/sysv4.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/rs6000/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/sparc/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * config/sparc/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. * doc/invoke.texi: Document -pie, -fpie and -fPIE options. From-SVN: r67359
2003-06-03 11:06:55 +02:00
{"--pie", "-pie", 0},
{"--pipe", "-pipe", 0},
{"--prefix", "-B", "a"},
{"--preprocess", "-E", 0},
{"--print-search-dirs", "-print-search-dirs", 0},
{"--print-file-name", "-print-file-name=", "aj"},
{"--print-libgcc-file-name", "-print-libgcc-file-name", 0},
{"--print-missing-file-dependencies", "-MG", 0},
{"--print-multi-lib", "-print-multi-lib", 0},
{"--print-multi-directory", "-print-multi-directory", 0},
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
{"--print-multi-os-directory", "-print-multi-os-directory", 0},
{"--print-prog-name", "-print-prog-name=", "aj"},
re PR bootstrap/31020 (cannot write in </test/gnu/gcc/objdir/prev-gcc/../gcc/./include>) fixincludes: * mkheaders.in: Fix headers for each multilib required. gcc: PR bootstrap/31020 * configure.ac (CROSS_SYSTEM_HEADER_DIR, build_system_header_dir): Define using $${sysroot_headers_suffix}. * configure: Regenerate. * cppdefault.c (cpp_include_defaults): Make FIXED_INCLUDE_DIR a multilib-suffixed directory if SYSROOT_HEADERS_SUFFIX_SPEC defined. * doc/invoke.texi (-print-sysroot-headers-suffix): Document. * gcc.c (print_sysroot_headers_suffix): New. (option_map): Include --print-sysroot-headers-suffix. (display_help): Mention -print-sysroot-headers-suffix. (process_command): Handle -print-sysroot-headers-suffix. (do_spec_1): Append multilib directory to include-fixed path if sysroot suffixes in use. (main): Handle -print-sysroot-headers-suffix. * Makefile.in (start.encap): Don't depend on xlimits.h (xlimits.h): Remove. (stmp-int-hdrs): Don't depend on xlimits.h. Inline generation of limits.h for each multilib in fixinc_list. (fixinc_list, s-fixinc_list): New. (stmp-fixinc): Depend on fixinc_list. If not copying headers, generate them for each multilib in fixinc_list. (stmp-fixproto): Use include-fixed. Run fixproto for each multilib in fixinc_list. (mostlyclean): Don't remove xlimits.h. (clean): Remove include-fixed. (real-install-headers-tar, real-install-headers-cpio, real-install-headers-cp): Don't copy include, only include-fixed. (install-mkheaders): Depend on fixinc_list. Don't depend on xlimits.h. Save limits.h files for each multilib in fixinc_list. Always save mkinstalldirs. Preserve ${sysroot_headers_suffix} in SYSTEM_HEADER_DIR setting in mkheaders.conf. From-SVN: r122620
2007-03-06 16:50:28 +01:00
{"--print-sysroot-headers-suffix", "-print-sysroot-headers-suffix", 0},
{"--profile", "-p", 0},
{"--profile-blocks", "-a", 0},
{"--quiet", "-q", 0},
{"--resource", "-fcompile-resource=", "aj"},
{"--save-temps", "-save-temps", 0},
{"--shared", "-shared", 0},
{"--silent", "-q", 0},
1996-10-29 22:21:57 +01:00
{"--specs", "-specs=", "aj"},
{"--static", "-static", 0},
{"--std", "-std=", "aj"},
{"--symbolic", "-symbolic", 0},
{"--sysroot", "--sysroot=", "aj"},
{"--time", "-time", 0},
{"--trace-includes", "-H", 0},
{"--traditional", "-traditional", 0},
{"--traditional-cpp", "-traditional-cpp", 0},
{"--trigraphs", "-trigraphs", 0},
{"--undefine-macro", "-U", "aj"},
{"--user-dependencies", "-MM", 0},
{"--verbose", "-v", 0},
{"--warn-", "-W", "*j"},
{"--write-dependencies", "-MD", 0},
{"--write-user-dependencies", "-MMD", 0},
{"--", "-f", "*j"}
};
#ifdef TARGET_OPTION_TRANSLATE_TABLE
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
static const struct {
const char *const option_found;
const char *const replacements;
} target_option_translations[] =
{
TARGET_OPTION_TRANSLATE_TABLE,
{ 0, 0 }
};
#endif
/* Translate the options described by *ARGCP and *ARGVP.
Make a new vector and store it back in *ARGVP,
and store its length in *ARGVC. */
static void
translate_options (int *argcp, const char *const **argvp)
{
Warning fixes: * Makefile.in (sched.o): Depend on recog.h. * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to (unsigned) when comparing against one. (find_base_value): Likewise. (record_base_value): Cast variable `regno' to (unsigned) when comparing against one. Cast the result of REGNO() macro to (unsigned) when comparing against one. (memrefs_conflict_p): Change type of variables `r_x' and `r_y' to unsigned. (init_alias_analysis): Add unsigned variable `ui'. Use it as loop variable where an unsigned index is needed. * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code) before comparing against one. * collect2.c: Add prototypes for functions `error', `fatal' and `fatal_perror'. Make these functions take variable arguments instead of faking it with a fixed number of args. (write_c_file_stat): Cast the argument of ctype macro to (unsigned char). * combine.c (can_combine_p): Mark parameter `pred' with ATTRIBUTE_UNUSED. (find_split_point): Cast variable `src' to (unsigned HOST_WIDE_INT) when comparing against one. HOST_WIDE_INT) when comparing against one. (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_logical): Likewise. (force_to_mode): Cast result of INTVAL() macro to (unsigned HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_and_const_int): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (merge_outer_ops): Cast variable const0 to `unsigned HOST_WIDE_INT' when comparing against the result of GET_MODE_MASK() macro. (simplify_comparison): Likewise for variable `c0'. Cast variable `const_op' to `unsigned HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'. config/mips/mips.c (gen_int_relational): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (output_block_move): Cast `sizeof' expression to (int) when comparing against one. (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing against one. (save_restore_insns): Cast `base_offset' to `long' to match format specifier in fprintf. * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro to `enum machine_mode'. * flow.c (life_analysis_1): Remove unused variable `insn'. * gcc.c (translate_options): Move variables `j' and `k' into the scope in which they are used. Change their types to `size_t'. (set_spec): Cast the argument of ctype macro to `unsigned char'. (read_specs): Likewise. (process_command): Cast `sizeof' to (int) when comparing against one. (do_spec_1): Cast the argument of ctype macro to `unsigned char'. (handle_braces): Cast both sides of `==' expression to `long' to ensure sign matching. (main): Cast variable `i' to `int' when comparing against one. * gcov-io.h (__fetch_long): Change type of parameter `bytes' from int to size_t. Cast variable `i' to size_t when comparing against one. * genattrtab.c (convert_set_attr_alternative): Remove unused parameter `insn_code'. All callers changed. (convert_set_attr): Likewise. * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to size_t when comparing against one. Likewise for variable `len'. * global.c (global_alloc): Cast variable `max_regno' to size_t when comparing against one. Likewise for variable `max_allocno'. * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED. * local-alloc.c (validate_equiv_mem_from_store): Mark parameter `set' with ATTRIBUTE_UNUSED. (find_free_reg): Cast `sizeof' expression to (int) when comparing against one. * loop.c (count_loop_regs_set): Remove unused variable `dest'. (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED. (get_condition): Cast variable `const_val' to `unsigned HOST_WIDE_INT' when comparing against one. Cast unsigned expression to HOST_WIDE_INT when comparing against one. (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED. (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to `unsigned' when comparing against one. * protoize.c (is_id_char): Change type of parameter `ch' to unsigned char. (munge_compile_params): Cast argument of ctype macro to (const unsigned char). (process_aux_info_file): Cast variable `aux_info_size' to int when comparing against one. (forward_to_next_token_char): Cast argument of ctype macro to `const unsigned char'. (edit_formals_lists): Likewise. (find_rightmost_formals_list): Likewise. (add_local_decl): Likewise. (add_global_decls): Likewise. (edit_fn_definition): Likewise. (do_cleaning): Likewise. (scan_for_missed_items): Likewise. (edit_file): Cast variable `orig_size' to (int) when comparing against one. (main): Cast argument of ctype macro to `const unsigned char'. * recog.c (const_int_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED. * regclass.c (record_reg_classes): Change type of variable `c' to `unsigned char'. Cast `char' array index to `unsigned char'. * reload.c (push_secondary_reload): Cast argument to REG_CLASS_FROM_LETTER() macro to `unsigned char'. * reload1.c (calculate_needs): Cast `char' array index to `unsigned char'. (set_label_offsets): Change type of variable `i' to unsigned int. Cast result of XVECLEN() macro to unsigned when comparing against one. (mark_not_eliminable): Change type of variable `i' to unsigned. (order_regs_for_reload): Likewise. Cast `max_regno' to unsigned when comparing against one. (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when comparing against one. (choose_reload_regs): Hide unused label `fail'. (reload_cse_simplify_operands): Cast `char' array index to `unsigned char'. (reload_combine_note_store): Mark parameter `set' with ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing against one. (reload_cse_move2add): Remove unused variable `src2'. * sched.c: Include recog.h. (sched_note_set): Remove unused parameter `b'. All callers changed. (split_hard_reg_notes): Likewise for parameter `orig_insn'. (blockage_range): Cast result of UNIT_BLOCKED() macro to (int) when comparing against one. * stupid.c (stupid_find_reg): Mark parameter `changes_size' with ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when comparing against one. * unroll.c (precondition_loop_p): Remove unused parameter `loop_end'. All callers changed. From-SVN: r23079
1998-10-14 11:02:55 +02:00
int i;
int argc = *argcp;
const char *const *argv = *argvp;
int newvsize = (argc + 2) * 2 * sizeof (const char *);
const char **newv = xmalloc (newvsize);
int newindex = 0;
i = 0;
newv[newindex++] = argv[i++];
while (i < argc)
{
#ifdef TARGET_OPTION_TRANSLATE_TABLE
int tott_idx;
for (tott_idx = 0;
target_option_translations[tott_idx].option_found;
tott_idx++)
{
if (strcmp (target_option_translations[tott_idx].option_found,
argv[i]) == 0)
{
int spaces = 1;
const char *sp;
char *np;
for (sp = target_option_translations[tott_idx].replacements;
*sp; sp++)
{
if (*sp == ' ')
spaces ++;
}
newvsize += spaces * sizeof (const char *);
newv = xrealloc (newv, newvsize);
sp = target_option_translations[tott_idx].replacements;
np = xstrdup (sp);
while (1)
{
while (*np == ' ')
np++;
if (*np == 0)
break;
newv[newindex++] = np;
while (*np != ' ' && *np)
np++;
if (*np == 0)
break;
*np++ = 0;
}
i ++;
break;
}
}
if (target_option_translations[tott_idx].option_found)
continue;
#endif
/* Translate -- options. */
if (argv[i][0] == '-' && argv[i][1] == '-')
{
Warning fixes: * Makefile.in (sched.o): Depend on recog.h. * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to (unsigned) when comparing against one. (find_base_value): Likewise. (record_base_value): Cast variable `regno' to (unsigned) when comparing against one. Cast the result of REGNO() macro to (unsigned) when comparing against one. (memrefs_conflict_p): Change type of variables `r_x' and `r_y' to unsigned. (init_alias_analysis): Add unsigned variable `ui'. Use it as loop variable where an unsigned index is needed. * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code) before comparing against one. * collect2.c: Add prototypes for functions `error', `fatal' and `fatal_perror'. Make these functions take variable arguments instead of faking it with a fixed number of args. (write_c_file_stat): Cast the argument of ctype macro to (unsigned char). * combine.c (can_combine_p): Mark parameter `pred' with ATTRIBUTE_UNUSED. (find_split_point): Cast variable `src' to (unsigned HOST_WIDE_INT) when comparing against one. HOST_WIDE_INT) when comparing against one. (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_logical): Likewise. (force_to_mode): Cast result of INTVAL() macro to (unsigned HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_and_const_int): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (merge_outer_ops): Cast variable const0 to `unsigned HOST_WIDE_INT' when comparing against the result of GET_MODE_MASK() macro. (simplify_comparison): Likewise for variable `c0'. Cast variable `const_op' to `unsigned HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'. config/mips/mips.c (gen_int_relational): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (output_block_move): Cast `sizeof' expression to (int) when comparing against one. (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing against one. (save_restore_insns): Cast `base_offset' to `long' to match format specifier in fprintf. * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro to `enum machine_mode'. * flow.c (life_analysis_1): Remove unused variable `insn'. * gcc.c (translate_options): Move variables `j' and `k' into the scope in which they are used. Change their types to `size_t'. (set_spec): Cast the argument of ctype macro to `unsigned char'. (read_specs): Likewise. (process_command): Cast `sizeof' to (int) when comparing against one. (do_spec_1): Cast the argument of ctype macro to `unsigned char'. (handle_braces): Cast both sides of `==' expression to `long' to ensure sign matching. (main): Cast variable `i' to `int' when comparing against one. * gcov-io.h (__fetch_long): Change type of parameter `bytes' from int to size_t. Cast variable `i' to size_t when comparing against one. * genattrtab.c (convert_set_attr_alternative): Remove unused parameter `insn_code'. All callers changed. (convert_set_attr): Likewise. * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to size_t when comparing against one. Likewise for variable `len'. * global.c (global_alloc): Cast variable `max_regno' to size_t when comparing against one. Likewise for variable `max_allocno'. * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED. * local-alloc.c (validate_equiv_mem_from_store): Mark parameter `set' with ATTRIBUTE_UNUSED. (find_free_reg): Cast `sizeof' expression to (int) when comparing against one. * loop.c (count_loop_regs_set): Remove unused variable `dest'. (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED. (get_condition): Cast variable `const_val' to `unsigned HOST_WIDE_INT' when comparing against one. Cast unsigned expression to HOST_WIDE_INT when comparing against one. (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED. (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to `unsigned' when comparing against one. * protoize.c (is_id_char): Change type of parameter `ch' to unsigned char. (munge_compile_params): Cast argument of ctype macro to (const unsigned char). (process_aux_info_file): Cast variable `aux_info_size' to int when comparing against one. (forward_to_next_token_char): Cast argument of ctype macro to `const unsigned char'. (edit_formals_lists): Likewise. (find_rightmost_formals_list): Likewise. (add_local_decl): Likewise. (add_global_decls): Likewise. (edit_fn_definition): Likewise. (do_cleaning): Likewise. (scan_for_missed_items): Likewise. (edit_file): Cast variable `orig_size' to (int) when comparing against one. (main): Cast argument of ctype macro to `const unsigned char'. * recog.c (const_int_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED. * regclass.c (record_reg_classes): Change type of variable `c' to `unsigned char'. Cast `char' array index to `unsigned char'. * reload.c (push_secondary_reload): Cast argument to REG_CLASS_FROM_LETTER() macro to `unsigned char'. * reload1.c (calculate_needs): Cast `char' array index to `unsigned char'. (set_label_offsets): Change type of variable `i' to unsigned int. Cast result of XVECLEN() macro to unsigned when comparing against one. (mark_not_eliminable): Change type of variable `i' to unsigned. (order_regs_for_reload): Likewise. Cast `max_regno' to unsigned when comparing against one. (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when comparing against one. (choose_reload_regs): Hide unused label `fail'. (reload_cse_simplify_operands): Cast `char' array index to `unsigned char'. (reload_combine_note_store): Mark parameter `set' with ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing against one. (reload_cse_move2add): Remove unused variable `src2'. * sched.c: Include recog.h. (sched_note_set): Remove unused parameter `b'. All callers changed. (split_hard_reg_notes): Likewise for parameter `orig_insn'. (blockage_range): Cast result of UNIT_BLOCKED() macro to (int) when comparing against one. * stupid.c (stupid_find_reg): Mark parameter `changes_size' with ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when comparing against one. * unroll.c (precondition_loop_p): Remove unused parameter `loop_end'. All callers changed. From-SVN: r23079
1998-10-14 11:02:55 +02:00
size_t j;
/* Find a mapping that applies to this option. */
optabs.c (init_optabs): Initialize fixtab... * optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab, and extendtab within their proper array boundaries. * emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds for the entire array. * config/arm/arm.c (arm_override_options): Use ARRAY_SIZE. * config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise. * config/avr/avr.c (order_regs_for_local_alloc): Likewise. * config/fr30/fr30.c (fr30_print_operand): Likewise. * config/i386/dgux.c (output_options): Likewise. * config/i386/dgux.h (ASM_FILE_START): Likewise. * config/m88k/m88k.c (output_options): Likewise. * config/m88k/m88k.h (ASM_FILE_START): Likewise. * config/mcore/mcore.c (mcore_output_inline_const_forced, layout_mcore_frame, handle_structs_in_regs): Likewise. * config/mips/mips.c (output_block_move): Likewise. * config/rs6000/rs6000.c (rs6000_override_options, rs6000_file_start): Likewise. * config/sparc/sparc.c (sparc_add_gc_roots): Likewise. * fixinc/fixfixes.c (FIX_TABLE_CT): Likewise. * fixinc/fixtests.c (TEST_TABLE_CT): Likewise. * builtins.c (expand_builtin_setjmp): Likewise. * expr.c (safe_from_p): Likewise. * flow.c (life_analysis): Likewise. * fold-const.c (size_int_type_wide): Likewise. * gcc.c (translate_options, init_spec, set_spec, main): Likewise. * genattrtab.c (make_length_attrs): Likewise. * genopinit.c (gen_insn): Likewise. * genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise. * global.c (global_alloc): Likewise. * local-alloc.c (find_free_reg): Likewise. * mips-tdump.c (print_symbol): Likewise. * mips-tfile.c (parse_def, parse_input): Likewise. * reload1.c (NUM_ELIMINABLE_REGS): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * stor-layout.c (set_sizetype): Likewise. * varasm.c (decode_reg_name): Likewise. * toplev.c (decode_f_option, decode_W_option, set_target_switch, print_switch_values): Likewise. (NUM_ELEM): Remove macro. (display_help, main): s/NUM_ELEM/ARRAY_SIZE/ From-SVN: r35949
2000-08-24 22:31:35 +02:00
for (j = 0; j < ARRAY_SIZE (option_map); j++)
{
c-decl (finish_struct): Change type of min_align to unsigned. d gcc/ChangeLog: * c-decl (finish_struct): Change type of min_align to unsigned. * cplus-dem.c (demangle_function_name): Change type of variable i to size_t; remove unused variable len. * dwarf2out.c (reg_save): Add explicit cast of -1 to unsigned and a comment indicating this is proper behaviour. (reg_loc_descriptor): Remove redundant comparison of unsigned variable reg >= 0. (based_loc_descr): Likewise. * enquire.c (bitpattern): Change type of variable i to unsigned. * final.c (output_asm_insn): Don't cast insn_noperands to unsigned. * flow.c (life_analysis): Change type of variable i to size_t; remove unused variable insn. * gcc.c (translate_options): Change type of variables optlen, arglen and complen to size_t. (input_filename_length): Change type to size_t. (do_spec_1): Change type of variable bufsize to size_t. (main): Change type of variables i and j to size_t; remove subblock local definition of variable i. (lookup_compiler): Change type of second argument to size_t; change type of variable i to size_t. * genemit.c (output_init_mov_optab): Change type of variable i to size_t. * genopinit.c (get_insn): Change type of variable pindex to size_t. * genrecog.c (add_to_sequence): Change type of variable i to size_t. * global.c (global_alloc): Change type of variable i to size_t. * regclass.c (init_reg_sets): Change type of variables i and j to unsigned. * stmt.c (expand_end_bindings): Change type of variable i to size_t. (expand_end_case): Change type of variable count to size_t. * toplev.c (main): Change type of variable j to size_t. (set_target_switch): Change type of variable j to size_t. (print_switch_values): Change type of variable j to size_t; remove unused variable flags. * varasm.c (assemble_variable): Change type of variable align to size_t. (const_hash_rtx): Change type of variable i to size_t. gcc/cp/ChangeLog: Sun Mar 8 17:13:38 1998 Manfred Hollstein <manfred@s-direktnet.de> * decl2.c (lang_decode_option): Change j's type to size_t. * tree.c (layout_vbasetypes): record_align and desired_align are of type unsigned int; const_size and nonvirtual_const_size likewise. From-SVN: r18490
1998-03-12 01:02:51 +01:00
size_t optlen = strlen (option_map[j].name);
size_t arglen = strlen (argv[i]);
size_t complen = arglen > optlen ? optlen : arglen;
const char *arginfo = option_map[j].arg_info;
if (arginfo == 0)
arginfo = "";
if (!strncmp (argv[i], option_map[j].name, complen))
{
const char *arg = 0;
if (arglen < optlen)
{
Warning fixes: * Makefile.in (sched.o): Depend on recog.h. * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to (unsigned) when comparing against one. (find_base_value): Likewise. (record_base_value): Cast variable `regno' to (unsigned) when comparing against one. Cast the result of REGNO() macro to (unsigned) when comparing against one. (memrefs_conflict_p): Change type of variables `r_x' and `r_y' to unsigned. (init_alias_analysis): Add unsigned variable `ui'. Use it as loop variable where an unsigned index is needed. * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code) before comparing against one. * collect2.c: Add prototypes for functions `error', `fatal' and `fatal_perror'. Make these functions take variable arguments instead of faking it with a fixed number of args. (write_c_file_stat): Cast the argument of ctype macro to (unsigned char). * combine.c (can_combine_p): Mark parameter `pred' with ATTRIBUTE_UNUSED. (find_split_point): Cast variable `src' to (unsigned HOST_WIDE_INT) when comparing against one. HOST_WIDE_INT) when comparing against one. (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_logical): Likewise. (force_to_mode): Cast result of INTVAL() macro to (unsigned HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_and_const_int): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (merge_outer_ops): Cast variable const0 to `unsigned HOST_WIDE_INT' when comparing against the result of GET_MODE_MASK() macro. (simplify_comparison): Likewise for variable `c0'. Cast variable `const_op' to `unsigned HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'. config/mips/mips.c (gen_int_relational): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (output_block_move): Cast `sizeof' expression to (int) when comparing against one. (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing against one. (save_restore_insns): Cast `base_offset' to `long' to match format specifier in fprintf. * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro to `enum machine_mode'. * flow.c (life_analysis_1): Remove unused variable `insn'. * gcc.c (translate_options): Move variables `j' and `k' into the scope in which they are used. Change their types to `size_t'. (set_spec): Cast the argument of ctype macro to `unsigned char'. (read_specs): Likewise. (process_command): Cast `sizeof' to (int) when comparing against one. (do_spec_1): Cast the argument of ctype macro to `unsigned char'. (handle_braces): Cast both sides of `==' expression to `long' to ensure sign matching. (main): Cast variable `i' to `int' when comparing against one. * gcov-io.h (__fetch_long): Change type of parameter `bytes' from int to size_t. Cast variable `i' to size_t when comparing against one. * genattrtab.c (convert_set_attr_alternative): Remove unused parameter `insn_code'. All callers changed. (convert_set_attr): Likewise. * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to size_t when comparing against one. Likewise for variable `len'. * global.c (global_alloc): Cast variable `max_regno' to size_t when comparing against one. Likewise for variable `max_allocno'. * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED. * local-alloc.c (validate_equiv_mem_from_store): Mark parameter `set' with ATTRIBUTE_UNUSED. (find_free_reg): Cast `sizeof' expression to (int) when comparing against one. * loop.c (count_loop_regs_set): Remove unused variable `dest'. (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED. (get_condition): Cast variable `const_val' to `unsigned HOST_WIDE_INT' when comparing against one. Cast unsigned expression to HOST_WIDE_INT when comparing against one. (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED. (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to `unsigned' when comparing against one. * protoize.c (is_id_char): Change type of parameter `ch' to unsigned char. (munge_compile_params): Cast argument of ctype macro to (const unsigned char). (process_aux_info_file): Cast variable `aux_info_size' to int when comparing against one. (forward_to_next_token_char): Cast argument of ctype macro to `const unsigned char'. (edit_formals_lists): Likewise. (find_rightmost_formals_list): Likewise. (add_local_decl): Likewise. (add_global_decls): Likewise. (edit_fn_definition): Likewise. (do_cleaning): Likewise. (scan_for_missed_items): Likewise. (edit_file): Cast variable `orig_size' to (int) when comparing against one. (main): Cast argument of ctype macro to `const unsigned char'. * recog.c (const_int_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED. * regclass.c (record_reg_classes): Change type of variable `c' to `unsigned char'. Cast `char' array index to `unsigned char'. * reload.c (push_secondary_reload): Cast argument to REG_CLASS_FROM_LETTER() macro to `unsigned char'. * reload1.c (calculate_needs): Cast `char' array index to `unsigned char'. (set_label_offsets): Change type of variable `i' to unsigned int. Cast result of XVECLEN() macro to unsigned when comparing against one. (mark_not_eliminable): Change type of variable `i' to unsigned. (order_regs_for_reload): Likewise. Cast `max_regno' to unsigned when comparing against one. (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when comparing against one. (choose_reload_regs): Hide unused label `fail'. (reload_cse_simplify_operands): Cast `char' array index to `unsigned char'. (reload_combine_note_store): Mark parameter `set' with ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing against one. (reload_cse_move2add): Remove unused variable `src2'. * sched.c: Include recog.h. (sched_note_set): Remove unused parameter `b'. All callers changed. (split_hard_reg_notes): Likewise for parameter `orig_insn'. (blockage_range): Cast result of UNIT_BLOCKED() macro to (int) when comparing against one. * stupid.c (stupid_find_reg): Mark parameter `changes_size' with ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when comparing against one. * unroll.c (precondition_loop_p): Remove unused parameter `loop_end'. All callers changed. From-SVN: r23079
1998-10-14 11:02:55 +02:00
size_t k;
optabs.c (init_optabs): Initialize fixtab... * optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab, and extendtab within their proper array boundaries. * emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds for the entire array. * config/arm/arm.c (arm_override_options): Use ARRAY_SIZE. * config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise. * config/avr/avr.c (order_regs_for_local_alloc): Likewise. * config/fr30/fr30.c (fr30_print_operand): Likewise. * config/i386/dgux.c (output_options): Likewise. * config/i386/dgux.h (ASM_FILE_START): Likewise. * config/m88k/m88k.c (output_options): Likewise. * config/m88k/m88k.h (ASM_FILE_START): Likewise. * config/mcore/mcore.c (mcore_output_inline_const_forced, layout_mcore_frame, handle_structs_in_regs): Likewise. * config/mips/mips.c (output_block_move): Likewise. * config/rs6000/rs6000.c (rs6000_override_options, rs6000_file_start): Likewise. * config/sparc/sparc.c (sparc_add_gc_roots): Likewise. * fixinc/fixfixes.c (FIX_TABLE_CT): Likewise. * fixinc/fixtests.c (TEST_TABLE_CT): Likewise. * builtins.c (expand_builtin_setjmp): Likewise. * expr.c (safe_from_p): Likewise. * flow.c (life_analysis): Likewise. * fold-const.c (size_int_type_wide): Likewise. * gcc.c (translate_options, init_spec, set_spec, main): Likewise. * genattrtab.c (make_length_attrs): Likewise. * genopinit.c (gen_insn): Likewise. * genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise. * global.c (global_alloc): Likewise. * local-alloc.c (find_free_reg): Likewise. * mips-tdump.c (print_symbol): Likewise. * mips-tfile.c (parse_def, parse_input): Likewise. * reload1.c (NUM_ELIMINABLE_REGS): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * stor-layout.c (set_sizetype): Likewise. * varasm.c (decode_reg_name): Likewise. * toplev.c (decode_f_option, decode_W_option, set_target_switch, print_switch_values): Likewise. (NUM_ELEM): Remove macro. (display_help, main): s/NUM_ELEM/ARRAY_SIZE/ From-SVN: r35949
2000-08-24 22:31:35 +02:00
for (k = j + 1; k < ARRAY_SIZE (option_map); k++)
if (strlen (option_map[k].name) >= arglen
&& !strncmp (argv[i], option_map[k].name, arglen))
{
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics. * c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
2001-12-02 01:04:36 +01:00
error ("ambiguous abbreviation %s", argv[i]);
break;
}
optabs.c (init_optabs): Initialize fixtab... * optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab, and extendtab within their proper array boundaries. * emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds for the entire array. * config/arm/arm.c (arm_override_options): Use ARRAY_SIZE. * config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise. * config/avr/avr.c (order_regs_for_local_alloc): Likewise. * config/fr30/fr30.c (fr30_print_operand): Likewise. * config/i386/dgux.c (output_options): Likewise. * config/i386/dgux.h (ASM_FILE_START): Likewise. * config/m88k/m88k.c (output_options): Likewise. * config/m88k/m88k.h (ASM_FILE_START): Likewise. * config/mcore/mcore.c (mcore_output_inline_const_forced, layout_mcore_frame, handle_structs_in_regs): Likewise. * config/mips/mips.c (output_block_move): Likewise. * config/rs6000/rs6000.c (rs6000_override_options, rs6000_file_start): Likewise. * config/sparc/sparc.c (sparc_add_gc_roots): Likewise. * fixinc/fixfixes.c (FIX_TABLE_CT): Likewise. * fixinc/fixtests.c (TEST_TABLE_CT): Likewise. * builtins.c (expand_builtin_setjmp): Likewise. * expr.c (safe_from_p): Likewise. * flow.c (life_analysis): Likewise. * fold-const.c (size_int_type_wide): Likewise. * gcc.c (translate_options, init_spec, set_spec, main): Likewise. * genattrtab.c (make_length_attrs): Likewise. * genopinit.c (gen_insn): Likewise. * genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise. * global.c (global_alloc): Likewise. * local-alloc.c (find_free_reg): Likewise. * mips-tdump.c (print_symbol): Likewise. * mips-tfile.c (parse_def, parse_input): Likewise. * reload1.c (NUM_ELIMINABLE_REGS): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * stor-layout.c (set_sizetype): Likewise. * varasm.c (decode_reg_name): Likewise. * toplev.c (decode_f_option, decode_W_option, set_target_switch, print_switch_values): Likewise. (NUM_ELEM): Remove macro. (display_help, main): s/NUM_ELEM/ARRAY_SIZE/ From-SVN: r35949
2000-08-24 22:31:35 +02:00
if (k != ARRAY_SIZE (option_map))
break;
}
if (arglen > optlen)
{
/* If the option has an argument, accept that. */
if (argv[i][optlen] == '=')
arg = argv[i] + optlen + 1;
/* If this mapping requires extra text at end of name,
accept that as "argument". */
else if (strchr (arginfo, '*') != 0)
arg = argv[i] + optlen;
/* Otherwise, extra text at end means mismatch.
Try other mappings. */
else
continue;
}
else if (strchr (arginfo, '*') != 0)
{
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
error ("incomplete '%s' option", option_map[j].name);
break;
}
/* Handle arguments. */
if (strchr (arginfo, 'a') != 0)
{
if (arg == 0)
{
if (i + 1 == argc)
{
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
error ("missing argument to '%s' option",
option_map[j].name);
break;
}
arg = argv[++i];
}
}
else if (strchr (arginfo, '*') != 0)
;
else if (strchr (arginfo, 'o') == 0)
{
if (arg != 0)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
error ("extraneous argument to '%s' option",
option_map[j].name);
arg = 0;
}
/* Store the translation as one argv elt or as two. */
if (arg != 0 && strchr (arginfo, 'j') != 0)
newv[newindex++] = concat (option_map[j].equivalent, arg,
NULL);
else if (arg != 0)
{
newv[newindex++] = option_map[j].equivalent;
newv[newindex++] = arg;
}
else
newv[newindex++] = option_map[j].equivalent;
break;
}
}
i++;
}
/* Handle old-fashioned options--just copy them through,
with their arguments. */
else if (argv[i][0] == '-')
{
const char *p = argv[i] + 1;
int c = *p;
int nskip = 1;
if (SWITCH_TAKES_ARG (c) > (p[1] != 0))
nskip += SWITCH_TAKES_ARG (c) - (p[1] != 0);
else if (WORD_SWITCH_TAKES_ARG (p))
nskip += WORD_SWITCH_TAKES_ARG (p);
else if ((c == 'B' || c == 'b' || c == 'x')
&& p[1] == 0)
nskip += 1;
else if (! strcmp (p, "Xlinker"))
nskip += 1;
else if (! strcmp (p, "Xpreprocessor"))
nskip += 1;
else if (! strcmp (p, "Xassembler"))
nskip += 1;
/* Watch out for an option at the end of the command line that
is missing arguments, and avoid skipping past the end of the
command line. */
if (nskip + i > argc)
nskip = argc - i;
while (nskip > 0)
{
newv[newindex++] = argv[i++];
nskip--;
}
}
else
/* Ordinary operands, or +e options. */
newv[newindex++] = argv[i++];
}
newv[newindex] = 0;
*argvp = newv;
*argcp = newindex;
}
1992-02-01 06:15:32 +01:00
static char *
skip_whitespace (char *p)
1992-02-01 06:15:32 +01:00
{
while (1)
{
/* A fully-blank line is a delimiter in the SPEC file and shouldn't
be considered whitespace. */
if (p[0] == '\n' && p[1] == '\n' && p[2] == '\n')
return p + 1;
else if (*p == '\n' || *p == ' ' || *p == '\t')
p++;
else if (*p == '#')
{
while (*p != '\n')
p++;
1992-02-01 06:15:32 +01:00
p++;
}
else
break;
}
return p;
}
/* Structures to keep track of prefixes to try when looking for files. */
struct prefix_list
{
const char *prefix; /* String to prepend to the path. */
struct prefix_list *next; /* Next in linked list. */
int require_machine_suffix; /* Don't use without machine_suffix. */
/* 2 means try both machine_suffix and just_machine_suffix. */
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
int priority; /* Sort key - priority within list. */
int os_multilib; /* 1 if OS multilib scheme should be used,
0 for GCC multilib scheme. */
};
struct path_prefix
{
struct prefix_list *plist; /* List of prefixes to try */
int max_len; /* Max length of a prefix in PLIST */
const char *name; /* Name of this list (used in config stuff) */
};
/* List of prefixes to try when looking for executables. */
static struct path_prefix exec_prefixes = { 0, 0, "exec" };
/* List of prefixes to try when looking for startup (crt0) files. */
static struct path_prefix startfile_prefixes = { 0, 0, "startfile" };
/* List of prefixes to try when looking for include files. */
static struct path_prefix include_prefixes = { 0, 0, "include" };
/* Suffix to attach to directories searched for commands.
This looks like `MACHINE/VERSION/'. */
static const char *machine_suffix = 0;
/* Suffix to attach to directories searched for commands.
This is just `MACHINE/'. */
static const char *just_machine_suffix = 0;
/* Adjusted value of GCC_EXEC_PREFIX envvar. */
static const char *gcc_exec_prefix;
/* Adjusted value of standard_libexec_prefix. */
static const char *gcc_libexec_prefix;
/* Default prefixes to attach to command names. */
#ifndef STANDARD_STARTFILE_PREFIX_1
#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
#endif
#ifndef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif
#ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
#undef MD_STARTFILE_PREFIX_1
#endif
/* If no prefixes defined, use the null string, which will disable them. */
#ifndef MD_EXEC_PREFIX
#define MD_EXEC_PREFIX ""
#endif
#ifndef MD_STARTFILE_PREFIX
#define MD_STARTFILE_PREFIX ""
#endif
#ifndef MD_STARTFILE_PREFIX_1
#define MD_STARTFILE_PREFIX_1 ""
#endif
/* These directories are locations set at configure-time based on the
--prefix option provided to configure. Their initializers are
defined in Makefile.in. These paths are not *directly* used when
gcc_exec_prefix is set because, in that case, we know where the
compiler has been installed, and use paths relative to that
location instead. */
c-common.c (c_tree_code_name): Const-ification. * c-common.c (c_tree_code_name): Const-ification. * c-decl.c (c_decode_option): Likewise. * c-typeck.c (warn_for_assignment): Likewise. * collect2.c (libexts, is_ctor_dtor, main, ignore_library): Likewise. * cppinit.c (output_deps): Likewise. * dependence.c (dependence_string, direction_string): Likewise. * dwarf2out.c (output_ranges): Likewise. * fixinc/fixfixes.c (emit_gnu_type): Likewise. * fixinc/gnu-regex.c (re_error_msgid): Likewise. * gcc.c (standard_exec_prefix, standard_exec_prefix_1, standard_startfile_prefix, standard_startfile_prefix_1, standard_startfile_prefix_2, tooldir_base_prefix, standard_bindir_prefix, find_a_file): Likewise. * genattrtab.c (make_length_attrs): Likewise. * gencheck.c (tree_codes): Likewise. * genemit.c (gen_split): Likewise. * genrecog.c (special_mode_pred_table): Likewise. * graph.c (graph_ext): Likewise. * protoize (default_include): Likewise. * reload.c (reload_when_needed_name): Likewise. * sched-vis.c (visualize_stall_cycles): Likewise. * tlink.c (recompile_files): Likewise. * toplev.c (decode_g_option): Likewise. * tradcpp.c (output_deps): Likewise. * varasm.c (decode_reg_name): Likewise. * arm.c (arm_condition_codes, strings_fpa, thumb_condition_code): Const-ification. * arm.md: Likewise. * avr.c (avr_regnames, encode_section_info): Likewise. * c4x.c (float_reg_names): Likewise. * darwin.h (ASM_GLOBALIZE_LABEL): Likewise. * elfos.h (const_section): Likewise. * i386.c (ix86_comp_type_attributes): Likewise. * i386/win32.h (STRIP_NAME_ENCODING): Likewise. * ia64/aix.h (UNIQUE_SECTION): Likewise. * ia64.c (type_names): Likewise. * m68hc11.c (reg_class_names): Likewise. * m88k.c (m_options): Likewise. * mips.c (mips_output_conditional_branch, mips_unique_section): Likewise. * rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Likewise. * sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue, ultra_code_names): Likewise. * sparc.h (OVERRIDE_OPTIONS): Likewise. From-SVN: r45567
2001-09-12 19:18:03 +02:00
static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
/* For native compilers, these are well-known paths containing
components that may be provided by the system. For cross
compilers, these paths are not used. */
static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
static const char *md_exec_prefix = MD_EXEC_PREFIX;
static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
static const char *const standard_startfile_prefix_1
= STANDARD_STARTFILE_PREFIX_1;
static const char *const standard_startfile_prefix_2
= STANDARD_STARTFILE_PREFIX_2;
/* A relative path to be used in finding the location of tools
relative to the driver. */
c-common.c (c_tree_code_name): Const-ification. * c-common.c (c_tree_code_name): Const-ification. * c-decl.c (c_decode_option): Likewise. * c-typeck.c (warn_for_assignment): Likewise. * collect2.c (libexts, is_ctor_dtor, main, ignore_library): Likewise. * cppinit.c (output_deps): Likewise. * dependence.c (dependence_string, direction_string): Likewise. * dwarf2out.c (output_ranges): Likewise. * fixinc/fixfixes.c (emit_gnu_type): Likewise. * fixinc/gnu-regex.c (re_error_msgid): Likewise. * gcc.c (standard_exec_prefix, standard_exec_prefix_1, standard_startfile_prefix, standard_startfile_prefix_1, standard_startfile_prefix_2, tooldir_base_prefix, standard_bindir_prefix, find_a_file): Likewise. * genattrtab.c (make_length_attrs): Likewise. * gencheck.c (tree_codes): Likewise. * genemit.c (gen_split): Likewise. * genrecog.c (special_mode_pred_table): Likewise. * graph.c (graph_ext): Likewise. * protoize (default_include): Likewise. * reload.c (reload_when_needed_name): Likewise. * sched-vis.c (visualize_stall_cycles): Likewise. * tlink.c (recompile_files): Likewise. * toplev.c (decode_g_option): Likewise. * tradcpp.c (output_deps): Likewise. * varasm.c (decode_reg_name): Likewise. * arm.c (arm_condition_codes, strings_fpa, thumb_condition_code): Const-ification. * arm.md: Likewise. * avr.c (avr_regnames, encode_section_info): Likewise. * c4x.c (float_reg_names): Likewise. * darwin.h (ASM_GLOBALIZE_LABEL): Likewise. * elfos.h (const_section): Likewise. * i386.c (ix86_comp_type_attributes): Likewise. * i386/win32.h (STRIP_NAME_ENCODING): Likewise. * ia64/aix.h (UNIQUE_SECTION): Likewise. * ia64.c (type_names): Likewise. * m68hc11.c (reg_class_names): Likewise. * m88k.c (m_options): Likewise. * mips.c (mips_output_conditional_branch, mips_unique_section): Likewise. * rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Likewise. * sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue, ultra_code_names): Likewise. * sparc.h (OVERRIDE_OPTIONS): Likewise. From-SVN: r45567
2001-09-12 19:18:03 +02:00
static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
/* Subdirectory to use for locating libraries. Set by
set_multilib_dir based on the compilation options. */
static const char *multilib_dir;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
/* Subdirectory to use for locating libraries in OS conventions. Set by
set_multilib_dir based on the compilation options. */
static const char *multilib_os_dir;
1992-02-01 06:15:32 +01:00
1996-07-04 00:07:53 +02:00
/* Structure to keep track of the specs that have been defined so far.
These are accessed using %(specname) or %[specname] in a compiler
or link spec. */
1992-02-01 06:15:32 +01:00
struct spec_list
{
1997-01-16 23:15:53 +01:00
/* The following 2 fields must be first */
/* to allow EXTRA_SPECS to be initialized */
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *name; /* name of the spec. */
const char *ptr; /* available ptr if no static pointer */
1997-01-16 23:15:53 +01:00
/* The following fields are not initialized */
/* by EXTRA_SPECS */
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char **ptr_spec; /* pointer to the spec itself. */
1997-01-16 23:15:53 +01:00
struct spec_list *next; /* Next spec in linked list. */
int name_len; /* length of the name */
int alloc_p; /* whether string was allocated */
1992-02-01 06:15:32 +01:00
};
1997-01-16 23:15:53 +01:00
#define INIT_STATIC_SPEC(NAME,PTR) \
{ NAME, NULL, PTR, (struct spec_list *) 0, sizeof (NAME) - 1, 0 }
1997-01-16 23:15:53 +01:00
/* List of statically defined specs. */
static struct spec_list static_specs[] =
{
1997-01-16 23:15:53 +01:00
INIT_STATIC_SPEC ("asm", &asm_spec),
INIT_STATIC_SPEC ("asm_debug", &asm_debug),
1997-01-16 23:15:53 +01:00
INIT_STATIC_SPEC ("asm_final", &asm_final_spec),
INIT_STATIC_SPEC ("asm_options", &asm_options),
INIT_STATIC_SPEC ("invoke_as", &invoke_as),
1997-01-16 23:15:53 +01:00
INIT_STATIC_SPEC ("cpp", &cpp_spec),
INIT_STATIC_SPEC ("cpp_options", &cpp_options),
INIT_STATIC_SPEC ("cpp_debug_options", &cpp_debug_options),
INIT_STATIC_SPEC ("cpp_unique_options", &cpp_unique_options),
INIT_STATIC_SPEC ("trad_capable_cpp", &trad_capable_cpp),
1997-01-16 23:15:53 +01:00
INIT_STATIC_SPEC ("cc1", &cc1_spec),
INIT_STATIC_SPEC ("cc1_options", &cc1_options),
1997-01-16 23:15:53 +01:00
INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec),
INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec),
2005-07-02 10:52:21 +02:00
INIT_STATIC_SPEC ("link_ssp", &link_ssp_spec),
1997-01-16 23:15:53 +01:00
INIT_STATIC_SPEC ("endfile", &endfile_spec),
INIT_STATIC_SPEC ("link", &link_spec),
INIT_STATIC_SPEC ("lib", &lib_spec),
INIT_STATIC_SPEC ("mfwrap", &mfwrap_spec),
INIT_STATIC_SPEC ("mflib", &mflib_spec),
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec),
1997-01-16 23:15:53 +01:00
INIT_STATIC_SPEC ("libgcc", &libgcc_spec),
INIT_STATIC_SPEC ("startfile", &startfile_spec),
INIT_STATIC_SPEC ("switches_need_spaces", &switches_need_spaces),
INIT_STATIC_SPEC ("cross_compile", &cross_compile),
INIT_STATIC_SPEC ("version", &compiler_version),
INIT_STATIC_SPEC ("multilib", &multilib_select),
INIT_STATIC_SPEC ("multilib_defaults", &multilib_defaults),
INIT_STATIC_SPEC ("multilib_extra", &multilib_extra),
INIT_STATIC_SPEC ("multilib_matches", &multilib_matches),
INIT_STATIC_SPEC ("multilib_exclusions", &multilib_exclusions),
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
INIT_STATIC_SPEC ("multilib_options", &multilib_options),
INIT_STATIC_SPEC ("linker", &linker_name_spec),
INIT_STATIC_SPEC ("link_libgcc", &link_libgcc_spec),
INIT_STATIC_SPEC ("md_exec_prefix", &md_exec_prefix),
INIT_STATIC_SPEC ("md_startfile_prefix", &md_startfile_prefix),
INIT_STATIC_SPEC ("md_startfile_prefix_1", &md_startfile_prefix_1),
INIT_STATIC_SPEC ("startfile_prefix_spec", &startfile_prefix_spec),
INIT_STATIC_SPEC ("sysroot_spec", &sysroot_spec),
INIT_STATIC_SPEC ("sysroot_suffix_spec", &sysroot_suffix_spec),
INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec", &sysroot_hdrs_suffix_spec),
1997-01-16 23:15:53 +01:00
};
#ifdef EXTRA_SPECS /* additional specs needed */
/* Structure to keep track of just the first two args of a spec_list.
That is all that the EXTRA_SPECS macro gives us. */
struct spec_list_1
{
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
const char *const name;
const char *const ptr;
};
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
static const struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS };
static struct spec_list *extra_specs = (struct spec_list *) 0;
1997-01-16 23:15:53 +01:00
#endif
/* List of dynamically allocates specs that have been defined so far. */
static struct spec_list *specs = (struct spec_list *) 0;
1997-01-16 23:15:53 +01:00
/* List of static spec functions. */
static const struct spec_function static_spec_functions[] =
{
{ "getenv", getenv_spec_function },
{ "if-exists", if_exists_spec_function },
{ "if-exists-else", if_exists_else_spec_function },
re PR libobjc/11572 (GNU libobjc no longer compiled on Darwin) 2004-09-15 Andrew Pinski <pinskia@physics.uc.edu> PR target/11572 * c-incpath.h (target_c_incpath_s): Add extra_pre_includes. Add two parameters to extra_includes. (C_INCPATH_INIT): Remove. * c-incpath.c (register_include_chains): Call extra_pre_includes before adding the standard include directory. Update call to extra_includes. (!defined TARGET_EXTRA_INCLUDES): Update hook_void_charptr_charptr_int and add !define TARGET_EXTRA_PRE_INCLUDES. (!define TARGET_EXTRA_INCLUDES): Define as hook_void_charptr_charptr_int. (!define TARGET_EXTRA_PRE_INCLUDES): Likewise. (target_c_incpath): Always declare. * fixinclude.c (defined TARGET_EXTRA_INCLUDES): Declare a empty function. (define TARGET_EXTRA_PRE_INCLUDES): Likewise. * config/darwin.h: (darwin_register_frameworks): Update for the two new parameters. (darwin_register_objc_includes): Add prototype. (TARGET_EXTRA_PRE_INCLUDES): Define. * config/darwin-c.c (darwin_register_objc_includes): New function. (darwin_register_frameworks): Update for the two new parameters. (target_c_incpath): Remove. * config/t-darwin (darwin-c.o): Add $(PREPROCESSOR_DEFINES) to the compile line. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Document the two new parameters. (TARGET_EXTRA_PRE_INCLUDES): Document. * gcc.c (spec_function): Add replace-outfile. (replace_outfile_spec_function): New function. * config/darwin.h (LINK_SPEC): Add replace -lobjc with -lobjc-gnu if -fgnu-runtime is supplied. * invoke.texi (replace-outfile): Document. From-SVN: r87588
2004-09-16 08:49:59 +02:00
{ "replace-outfile", replace_outfile_spec_function },
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
{ "version-compare", version_compare_spec_function },
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
{ "include", include_spec_function },
{ "print-asm-header", print_asm_header_spec_function },
#ifdef EXTRA_SPEC_FUNCTIONS
EXTRA_SPEC_FUNCTIONS
#endif
{ 0, 0 }
};
static int processing_spec_function;
/* Add appropriate libgcc specs to OBSTACK, taking into account
various permutations of -shared-libgcc, -shared, and such. */
#if defined(ENABLE_SHARED_LIBGCC) && !defined(REAL_LIBGCC_SPEC)
#ifndef USE_LD_AS_NEEDED
#define USE_LD_AS_NEEDED 0
#endif
static void
init_gcc_specs (struct obstack *obstack, const char *shared_name,
const char *static_name, const char *eh_name)
{
char *buf;
buf = concat ("%{static|static-libgcc:", static_name, " ", eh_name, "}"
"%{!static:%{!static-libgcc:"
#if USE_LD_AS_NEEDED
"%{!shared-libgcc:",
static_name, " --as-needed ", shared_name, " --no-as-needed"
"}"
"%{shared-libgcc:",
shared_name, "%{!shared: ", static_name, "}"
"}"
#else
"%{!shared:"
"%{!shared-libgcc:", static_name, " ", eh_name, "}"
"%{shared-libgcc:", shared_name, " ", static_name, "}"
"}"
configure.in: Check for ld. * configure.in: Check for ld. (HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option. * configure, config.in: Rebuilt. * config.gcc: Add crtbeginT.o to extra_parts where needed. * config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc frame unwinding on Linux. * config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde frame unwinding. * config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static. * config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define. * config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't iterate further if pc falls into current library, but fde was not found. * config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static if using glibc. (LINK_EH_SPEC): Define. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o. * Makefile.in (crtbeginT.o): Add rule. * gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh. If neither -static-libgcc nor -shared-libgcc is passed and -shared, use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not. If none of the above switches are passed, use -lgcc -lgcc_eh. (init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec. * mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if creating libgcc_s.so, put them into separate libgcc_eh.a instead. * unwind-dw2-fde.c: Don't include any headers if this file is included from other .c file. * unwind-dw2-fde-glibc.c: New file. * crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define. Use it instead of EH_FRAME_SECTION_NAME where appropriate. From-SVN: r48039
2001-12-15 12:49:18 +01:00
#ifdef LINK_EH_SPEC
"%{shared:"
"%{shared-libgcc:", shared_name, "}"
"%{!shared-libgcc:", static_name, "}"
"}"
configure.in: Check for ld. * configure.in: Check for ld. (HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option. * configure, config.in: Rebuilt. * config.gcc: Add crtbeginT.o to extra_parts where needed. * config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc frame unwinding on Linux. * config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde frame unwinding. * config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static. * config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define. * config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't iterate further if pc falls into current library, but fde was not found. * config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static if using glibc. (LINK_EH_SPEC): Define. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o. * Makefile.in (crtbeginT.o): Add rule. * gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh. If neither -static-libgcc nor -shared-libgcc is passed and -shared, use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not. If none of the above switches are passed, use -lgcc -lgcc_eh. (init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec. * mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if creating libgcc_s.so, put them into separate libgcc_eh.a instead. * unwind-dw2-fde.c: Don't include any headers if this file is included from other .c file. * unwind-dw2-fde-glibc.c: New file. * crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define. Use it instead of EH_FRAME_SECTION_NAME where appropriate. From-SVN: r48039
2001-12-15 12:49:18 +01:00
#else
"%{shared:", shared_name, "}"
#endif
configure.in: Check for ld. * configure.in: Check for ld. (HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option. * configure, config.in: Rebuilt. * config.gcc: Add crtbeginT.o to extra_parts where needed. * config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc frame unwinding on Linux. * config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde frame unwinding. * config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static. * config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define. * config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't iterate further if pc falls into current library, but fde was not found. * config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static if using glibc. (LINK_EH_SPEC): Define. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o. * Makefile.in (crtbeginT.o): Add rule. * gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh. If neither -static-libgcc nor -shared-libgcc is passed and -shared, use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not. If none of the above switches are passed, use -lgcc -lgcc_eh. (init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec. * mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if creating libgcc_s.so, put them into separate libgcc_eh.a instead. * unwind-dw2-fde.c: Don't include any headers if this file is included from other .c file. * unwind-dw2-fde-glibc.c: New file. * crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define. Use it instead of EH_FRAME_SECTION_NAME where appropriate. From-SVN: r48039
2001-12-15 12:49:18 +01:00
#endif
"}}", NULL);
obstack_grow (obstack, buf, strlen (buf));
free (buf);
}
#endif /* ENABLE_SHARED_LIBGCC */
1997-01-16 23:15:53 +01:00
/* Initialize the specs lookup routines. */
static void
init_spec (void)
1997-01-16 23:15:53 +01:00
{
struct spec_list *next = (struct spec_list *) 0;
struct spec_list *sl = (struct spec_list *) 0;
1997-01-16 23:15:53 +01:00
int i;
if (specs)
return; /* Already initialized. */
1997-01-16 23:15:53 +01:00
if (verbose_flag)
notice ("Using built-in specs.\n");
1997-01-16 23:15:53 +01:00
#ifdef EXTRA_SPECS
extra_specs = xcalloc (sizeof (struct spec_list),
ARRAY_SIZE (extra_specs_1));
optabs.c (init_optabs): Initialize fixtab... * optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab, and extendtab within their proper array boundaries. * emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds for the entire array. * config/arm/arm.c (arm_override_options): Use ARRAY_SIZE. * config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise. * config/avr/avr.c (order_regs_for_local_alloc): Likewise. * config/fr30/fr30.c (fr30_print_operand): Likewise. * config/i386/dgux.c (output_options): Likewise. * config/i386/dgux.h (ASM_FILE_START): Likewise. * config/m88k/m88k.c (output_options): Likewise. * config/m88k/m88k.h (ASM_FILE_START): Likewise. * config/mcore/mcore.c (mcore_output_inline_const_forced, layout_mcore_frame, handle_structs_in_regs): Likewise. * config/mips/mips.c (output_block_move): Likewise. * config/rs6000/rs6000.c (rs6000_override_options, rs6000_file_start): Likewise. * config/sparc/sparc.c (sparc_add_gc_roots): Likewise. * fixinc/fixfixes.c (FIX_TABLE_CT): Likewise. * fixinc/fixtests.c (TEST_TABLE_CT): Likewise. * builtins.c (expand_builtin_setjmp): Likewise. * expr.c (safe_from_p): Likewise. * flow.c (life_analysis): Likewise. * fold-const.c (size_int_type_wide): Likewise. * gcc.c (translate_options, init_spec, set_spec, main): Likewise. * genattrtab.c (make_length_attrs): Likewise. * genopinit.c (gen_insn): Likewise. * genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise. * global.c (global_alloc): Likewise. * local-alloc.c (find_free_reg): Likewise. * mips-tdump.c (print_symbol): Likewise. * mips-tfile.c (parse_def, parse_input): Likewise. * reload1.c (NUM_ELIMINABLE_REGS): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * stor-layout.c (set_sizetype): Likewise. * varasm.c (decode_reg_name): Likewise. * toplev.c (decode_f_option, decode_W_option, set_target_switch, print_switch_values): Likewise. (NUM_ELEM): Remove macro. (display_help, main): s/NUM_ELEM/ARRAY_SIZE/ From-SVN: r35949
2000-08-24 22:31:35 +02:00
for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--)
{
sl = &extra_specs[i];
sl->name = extra_specs_1[i].name;
sl->ptr = extra_specs_1[i].ptr;
sl->next = next;
sl->name_len = strlen (sl->name);
sl->ptr_spec = &sl->ptr;
next = sl;
}
1997-01-16 23:15:53 +01:00
#endif
/* Initialize here, not in definition. The IRIX 6 O32 cc sometimes chokes
on ?: in file-scope variable initializations. */
asm_debug = ASM_DEBUG_SPEC;
optabs.c (init_optabs): Initialize fixtab... * optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab, and extendtab within their proper array boundaries. * emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds for the entire array. * config/arm/arm.c (arm_override_options): Use ARRAY_SIZE. * config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise. * config/avr/avr.c (order_regs_for_local_alloc): Likewise. * config/fr30/fr30.c (fr30_print_operand): Likewise. * config/i386/dgux.c (output_options): Likewise. * config/i386/dgux.h (ASM_FILE_START): Likewise. * config/m88k/m88k.c (output_options): Likewise. * config/m88k/m88k.h (ASM_FILE_START): Likewise. * config/mcore/mcore.c (mcore_output_inline_const_forced, layout_mcore_frame, handle_structs_in_regs): Likewise. * config/mips/mips.c (output_block_move): Likewise. * config/rs6000/rs6000.c (rs6000_override_options, rs6000_file_start): Likewise. * config/sparc/sparc.c (sparc_add_gc_roots): Likewise. * fixinc/fixfixes.c (FIX_TABLE_CT): Likewise. * fixinc/fixtests.c (TEST_TABLE_CT): Likewise. * builtins.c (expand_builtin_setjmp): Likewise. * expr.c (safe_from_p): Likewise. * flow.c (life_analysis): Likewise. * fold-const.c (size_int_type_wide): Likewise. * gcc.c (translate_options, init_spec, set_spec, main): Likewise. * genattrtab.c (make_length_attrs): Likewise. * genopinit.c (gen_insn): Likewise. * genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise. * global.c (global_alloc): Likewise. * local-alloc.c (find_free_reg): Likewise. * mips-tdump.c (print_symbol): Likewise. * mips-tfile.c (parse_def, parse_input): Likewise. * reload1.c (NUM_ELIMINABLE_REGS): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * stor-layout.c (set_sizetype): Likewise. * varasm.c (decode_reg_name): Likewise. * toplev.c (decode_f_option, decode_W_option, set_target_switch, print_switch_values): Likewise. (NUM_ELEM): Remove macro. (display_help, main): s/NUM_ELEM/ARRAY_SIZE/ From-SVN: r35949
2000-08-24 22:31:35 +02:00
for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--)
1997-01-16 23:15:53 +01:00
{
sl = &static_specs[i];
sl->next = next;
next = sl;
}
#if defined(ENABLE_SHARED_LIBGCC) && !defined(REAL_LIBGCC_SPEC)
/* ??? If neither -shared-libgcc nor --static-libgcc was
seen, then we should be making an educated guess. Some proposed
heuristics for ELF include:
(1) If "-Wl,--export-dynamic", then it's a fair bet that the
program will be doing dynamic loading, which will likely
need the shared libgcc.
(2) If "-ldl", then it's also a fair bet that we're doing
dynamic loading.
(3) For each ET_DYN we're linking against (either through -lfoo
or /some/path/foo.so), check to see whether it or one of
its dependencies depends on a shared libgcc.
(4) If "-shared"
If the runtime is fixed to look for program headers instead
of calling __register_frame_info at all, for each object,
use the shared libgcc if any EH symbol referenced.
If crtstuff is fixed to not invoke __register_frame_info
automatically, for each object, use the shared libgcc if
any non-empty unwind section found.
Doing any of this probably requires invoking an external program to
do the actual object file scanning. */
{
const char *p = libgcc_spec;
int in_sep = 1;
/* Transform the extant libgcc_spec into one that uses the shared libgcc
when given the proper command line arguments. */
while (*p)
{
if (in_sep && *p == '-' && strncmp (p, "-lgcc", 5) == 0)
{
init_gcc_specs (&obstack,
"-lgcc_s"
re PR target/14925 (libunwind enabled gcc generates incompatible libgcc_s.so.1) 2004-09-03 H.J. Lu <hongjiu.lu@intel.com> PR target/14925: Makefile.in (LIB2ADDEHSTATIC): New. (LIB2ADDEHSHARED): New. (LIBUNWIND): New. (LIBUNWINDDEP): New. (SHLIBUNWIND_LINK): New. (SHLIBUNWIND_INSTALL): New. (libgcc.mk): Pass LIB2ADDEHSTATIC, LIB2ADDEHSHARED, LIBUNWIND, LIBUNWINDDEP, SHLIBUNWIND_LINK and SHLIBUNWIND_INSTALL. (clean): Remove libunwind* (stage1-start): Remove and copy stage1/libunwind*. (stage2-start): Remove and copy stage2/libunwind*. (stage3-start): Remove and copy stage3/libunwind*. (stage4-start): Remove and copy stage4/libunwind*. (stageprofile-start): Remove and copy stageprofile/libunwind*. (stagefeedback-start): Remove and copy stagefeedback/libunwind*. * config.gcc (ia64*-*-linux*): Always add t-libunwind to tmake_file. Add t-libunwind-elf and ia64/t-glibc-libunwind to tmake_file if --with-system-libunwind isn't used. * config/ia64/t-glibc-libunwind: New file. * config/t-libunwind-elf: Likewise. * unwind-compat.c: Likewise. * unwind-compat.h: Likewise. * unwind-dw2-fde-compat.c: Likewise. * config/ia64/t-glibc (LIB2ADDEH): Updated. * config/ia64/t-hpux (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. * config/ia64/unwind-ia64.c: Include "unwind-compat.h". Define aliases if needed. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * config/t-libunwind (LIB2ADDEH): Updated. (LIB2ADDEHSTATIC): New. (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. (TARGET_LIBGCC2_CFLAGS): Set to -DUSE_GAS_SYMVER. * configure.ac: Change --enable-libunwind-exceptions to --with-system-libunwind. Don't define USE_LIBUNWIND_EXCEPTIONS. * configure: Regenerated. * config.in: Updated. * doc/install.texi (ia64-*-linux): Require libunwind 0.98 or above and mention --with-system-libunwind. (ia64-*-hpux*): Mention --enable-libunwind-exceptions is removed in gcc 3.4.3 and later. * gcc.c (init_spec): Add -lunwind to -lgcc_s if USE_LIBUNWIND_EXCEPTIONS is defined. * mklibgcc.in: Support libunwind. From-SVN: r87066
2004-09-04 02:15:42 +02:00
#ifdef USE_LIBUNWIND_EXCEPTIONS
" -lunwind"
#endif
,
"-lgcc",
"-lgcc_eh"
#ifdef USE_LIBUNWIND_EXCEPTIONS
# ifdef HAVE_LD_STATIC_DYNAMIC
" %{!static:-Bstatic} -lunwind %{!static:-Bdynamic}"
# else
" -lunwind"
# endif
#endif
);
p += 5;
in_sep = 0;
}
else if (in_sep && *p == 'l' && strncmp (p, "libgcc.a%s", 10) == 0)
{
/* Ug. We don't know shared library extensions. Hope that
systems that use this form don't do shared libraries. */
init_gcc_specs (&obstack,
re PR other/19525 (In-build-directory multilib testing broken) PR other/19525 * doc/invoke.texi: Remove documentation of %M spec. * gcc.c: Likewise. (init_spec): Remove %M suffix from -lgcc_s. (do_spec_1): Remove 'M' case. * mklibgcc.in: Remove SHLIB_MULTILIB handling. Expect SHLIB_LINK to put shared libraries in the multilib directory. Remove the shlib_so_soname substitution variable. Don't add a multilib encoding to shlib_base_name. Set shlib_slibdir_qual to the full pathname reported by -print-multi-os-directory. Pass @multilib_dir@ to SHLIB_INSTALL as well as SHLIB_LINK. * config/t-slibgcc-elf-ver (SHLIB_SONAME): Use @shlib_base_name@. (SHLIB_NAME): Delete. (SHLIB_DIR): New macro. (SHLIB_LINK): Put $(SHLIB_SONAME) and $(SHLIB_SOLINK) in $(SHLIB_DIR). (SHLIB_INSTALL): Adjust accordingly. * config/t-slibgcc-darwin: As for t-slibgcc-elf-ver. * config/t-slibgcc-sld: Likewise. * config/t-libunwind-elf (SHLIBUNWIND_NAME): Delete. (SHLIBUNWIND_SONAME): Use @shlib_base_name@. (SHLIBUNWIND_LINK): Put $(SHLIBUNWIND_SONAME) and $(SHLIB_SOLINK) in $(SHLIB_DIR). (SHLIBUNWIND_INSTALL): Adjust accordingly. * config/i386/t-nwld (SHLIB_SONAME): Delete. (SHLIB_LINK, SHLIB_INSTALL): Use SHLIB_NAME instead of SHLIB_SONAME. Use @shlib_base_name@ instead of @shlib_so_name@. * config/ia64/t-hpux (SHLIB_LINK): Put @shlib_base_name@.so.0 and @shlib_base_name@.so in @multilib_dir@. (SHLIB_INSTALL): Adjust accordingly. Add @shlib_slibdir_qual@ to the install path. * config/mips/t-slibgcc-irix: As for t-slibgcc-elf-ver. (SHLIB_LINK): Remove previous workaround. * config/pa/t-hpux-shlib (SHLIB_DIR, SHLIB_SLIBDIR_QUAL): New macros. (SHLIB_LINK): Put $(SHLIB_SONAME) and $(SHLIB_NAME) in $(SHLIB_DIR). (SHLIB_INSTALL): Adjust accordingly. Add $(SHLIB_SLIBDIR_QUAL) to the install path. * config/rs6000/t-aix43 (SHLIB_LINK): Put @shlib_base_name@.a in @multilib_dir@. Use @multilib_dir@ to check for threading libraries. (SHLIB_INSTALL): Adjust accordingly. (SHLIB_LIBS): Use @multilib_dir@ to check for threading libraries. * config/rs6000/t-aix52: As for config/rs6000/t-aix43. * config/sh/t-linux (SHLIB_LINK, SHLIB_INSTALL): As for config/t-slibgcc-elf-ver. From-SVN: r95277
2005-02-19 12:44:10 +01:00
"-lgcc_s",
configure.in: Check for ld. * configure.in: Check for ld. (HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option. * configure, config.in: Rebuilt. * config.gcc: Add crtbeginT.o to extra_parts where needed. * config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc frame unwinding on Linux. * config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde frame unwinding. * config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static. * config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define. * config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't iterate further if pc falls into current library, but fde was not found. * config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static if using glibc. (LINK_EH_SPEC): Define. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o. * Makefile.in (crtbeginT.o): Add rule. * gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh. If neither -static-libgcc nor -shared-libgcc is passed and -shared, use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not. If none of the above switches are passed, use -lgcc -lgcc_eh. (init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec. * mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if creating libgcc_s.so, put them into separate libgcc_eh.a instead. * unwind-dw2-fde.c: Don't include any headers if this file is included from other .c file. * unwind-dw2-fde-glibc.c: New file. * crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define. Use it instead of EH_FRAME_SECTION_NAME where appropriate. From-SVN: r48039
2001-12-15 12:49:18 +01:00
"libgcc.a%s",
"libgcc_eh.a%s"
#ifdef USE_LIBUNWIND_EXCEPTIONS
" -lunwind"
#endif
);
p += 10;
in_sep = 0;
}
else
{
obstack_1grow (&obstack, *p);
in_sep = (*p == ' ');
p += 1;
}
}
obstack_1grow (&obstack, '\0');
libgcc_spec = XOBFINISH (&obstack, const char *);
}
#endif
#ifdef USE_AS_TRADITIONAL_FORMAT
/* Prepend "--traditional-format" to whatever asm_spec we had before. */
{
builtins.c (expand_builtin_setjmp_receiver): Const-ify. * builtins.c (expand_builtin_setjmp_receiver): Const-ify. * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): Likewise. * c-dump.c (dump_option_value_info): Likewise. * c-format.c (format_length_info, format_char_info, format_flag_spec, format_flag_pair, format_kind_info): Likewise. * collect2.c (names): Likewise. * cppdefault.h (default_include): Likewise. * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. * flow.c (life_analysis): Likewise. * gcc.c (dir_separator_str, modify_target, option_map, target_option_translations, spec_list_1, extra_specs_1, init_spec): Likewise. * gcov.c (gcov_version_string): Likewise. * genattr.c (write_units): Likewise. * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. * gengenrtl.c (rtx_definition, defs): Likewise. * genrecog.c (pred_table): Likewise. * global.c (global_alloc): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (find_free_reg): Likewise. * params.h (param_info): Likewise. * predict.c (predictor_info): Likewise. * protoize.c (unexpansion_struct): Likewise. * real.c (bmask): Likewise. * recog.h (insn_operand_data, insn_data): Likewise. * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * toplev.c (da, debug_args, lang_opt, documented_lang_options, target_switches, target_options): Likewise. * tradcif.y (token, tokentab2, yylex): Likewise. * tree.h (attribute_spec): Likewise. * alpha.c (override_options, alpha_lookup_xfloating_lib_func): Likewise. * arc.c (arc_output_function_epilogue): Likewise. * arm.c (processors, all_cores, all_architectures, arm_override_options, isr_attribute_arg, isr_attribute_args, arm_isr_value): Likewise. * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): Likewise. * c4x.c (c4x_int_reglist): Likewise. * d30v.c (override_options): Likewise. * h8300.c (shift_insn): Likewise. * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. * i386.h (processor_costs, ix86_cost): Likewise. * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. * m68hc11.h (processor_costs, m68hc11_cost): Likewise. * m68k.c (codes_68881, codes_FPA): Likewise. * m88k.c (mode_from_align, max_from_align, all_from_align, best_from_align, m_options): Likewise. * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. * mcore.c (mode_from_align): Likewise. * mips/elf64.h (UNIQUE_SECTION): Likewise. * mips/iris6gld.h (UNIQUE_SECTION): Likewise. * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. * mips.h (mips_regno_to_class): Likewise. * ns32k.c (scales): Likewise. * pa.c (import_string, magic_milli): Likewise. * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. * sparc.c (leaf_reg_remap, sparc_override_options, reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): Likewise. * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. cp: * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. f: * bad.c (_ffebad_message_, ffebad_messages_): Const-ify. * bld.c (ffebld_arity_op_): Likewise. * bld.h (ffebld_arity_op_): Likewise. * com.c (ffecom_init_0): Likewise. * intdoc.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, names, gens, imps, specs, cc_pair, cc_descriptions, cc_summaries): Likewise. * intrin.c (_ffeintrin_name_, _ffeintrin_gen_, _ffeintrin_spec_, _ffeintrin_imp_, ffeintrin_names_, ffeintrin_gens_, ffeintrin_imps_, ffeintrin_specs_): Likewise. java: * jcf-io.c (format_uint): Const-ify. * lang.c (java_tree_code_type, java_tree_code_length): Likewise. * lex.c (java_get_line_col): Likewise. * parse.y (build_incdec): Likewise. From-SVN: r46062
2001-10-07 18:51:11 +02:00
static const char tf[] = "--traditional-format ";
obstack_grow (&obstack, tf, sizeof(tf) - 1);
obstack_grow0 (&obstack, asm_spec, strlen (asm_spec));
asm_spec = XOBFINISH (&obstack, const char *);
}
#endif
configure.in: Check for ld. * configure.in: Check for ld. (HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option. * configure, config.in: Rebuilt. * config.gcc: Add crtbeginT.o to extra_parts where needed. * config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc frame unwinding on Linux. * config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde frame unwinding. * config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static. * config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define. * config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't iterate further if pc falls into current library, but fde was not found. * config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static if using glibc. (LINK_EH_SPEC): Define. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o. * Makefile.in (crtbeginT.o): Add rule. * gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh. If neither -static-libgcc nor -shared-libgcc is passed and -shared, use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not. If none of the above switches are passed, use -lgcc -lgcc_eh. (init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec. * mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if creating libgcc_s.so, put them into separate libgcc_eh.a instead. * unwind-dw2-fde.c: Don't include any headers if this file is included from other .c file. * unwind-dw2-fde-glibc.c: New file. * crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define. Use it instead of EH_FRAME_SECTION_NAME where appropriate. From-SVN: r48039
2001-12-15 12:49:18 +01:00
#ifdef LINK_EH_SPEC
/* Prepend LINK_EH_SPEC to whatever link_spec we had before. */
obstack_grow (&obstack, LINK_EH_SPEC, sizeof(LINK_EH_SPEC) - 1);
obstack_grow0 (&obstack, link_spec, strlen (link_spec));
link_spec = XOBFINISH (&obstack, const char *);
configure.in: Check for ld. * configure.in: Check for ld. (HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option. * configure, config.in: Rebuilt. * config.gcc: Add crtbeginT.o to extra_parts where needed. * config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc frame unwinding on Linux. * config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde frame unwinding. * config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static. * config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define. * config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't iterate further if pc falls into current library, but fde was not found. * config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static if using glibc. (LINK_EH_SPEC): Define. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64): Use crtbeginT.o for -static. (LINK_EH_SPEC): Define. * config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o. * Makefile.in (crtbeginT.o): Add rule. * gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh. If neither -static-libgcc nor -shared-libgcc is passed and -shared, use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not. If none of the above switches are passed, use -lgcc -lgcc_eh. (init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec. * mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if creating libgcc_s.so, put them into separate libgcc_eh.a instead. * unwind-dw2-fde.c: Don't include any headers if this file is included from other .c file. * unwind-dw2-fde-glibc.c: New file. * crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define. Use it instead of EH_FRAME_SECTION_NAME where appropriate. From-SVN: r48039
2001-12-15 12:49:18 +01:00
#endif
1997-01-16 23:15:53 +01:00
specs = sl;
}
1992-02-01 06:15:32 +01:00
/* Change the value of spec NAME to SPEC. If SPEC is empty, then the spec is
removed; If the spec starts with a + then SPEC is added to the end of the
1996-07-04 00:07:53 +02:00
current spec. */
1992-02-01 06:15:32 +01:00
static void
set_spec (const char *name, const char *spec)
1992-02-01 06:15:32 +01:00
{
struct spec_list *sl;
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *old_spec;
1997-01-16 23:15:53 +01:00
int name_len = strlen (name);
int i;
/* If this is the first call, initialize the statically allocated specs. */
if (!specs)
{
struct spec_list *next = (struct spec_list *) 0;
optabs.c (init_optabs): Initialize fixtab... * optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab, and extendtab within their proper array boundaries. * emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds for the entire array. * config/arm/arm.c (arm_override_options): Use ARRAY_SIZE. * config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise. * config/avr/avr.c (order_regs_for_local_alloc): Likewise. * config/fr30/fr30.c (fr30_print_operand): Likewise. * config/i386/dgux.c (output_options): Likewise. * config/i386/dgux.h (ASM_FILE_START): Likewise. * config/m88k/m88k.c (output_options): Likewise. * config/m88k/m88k.h (ASM_FILE_START): Likewise. * config/mcore/mcore.c (mcore_output_inline_const_forced, layout_mcore_frame, handle_structs_in_regs): Likewise. * config/mips/mips.c (output_block_move): Likewise. * config/rs6000/rs6000.c (rs6000_override_options, rs6000_file_start): Likewise. * config/sparc/sparc.c (sparc_add_gc_roots): Likewise. * fixinc/fixfixes.c (FIX_TABLE_CT): Likewise. * fixinc/fixtests.c (TEST_TABLE_CT): Likewise. * builtins.c (expand_builtin_setjmp): Likewise. * expr.c (safe_from_p): Likewise. * flow.c (life_analysis): Likewise. * fold-const.c (size_int_type_wide): Likewise. * gcc.c (translate_options, init_spec, set_spec, main): Likewise. * genattrtab.c (make_length_attrs): Likewise. * genopinit.c (gen_insn): Likewise. * genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise. * global.c (global_alloc): Likewise. * local-alloc.c (find_free_reg): Likewise. * mips-tdump.c (print_symbol): Likewise. * mips-tfile.c (parse_def, parse_input): Likewise. * reload1.c (NUM_ELIMINABLE_REGS): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * stor-layout.c (set_sizetype): Likewise. * varasm.c (decode_reg_name): Likewise. * toplev.c (decode_f_option, decode_W_option, set_target_switch, print_switch_values): Likewise. (NUM_ELEM): Remove macro. (display_help, main): s/NUM_ELEM/ARRAY_SIZE/ From-SVN: r35949
2000-08-24 22:31:35 +02:00
for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--)
{
sl = &static_specs[i];
sl->next = next;
next = sl;
}
specs = sl;
}
/* See if the spec already exists. */
1992-02-01 06:15:32 +01:00
for (sl = specs; sl; sl = sl->next)
1997-01-16 23:15:53 +01:00
if (name_len == sl->name_len && !strcmp (sl->name, name))
1992-02-01 06:15:32 +01:00
break;
if (!sl)
{
/* Not found - make it. */
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
sl = XNEW (struct spec_list);
c-aux-info.c (concat): Don't define. * c-aux-info.c (concat): Don't define. * cccp.c (my_strerror): Likewise. All callers changed to use xstrerror instead. (do_include): Call xstrdup, not xmalloc/strcpy. (grow_outbuf): Don't check if xrealloc returns NULL, it can't. (xmalloc, xrealloc, xcalloc, xstrdup): Don't define. * collect2.c (my_strsignal): Likewise. All callers changed to use strsignal instead. (locatelib): Call xstrdup, not xmalloc/strcpy. * 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc. * dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy. * i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc. * mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy. * cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero. * dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/... * except.c (new_eh_region_entry): Call xmalloc/xrealloc, not malloc/realloc. (find_all_handler_type_matches): Likewise. Don't check return value. (get_new_handler, init_insn_eh_region, process_nestinfo): Call xmalloc, not malloc. (init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero. * gcc.c (xstrerror, xmalloc, xrealloc): Don't define. (init_spec): Call xcalloc, not xmalloc/bzero. (set_spec): Call xstrdup, not save_string. (record_temp_file): Call xstrdup, not xmalloc/strcpy. (find_a_file): Call xstrdup, not xmalloc/strcpy. (process_command): Call xstrdup, not save_string. (main): Call xcalloc, not xmalloc/bzero. * gcov.c (xmalloc): Don't define. (create_program_flow_graph): Call xcalloc, not xmalloc/bzero. (scan_for_source_files): Call xstrdup, not xmalloc/strcpy. (output_data): Call xcalloc, not xmalloc/bzero. * haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero. * mips-tdump.c (xmalloc): Don't define. (print_symbol): Call xmalloc, not malloc. (read_tfile): Call xcalloc, not calloc. * mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc): Don't define. All callers of xfree/my_strsignal changed to use free/strsignal instead. (allocate_cluster): Call xcalloc, not calloc. * objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/... Fix memory leak, free allocated memory. * prefix.c (translate_name): Call xstrdup, not save_string. (update_path): Likewise. * profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy. * protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2): Don't define. Callers of xfree/savestring2 changed to use free/concat instead. * reload1.c (reload): Call xcalloc, not xmalloc/bzero. (init_elim_table): Likewise. * resource.c (init_resource_info): Likewise. * stupid.c (stupid_life_analysis): Likewise. * toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define. (open_dump_file): Call concat, not xmalloc/strcpy/... (clean_dump_file): Likewise. (compile_file): Call xstrdup, not xmalloc/strcpy. From-SVN: r29148
1999-09-07 04:36:41 +02:00
sl->name = xstrdup (name);
1997-01-16 23:15:53 +01:00
sl->name_len = name_len;
sl->ptr_spec = &sl->ptr;
sl->alloc_p = 0;
*(sl->ptr_spec) = "";
1992-02-01 06:15:32 +01:00
sl->next = specs;
specs = sl;
}
1997-01-16 23:15:53 +01:00
old_spec = *(sl->ptr_spec);
Warning fixes: * Makefile.in (sched.o): Depend on recog.h. * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to (unsigned) when comparing against one. (find_base_value): Likewise. (record_base_value): Cast variable `regno' to (unsigned) when comparing against one. Cast the result of REGNO() macro to (unsigned) when comparing against one. (memrefs_conflict_p): Change type of variables `r_x' and `r_y' to unsigned. (init_alias_analysis): Add unsigned variable `ui'. Use it as loop variable where an unsigned index is needed. * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code) before comparing against one. * collect2.c: Add prototypes for functions `error', `fatal' and `fatal_perror'. Make these functions take variable arguments instead of faking it with a fixed number of args. (write_c_file_stat): Cast the argument of ctype macro to (unsigned char). * combine.c (can_combine_p): Mark parameter `pred' with ATTRIBUTE_UNUSED. (find_split_point): Cast variable `src' to (unsigned HOST_WIDE_INT) when comparing against one. HOST_WIDE_INT) when comparing against one. (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_logical): Likewise. (force_to_mode): Cast result of INTVAL() macro to (unsigned HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_and_const_int): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (merge_outer_ops): Cast variable const0 to `unsigned HOST_WIDE_INT' when comparing against the result of GET_MODE_MASK() macro. (simplify_comparison): Likewise for variable `c0'. Cast variable `const_op' to `unsigned HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'. config/mips/mips.c (gen_int_relational): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (output_block_move): Cast `sizeof' expression to (int) when comparing against one. (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing against one. (save_restore_insns): Cast `base_offset' to `long' to match format specifier in fprintf. * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro to `enum machine_mode'. * flow.c (life_analysis_1): Remove unused variable `insn'. * gcc.c (translate_options): Move variables `j' and `k' into the scope in which they are used. Change their types to `size_t'. (set_spec): Cast the argument of ctype macro to `unsigned char'. (read_specs): Likewise. (process_command): Cast `sizeof' to (int) when comparing against one. (do_spec_1): Cast the argument of ctype macro to `unsigned char'. (handle_braces): Cast both sides of `==' expression to `long' to ensure sign matching. (main): Cast variable `i' to `int' when comparing against one. * gcov-io.h (__fetch_long): Change type of parameter `bytes' from int to size_t. Cast variable `i' to size_t when comparing against one. * genattrtab.c (convert_set_attr_alternative): Remove unused parameter `insn_code'. All callers changed. (convert_set_attr): Likewise. * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to size_t when comparing against one. Likewise for variable `len'. * global.c (global_alloc): Cast variable `max_regno' to size_t when comparing against one. Likewise for variable `max_allocno'. * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED. * local-alloc.c (validate_equiv_mem_from_store): Mark parameter `set' with ATTRIBUTE_UNUSED. (find_free_reg): Cast `sizeof' expression to (int) when comparing against one. * loop.c (count_loop_regs_set): Remove unused variable `dest'. (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED. (get_condition): Cast variable `const_val' to `unsigned HOST_WIDE_INT' when comparing against one. Cast unsigned expression to HOST_WIDE_INT when comparing against one. (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED. (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to `unsigned' when comparing against one. * protoize.c (is_id_char): Change type of parameter `ch' to unsigned char. (munge_compile_params): Cast argument of ctype macro to (const unsigned char). (process_aux_info_file): Cast variable `aux_info_size' to int when comparing against one. (forward_to_next_token_char): Cast argument of ctype macro to `const unsigned char'. (edit_formals_lists): Likewise. (find_rightmost_formals_list): Likewise. (add_local_decl): Likewise. (add_global_decls): Likewise. (edit_fn_definition): Likewise. (do_cleaning): Likewise. (scan_for_missed_items): Likewise. (edit_file): Cast variable `orig_size' to (int) when comparing against one. (main): Cast argument of ctype macro to `const unsigned char'. * recog.c (const_int_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED. * regclass.c (record_reg_classes): Change type of variable `c' to `unsigned char'. Cast `char' array index to `unsigned char'. * reload.c (push_secondary_reload): Cast argument to REG_CLASS_FROM_LETTER() macro to `unsigned char'. * reload1.c (calculate_needs): Cast `char' array index to `unsigned char'. (set_label_offsets): Change type of variable `i' to unsigned int. Cast result of XVECLEN() macro to unsigned when comparing against one. (mark_not_eliminable): Change type of variable `i' to unsigned. (order_regs_for_reload): Likewise. Cast `max_regno' to unsigned when comparing against one. (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when comparing against one. (choose_reload_regs): Hide unused label `fail'. (reload_cse_simplify_operands): Cast `char' array index to `unsigned char'. (reload_combine_note_store): Mark parameter `set' with ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing against one. (reload_cse_move2add): Remove unused variable `src2'. * sched.c: Include recog.h. (sched_note_set): Remove unused parameter `b'. All callers changed. (split_hard_reg_notes): Likewise for parameter `orig_insn'. (blockage_range): Cast result of UNIT_BLOCKED() macro to (int) when comparing against one. * stupid.c (stupid_find_reg): Mark parameter `changes_size' with ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when comparing against one. * unroll.c (precondition_loop_p): Remove unused parameter `loop_end'. All callers changed. From-SVN: r23079
1998-10-14 11:02:55 +02:00
*(sl->ptr_spec) = ((spec[0] == '+' && ISSPACE ((unsigned char)spec[1]))
? concat (old_spec, spec + 1, NULL)
c-aux-info.c (concat): Don't define. * c-aux-info.c (concat): Don't define. * cccp.c (my_strerror): Likewise. All callers changed to use xstrerror instead. (do_include): Call xstrdup, not xmalloc/strcpy. (grow_outbuf): Don't check if xrealloc returns NULL, it can't. (xmalloc, xrealloc, xcalloc, xstrdup): Don't define. * collect2.c (my_strsignal): Likewise. All callers changed to use strsignal instead. (locatelib): Call xstrdup, not xmalloc/strcpy. * 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc. * dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy. * i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc. * mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy. * cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero. * dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/... * except.c (new_eh_region_entry): Call xmalloc/xrealloc, not malloc/realloc. (find_all_handler_type_matches): Likewise. Don't check return value. (get_new_handler, init_insn_eh_region, process_nestinfo): Call xmalloc, not malloc. (init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero. * gcc.c (xstrerror, xmalloc, xrealloc): Don't define. (init_spec): Call xcalloc, not xmalloc/bzero. (set_spec): Call xstrdup, not save_string. (record_temp_file): Call xstrdup, not xmalloc/strcpy. (find_a_file): Call xstrdup, not xmalloc/strcpy. (process_command): Call xstrdup, not save_string. (main): Call xcalloc, not xmalloc/bzero. * gcov.c (xmalloc): Don't define. (create_program_flow_graph): Call xcalloc, not xmalloc/bzero. (scan_for_source_files): Call xstrdup, not xmalloc/strcpy. (output_data): Call xcalloc, not xmalloc/bzero. * haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero. * mips-tdump.c (xmalloc): Don't define. (print_symbol): Call xmalloc, not malloc. (read_tfile): Call xcalloc, not calloc. * mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc): Don't define. All callers of xfree/my_strsignal changed to use free/strsignal instead. (allocate_cluster): Call xcalloc, not calloc. * objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/... Fix memory leak, free allocated memory. * prefix.c (translate_name): Call xstrdup, not save_string. (update_path): Likewise. * profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy. * protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2): Don't define. Callers of xfree/savestring2 changed to use free/concat instead. * reload1.c (reload): Call xcalloc, not xmalloc/bzero. (init_elim_table): Likewise. * resource.c (init_resource_info): Likewise. * stupid.c (stupid_life_analysis): Likewise. * toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define. (open_dump_file): Call concat, not xmalloc/strcpy/... (clean_dump_file): Likewise. (compile_file): Call xstrdup, not xmalloc/strcpy. From-SVN: r29148
1999-09-07 04:36:41 +02:00
: xstrdup (spec));
1996-01-18 16:19:51 +01:00
#ifdef DEBUG_SPECS
if (verbose_flag)
notice ("Setting spec %s to '%s'\n\n", name, *(sl->ptr_spec));
#endif
/* Free the old spec. */
1997-01-16 23:15:53 +01:00
if (old_spec && sl->alloc_p)
free ((void *) old_spec);
1997-01-16 23:15:53 +01:00
sl->alloc_p = 1;
1992-02-01 06:15:32 +01:00
}
/* Accumulate a command (program name and args), and run it. */
/* Vector of pointers to arguments in the current line of specifications. */
static const char **argbuf;
1992-02-01 06:15:32 +01:00
/* Number of elements allocated in argbuf. */
static int argbuf_length;
/* Number of elements in argbuf currently in use (containing args). */
static int argbuf_index;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
/* Position in the argbuf array containing the name of the output file
(the value associated with the "-o" flag). */
static int have_o_argbuf_index = 0;
/* Were the options -c or -S passed. */
static int have_c = 0;
/* Was the option -o passed. */
static int have_o = 0;
/* This is the list of suffixes and codes (%g/%u/%U/%j) and the associated
temp file. If the HOST_BIT_BUCKET is used for %j, no entry is made for
it here. */
static struct temp_name {
const char *suffix; /* suffix associated with the code. */
int length; /* strlen (suffix). */
int unique; /* Indicates whether %g or %u/%U was used. */
const char *filename; /* associated filename. */
int filename_length; /* strlen (filename). */
struct temp_name *next;
} *temp_names;
1992-02-01 06:15:32 +01:00
/* Number of commands executed so far. */
static int execution_count;
/* Number of commands that exited with a signal. */
static int signal_count;
1992-02-01 06:15:32 +01:00
/* Name with which this program was invoked. */
static const char *programname;
1992-02-01 06:15:32 +01:00
/* Allocate the argument vector. */
static void
alloc_args (void)
{
argbuf_length = 10;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
argbuf = XNEWVEC (const char *, argbuf_length);
}
1992-02-01 06:15:32 +01:00
/* Clear out the vector of arguments (after a command is executed). */
static void
clear_args (void)
1992-02-01 06:15:32 +01:00
{
argbuf_index = 0;
}
/* Add one argument to the vector at the end.
This is done when a space is seen or at the end of the line.
If DELETE_ALWAYS is nonzero, the arg is a filename
and the file should be deleted eventually.
If DELETE_FAILURE is nonzero, the arg is a filename
and the file should be deleted if this compilation fails. */
static void
store_arg (const char *arg, int delete_always, int delete_failure)
1992-02-01 06:15:32 +01:00
{
if (argbuf_index + 1 == argbuf_length)
argbuf = xrealloc (argbuf, (argbuf_length *= 2) * sizeof (const char *));
1992-02-01 06:15:32 +01:00
argbuf[argbuf_index++] = arg;
argbuf[argbuf_index] = 0;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
if (strcmp (arg, "-o") == 0)
have_o_argbuf_index = argbuf_index;
1992-02-01 06:15:32 +01:00
if (delete_always || delete_failure)
record_temp_file (arg, delete_always, delete_failure);
}
/* Load specs from a file name named FILENAME, replacing occurrences of
various different types of line-endings, \r\n, \n\r and just \r, with
a single \n. */
static char *
load_specs (const char *filename)
{
int desc;
int readlen;
struct stat statbuf;
char *buffer;
char *buffer_p;
char *specs;
char *specs_p;
if (verbose_flag)
notice ("Reading specs from %s\n", filename);
/* Open and stat the file. */
desc = open (filename, O_RDONLY, 0);
if (desc < 0)
pfatal_with_name (filename);
if (stat (filename, &statbuf) < 0)
pfatal_with_name (filename);
/* Read contents of file into BUFFER. */
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
buffer = XNEWVEC (char, statbuf.st_size + 1);
readlen = read (desc, buffer, (unsigned) statbuf.st_size);
if (readlen < 0)
pfatal_with_name (filename);
buffer[readlen] = 0;
close (desc);
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
specs = XNEWVEC (char, readlen + 1);
specs_p = specs;
for (buffer_p = buffer; buffer_p && *buffer_p; buffer_p++)
{
int skip = 0;
char c = *buffer_p;
if (c == '\r')
{
if (buffer_p > buffer && *(buffer_p - 1) == '\n') /* \n\r */
skip = 1;
else if (*(buffer_p + 1) == '\n') /* \r\n */
skip = 1;
else /* \r */
c = '\n';
}
if (! skip)
*specs_p++ = c;
}
*specs_p = '\0';
free (buffer);
return (specs);
}
/* Read compilation specs from a file named FILENAME,
replacing the default ones.
A suffix which starts with `*' is a definition for
one of the machine-specific sub-specs. The "suffix" should be
*asm, *cc1, *cpp, *link, *startfile, etc.
The corresponding spec is stored in asm_spec, etc.,
rather than in the `compilers' vector.
Anything invalid in the file is a fatal error. */
static void
read_specs (const char *filename, int main_p)
{
char *buffer;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
char *p;
buffer = load_specs (filename);
/* Scan BUFFER for specs, putting them in the vector. */
p = buffer;
while (1)
{
char *suffix;
char *spec;
char *in, *out, *p1, *p2, *p3;
/* Advance P in BUFFER to the next nonblank nocomment line. */
p = skip_whitespace (p);
if (*p == 0)
break;
/* Is this a special command that starts with '%'? */
/* Don't allow this for the main specs file, since it would
encourage people to overwrite it. */
if (*p == '%' && !main_p)
{
p1 = p;
while (*p && *p != '\n')
p++;
/* Skip '\n'. */
p++;
if (!strncmp (p1, "%include", sizeof ("%include") - 1)
&& (p1[sizeof "%include" - 1] == ' '
|| p1[sizeof "%include" - 1] == '\t'))
{
char *new_filename;
p1 += sizeof ("%include");
while (*p1 == ' ' || *p1 == '\t')
p1++;
if (*p1++ != '<' || p[-2] != '>')
fatal ("specs %%include syntax malformed after %ld characters",
(long) (p1 - buffer + 1));
p[-2] = '\0';
new_filename = find_a_file (&startfile_prefixes, p1, R_OK, true);
read_specs (new_filename ? new_filename : p1, FALSE);
continue;
}
else if (!strncmp (p1, "%include_noerr", sizeof "%include_noerr" - 1)
&& (p1[sizeof "%include_noerr" - 1] == ' '
|| p1[sizeof "%include_noerr" - 1] == '\t'))
{
char *new_filename;
p1 += sizeof "%include_noerr";
while (*p1 == ' ' || *p1 == '\t')
p1++;
if (*p1++ != '<' || p[-2] != '>')
fatal ("specs %%include syntax malformed after %ld characters",
(long) (p1 - buffer + 1));
p[-2] = '\0';
new_filename = find_a_file (&startfile_prefixes, p1, R_OK, true);
if (new_filename)
read_specs (new_filename, FALSE);
else if (verbose_flag)
c-decl.c (grokdeclarator): Use ISO word. * c-decl.c (grokdeclarator): Use ISO word. * cppinit.c: Remove leading capital from diagnostic messages, as per GNU coding standards. * diagnostic.c: Similarly. * emit-rtl.c: Similarly. * final.c: Similarly. * gcc.c: Similarly. * tradcpp.c: Similarly. * config/arm/arm.c: Similarly. * config/arm/arm.h: Similarly. * config/avr/avr.c: Similarly. * config/avr/avr.h: Similarly. * config/c4x/c4x.c: Similarly. * config/cris/cris.c: Similarly. * config/cris/cris.h: Similarly. * config/d30v/d30v.c: Similarly. * config/dsp16xx/dsp16xx.c: Similarly. * config/dsp16xx/dsp16xx.h: Similarly. * config/h8300/h8300.c: Similarly. * config/i386/i386.c: Similarly. * config/i386/xm-djgpp.h: Similarly. * config/i960/i960.h: Similarly. * config/m32r/m32r.c: Similarly. * config/m68hc11/m68hc11.c: Similarly. * config/m88k/m88k.c: Similarly. * config/m88k/m88k.h: Similarly. * config/mcore/mcore.c: Similarly. * config/mcore/mcore.h: Similarly. * config/mips/mips.c: Similarly. * config/mmix/mmix.c: Similarly. * config/pa/pa.c: Similarly. * config/rs6000/rs6000.c: Similarly. * config/rs6000/sysv4.h: Similarly. * config/s390/s390.c: Similarly. * config/sparc/sparc.c: Similarly. * config/v850/v850-c.c: Similarly. * config/v850/v850.c: Similarly. ch: * actions.c: Remove leading capital from diagnostic messages, as per GNU coding standards. * decl.c: Similarly. * expr.c: Similarly. * inout.c: Similarly. * lang.c: Similarly. * loop.c: Similarly. * nloop.c: Similarly. * parse.c: Similarly. * satisfy.c: Similarly. * tasking.c: Similarly. * tree.c: Similarly. * typeck.c: Similarly. cp: * typeck2.c: Remove leading capital from diagnostic messages, as per GNU coding standards. f: * com.c: Remove leading capital from diagnostic messages, as per GNU coding standards. * g77spec.c: Similarly. * lex.c: Similarly. java: * expr.c: Remove leading capital from diagnostic messages, as per GNU coding standards. * jcf-io.c: Similarly. * jcf-parse.c: Similarly. * jv-scan.c: Similarly. * jvspec.c: Similarly. * mangle.c: Similarly. From-SVN: r47558
2001-12-03 20:15:19 +01:00
notice ("could not find specs file %s\n", p1);
continue;
}
else if (!strncmp (p1, "%rename", sizeof "%rename" - 1)
&& (p1[sizeof "%rename" - 1] == ' '
|| p1[sizeof "%rename" - 1] == '\t'))
{
int name_len;
struct spec_list *sl;
struct spec_list *newsl;
/* Get original name. */
p1 += sizeof "%rename";
while (*p1 == ' ' || *p1 == '\t')
p1++;
if (! ISALPHA ((unsigned char) *p1))
fatal ("specs %%rename syntax malformed after %ld characters",
(long) (p1 - buffer));
p2 = p1;
while (*p2 && !ISSPACE ((unsigned char) *p2))
p2++;
if (*p2 != ' ' && *p2 != '\t')
fatal ("specs %%rename syntax malformed after %ld characters",
(long) (p2 - buffer));
name_len = p2 - p1;
*p2++ = '\0';
while (*p2 == ' ' || *p2 == '\t')
p2++;
if (! ISALPHA ((unsigned char) *p2))
fatal ("specs %%rename syntax malformed after %ld characters",
(long) (p2 - buffer));
/* Get new spec name. */
p3 = p2;
while (*p3 && !ISSPACE ((unsigned char) *p3))
p3++;
if (p3 != p - 1)
fatal ("specs %%rename syntax malformed after %ld characters",
(long) (p3 - buffer));
*p3 = '\0';
for (sl = specs; sl; sl = sl->next)
if (name_len == sl->name_len && !strcmp (sl->name, p1))
break;
if (!sl)
fatal ("specs %s spec was not found to be renamed", p1);
if (strcmp (p1, p2) == 0)
continue;
for (newsl = specs; newsl; newsl = newsl->next)
if (strcmp (newsl->name, p2) == 0)
fatal ("%s: attempt to rename spec '%s' to already defined spec '%s'",
filename, p1, p2);
if (verbose_flag)
{
notice ("rename spec %s to %s\n", p1, p2);
#ifdef DEBUG_SPECS
notice ("spec is '%s'\n\n", *(sl->ptr_spec));
#endif
}
set_spec (p2, *(sl->ptr_spec));
if (sl->alloc_p)
free ((void *) *(sl->ptr_spec));
*(sl->ptr_spec) = "";
sl->alloc_p = 0;
continue;
}
else
fatal ("specs unknown %% command after %ld characters",
(long) (p1 - buffer));
}
/* Find the colon that should end the suffix. */
p1 = p;
while (*p1 && *p1 != ':' && *p1 != '\n')
p1++;
/* The colon shouldn't be missing. */
if (*p1 != ':')
fatal ("specs file malformed after %ld characters",
(long) (p1 - buffer));
/* Skip back over trailing whitespace. */
p2 = p1;
while (p2 > buffer && (p2[-1] == ' ' || p2[-1] == '\t'))
p2--;
/* Copy the suffix to a string. */
suffix = save_string (p, p2 - p);
/* Find the next line. */
p = skip_whitespace (p1 + 1);
if (p[1] == 0)
fatal ("specs file malformed after %ld characters",
(long) (p - buffer));
p1 = p;
/* Find next blank line or end of string. */
while (*p1 && !(*p1 == '\n' && (p1[1] == '\n' || p1[1] == '\0')))
p1++;
/* Specs end at the blank line and do not include the newline. */
spec = save_string (p, p1 - p);
p = p1;
/* Delete backslash-newline sequences from the spec. */
in = spec;
out = spec;
while (*in != 0)
{
if (in[0] == '\\' && in[1] == '\n')
in += 2;
else if (in[0] == '#')
while (*in && *in != '\n')
in++;
else
*out++ = *in++;
}
*out = 0;
if (suffix[0] == '*')
{
if (! strcmp (suffix, "*link_command"))
link_command_spec = spec;
else
set_spec (suffix + 1, spec);
}
else
{
/* Add this pair to the vector. */
compilers
= xrealloc (compilers,
(n_compilers + 2) * sizeof (struct compiler));
compilers[n_compilers].suffix = suffix;
compilers[n_compilers].spec = spec;
n_compilers++;
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
memset (&compilers[n_compilers], 0, sizeof compilers[n_compilers]);
}
if (*suffix == 0)
link_command_spec = spec;
}
if (link_command_spec == 0)
fatal ("spec file has no spec for linking");
}
1992-02-01 06:15:32 +01:00
/* Record the names of temporary files we tell compilers to write,
and delete them at the end of the run. */
/* This is the common prefix we use to make temp file names.
It is chosen once for each run of this program.
It is substituted into a spec by %g or %j.
1992-02-01 06:15:32 +01:00
Thus, all temp file names contain this prefix.
In practice, all temp file names start with this prefix.
This prefix comes from the envvar TMPDIR if it is defined;
otherwise, from the P_tmpdir macro if that is defined;
otherwise, in /usr/tmp or /tmp;
or finally the current directory if all else fails. */
1992-02-01 06:15:32 +01:00
static const char *temp_filename;
1992-02-01 06:15:32 +01:00
/* Length of the prefix. */
static int temp_filename_length;
/* Define the list of temporary files to delete. */
struct temp_file
{
const char *name;
1992-02-01 06:15:32 +01:00
struct temp_file *next;
};
/* Queue of files to delete on success or failure of compilation. */
static struct temp_file *always_delete_queue;
/* Queue of files to delete on failure of compilation. */
static struct temp_file *failure_delete_queue;
/* Record FILENAME as a file to be deleted automatically.
ALWAYS_DELETE nonzero means delete it if all compilation succeeds;
otherwise delete it in any case.
FAIL_DELETE nonzero means delete it if a compilation step fails;
otherwise delete it in any case. */
void
record_temp_file (const char *filename, int always_delete, int fail_delete)
1992-02-01 06:15:32 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
char *const name = xstrdup (filename);
1992-02-01 06:15:32 +01:00
if (always_delete)
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
struct temp_file *temp;
1992-02-01 06:15:32 +01:00
for (temp = always_delete_queue; temp; temp = temp->next)
if (! strcmp (name, temp->name))
goto already1;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
temp = XNEW (struct temp_file);
1992-02-01 06:15:32 +01:00
temp->next = always_delete_queue;
temp->name = name;
always_delete_queue = temp;
1992-02-01 06:15:32 +01:00
already1:;
}
if (fail_delete)
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
struct temp_file *temp;
1992-02-01 06:15:32 +01:00
for (temp = failure_delete_queue; temp; temp = temp->next)
if (! strcmp (name, temp->name))
goto already2;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
temp = XNEW (struct temp_file);
1992-02-01 06:15:32 +01:00
temp->next = failure_delete_queue;
temp->name = name;
failure_delete_queue = temp;
1992-02-01 06:15:32 +01:00
already2:;
}
}
/* Delete all the temporary files whose names we previously recorded. */
#ifndef DELETE_IF_ORDINARY
#define DELETE_IF_ORDINARY(NAME,ST,VERBOSE_FLAG) \
do \
{ \
if (stat (NAME, &ST) >= 0 && S_ISREG (ST.st_mode)) \
if (unlink (NAME) < 0) \
if (VERBOSE_FLAG) \
perror_with_name (NAME); \
} while (0)
#endif
static void
delete_if_ordinary (const char *name)
{
struct stat st;
#ifdef DEBUG
int i, c;
printf ("Delete %s? (y or n) ", name);
fflush (stdout);
i = getchar ();
if (i != '\n')
while ((c = getchar ()) != '\n' && c != EOF)
;
if (i == 'y' || i == 'Y')
#endif /* DEBUG */
DELETE_IF_ORDINARY (name, st, verbose_flag);
}
1992-02-01 06:15:32 +01:00
static void
delete_temp_files (void)
1992-02-01 06:15:32 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
struct temp_file *temp;
1992-02-01 06:15:32 +01:00
for (temp = always_delete_queue; temp; temp = temp->next)
delete_if_ordinary (temp->name);
1992-02-01 06:15:32 +01:00
always_delete_queue = 0;
}
/* Delete all the files to be deleted on error. */
static void
delete_failure_queue (void)
1992-02-01 06:15:32 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
struct temp_file *temp;
1992-02-01 06:15:32 +01:00
for (temp = failure_delete_queue; temp; temp = temp->next)
delete_if_ordinary (temp->name);
1992-02-01 06:15:32 +01:00
}
static void
clear_failure_queue (void)
1992-02-01 06:15:32 +01:00
{
failure_delete_queue = 0;
}
/* Call CALLBACK for each path in PATHS, breaking out early if CALLBACK
returns non-NULL.
If DO_MULTI is true iterate over the paths twice, first with multilib
suffix then without, otherwise iterate over the paths once without
adding a multilib suffix. When DO_MULTI is true, some attempt is made
to avoid visiting the same path twice, but we could do better. For
instance, /usr/lib/../lib is considered different from /usr/lib.
At least EXTRA_SPACE chars past the end of the path passed to
CALLBACK are available for use by the callback.
CALLBACK_INFO allows extra parameters to be passed to CALLBACK.
Returns the value returned by CALLBACK. */
static void *
for_each_path (const struct path_prefix *paths,
bool do_multi,
size_t extra_space,
void *(*callback) (char *, void *),
void *callback_info)
{
struct prefix_list *pl;
const char *multi_dir = NULL;
const char *multi_os_dir = NULL;
const char *multi_suffix;
const char *just_multi_suffix;
char *path = NULL;
void *ret = NULL;
bool skip_multi_dir = false;
bool skip_multi_os_dir = false;
multi_suffix = machine_suffix;
just_multi_suffix = just_machine_suffix;
if (do_multi && multilib_dir && strcmp (multilib_dir, ".") != 0)
{
multi_dir = concat (multilib_dir, dir_separator_str, NULL);
multi_suffix = concat (multi_suffix, multi_dir, NULL);
just_multi_suffix = concat (just_multi_suffix, multi_dir, NULL);
}
if (do_multi && multilib_os_dir && strcmp (multilib_os_dir, ".") != 0)
multi_os_dir = concat (multilib_os_dir, dir_separator_str, NULL);
while (1)
{
size_t multi_dir_len = 0;
size_t multi_os_dir_len = 0;
size_t suffix_len;
size_t just_suffix_len;
size_t len;
if (multi_dir)
multi_dir_len = strlen (multi_dir);
if (multi_os_dir)
multi_os_dir_len = strlen (multi_os_dir);
suffix_len = strlen (multi_suffix);
just_suffix_len = strlen (just_multi_suffix);
if (path == NULL)
{
len = paths->max_len + extra_space + 1;
if (suffix_len > multi_os_dir_len)
len += suffix_len;
else
len += multi_os_dir_len;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
path = XNEWVEC (char, len);
}
for (pl = paths->plist; pl != 0; pl = pl->next)
1992-07-08 05:40:47 +02:00
{
len = strlen (pl->prefix);
memcpy (path, pl->prefix, len);
/* Look first in MACHINE/VERSION subdirectory. */
if (!skip_multi_dir)
{
memcpy (path + len, multi_suffix, suffix_len + 1);
ret = callback (path, callback_info);
if (ret)
break;
}
/* Some paths are tried with just the machine (ie. target)
subdir. This is used for finding as, ld, etc. */
if (!skip_multi_dir
&& pl->require_machine_suffix == 2)
{
memcpy (path + len, just_multi_suffix, just_suffix_len + 1);
ret = callback (path, callback_info);
if (ret)
break;
}
/* Now try the base path. */
if (!pl->require_machine_suffix
&& !(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
{
const char *this_multi;
size_t this_multi_len;
if (pl->os_multilib)
{
this_multi = multi_os_dir;
this_multi_len = multi_os_dir_len;
}
else
{
this_multi = multi_dir;
this_multi_len = multi_dir_len;
}
if (this_multi_len)
memcpy (path + len, this_multi, this_multi_len + 1);
else
path[len] = '\0';
ret = callback (path, callback_info);
if (ret)
break;
}
1992-07-08 05:40:47 +02:00
}
if (pl)
break;
1992-07-08 05:40:47 +02:00
if (multi_dir == NULL && multi_os_dir == NULL)
break;
/* Run through the paths again, this time without multilibs.
Don't repeat any we have already seen. */
if (multi_dir)
{
free ((char *) multi_dir);
multi_dir = NULL;
free ((char *) multi_suffix);
multi_suffix = machine_suffix;
free ((char *) just_multi_suffix);
just_multi_suffix = just_machine_suffix;
}
else
skip_multi_dir = true;
if (multi_os_dir)
{
free ((char *) multi_os_dir);
multi_os_dir = NULL;
}
else
skip_multi_os_dir = true;
}
if (multi_dir)
{
free ((char *) multi_dir);
free ((char *) multi_suffix);
free ((char *) just_multi_suffix);
}
if (multi_os_dir)
free ((char *) multi_os_dir);
if (ret != path)
free (path);
return ret;
}
/* Callback for build_search_list. Adds path to obstack being built. */
struct add_to_obstack_info {
struct obstack *ob;
bool check_dir;
bool first_time;
};
static void *
add_to_obstack (char *path, void *data)
{
struct add_to_obstack_info *info = data;
if (info->check_dir && !is_directory (path, false))
return NULL;
if (!info->first_time)
obstack_1grow (info->ob, PATH_SEPARATOR);
obstack_grow (info->ob, path, strlen (path));
info->first_time = false;
return NULL;
}
/* Build a list of search directories from PATHS.
PREFIX is a string to prepend to the list.
If CHECK_DIR_P is true we ensure the directory exists.
If DO_MULTI is true, multilib paths are output first, then
non-multilib paths.
This is used mostly by putenv_from_prefixes so we use `collect_obstack'.
It is also used by the --print-search-dirs flag. */
static char *
build_search_list (const struct path_prefix *paths, const char *prefix,
bool check_dir, bool do_multi)
{
struct add_to_obstack_info info;
info.ob = &collect_obstack;
info.check_dir = check_dir;
info.first_time = true;
obstack_grow (&collect_obstack, prefix, strlen (prefix));
obstack_1grow (&collect_obstack, '=');
for_each_path (paths, do_multi, 0, add_to_obstack, &info);
obstack_1grow (&collect_obstack, '\0');
return XOBFINISH (&collect_obstack, char *);
}
1996-07-04 00:07:53 +02:00
/* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
for collect. */
static void
putenv_from_prefixes (const struct path_prefix *paths, const char *env_var,
bool do_multi)
{
putenv (build_search_list (paths, env_var, true, do_multi));
}
1992-02-01 06:15:32 +01:00
/* Check whether NAME can be accessed in MODE. This is like access,
except that it never considers directories to be executable. */
static int
access_check (const char *name, int mode)
{
if (mode == X_OK)
{
struct stat st;
if (stat (name, &st) < 0
|| S_ISDIR (st.st_mode))
return -1;
}
return access (name, mode);
}
/* Callback for find_a_file. Appends the file name to the directory
path. If the resulting file exists in the right mode, return the
full pathname to the file. */
struct file_at_path_info {
const char *name;
const char *suffix;
int name_len;
int suffix_len;
int mode;
};
static void *
file_at_path (char *path, void *data)
{
struct file_at_path_info *info = data;
size_t len = strlen (path);
memcpy (path + len, info->name, info->name_len);
len += info->name_len;
/* Some systems have a suffix for executable files.
So try appending that first. */
if (info->suffix_len)
{
memcpy (path + len, info->suffix, info->suffix_len + 1);
if (access_check (path, info->mode) == 0)
return path;
}
path[len] = '\0';
if (access_check (path, info->mode) == 0)
return path;
return NULL;
}
1992-02-01 06:15:32 +01:00
/* Search for NAME using the prefix list PREFIXES. MODE is passed to
access to check permissions. If DO_MULTI is true, search multilib
paths then non-multilib paths, otherwise do not search multilib paths.
1996-07-04 00:07:53 +02:00
Return 0 if not found, otherwise return its name, allocated with malloc. */
1992-02-01 06:15:32 +01:00
static char *
find_a_file (const struct path_prefix *pprefix, const char *name, int mode,
bool do_multi)
1992-02-01 06:15:32 +01:00
{
struct file_at_path_info info;
1992-02-01 06:15:32 +01:00
#ifdef DEFAULT_ASSEMBLER
if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0)
c-aux-info.c (concat): Don't define. * c-aux-info.c (concat): Don't define. * cccp.c (my_strerror): Likewise. All callers changed to use xstrerror instead. (do_include): Call xstrdup, not xmalloc/strcpy. (grow_outbuf): Don't check if xrealloc returns NULL, it can't. (xmalloc, xrealloc, xcalloc, xstrdup): Don't define. * collect2.c (my_strsignal): Likewise. All callers changed to use strsignal instead. (locatelib): Call xstrdup, not xmalloc/strcpy. * 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc. * dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy. * i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc. * mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy. * cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero. * dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/... * except.c (new_eh_region_entry): Call xmalloc/xrealloc, not malloc/realloc. (find_all_handler_type_matches): Likewise. Don't check return value. (get_new_handler, init_insn_eh_region, process_nestinfo): Call xmalloc, not malloc. (init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero. * gcc.c (xstrerror, xmalloc, xrealloc): Don't define. (init_spec): Call xcalloc, not xmalloc/bzero. (set_spec): Call xstrdup, not save_string. (record_temp_file): Call xstrdup, not xmalloc/strcpy. (find_a_file): Call xstrdup, not xmalloc/strcpy. (process_command): Call xstrdup, not save_string. (main): Call xcalloc, not xmalloc/bzero. * gcov.c (xmalloc): Don't define. (create_program_flow_graph): Call xcalloc, not xmalloc/bzero. (scan_for_source_files): Call xstrdup, not xmalloc/strcpy. (output_data): Call xcalloc, not xmalloc/bzero. * haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero. * mips-tdump.c (xmalloc): Don't define. (print_symbol): Call xmalloc, not malloc. (read_tfile): Call xcalloc, not calloc. * mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc): Don't define. All callers of xfree/my_strsignal changed to use free/strsignal instead. (allocate_cluster): Call xcalloc, not calloc. * objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/... Fix memory leak, free allocated memory. * prefix.c (translate_name): Call xstrdup, not save_string. (update_path): Likewise. * profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy. * protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2): Don't define. Callers of xfree/savestring2 changed to use free/concat instead. * reload1.c (reload): Call xcalloc, not xmalloc/bzero. (init_elim_table): Likewise. * resource.c (init_resource_info): Likewise. * stupid.c (stupid_life_analysis): Likewise. * toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define. (open_dump_file): Call concat, not xmalloc/strcpy/... (clean_dump_file): Likewise. (compile_file): Call xstrdup, not xmalloc/strcpy. From-SVN: r29148
1999-09-07 04:36:41 +02:00
return xstrdup (DEFAULT_ASSEMBLER);
#endif
#ifdef DEFAULT_LINKER
c-aux-info.c (concat): Don't define. * c-aux-info.c (concat): Don't define. * cccp.c (my_strerror): Likewise. All callers changed to use xstrerror instead. (do_include): Call xstrdup, not xmalloc/strcpy. (grow_outbuf): Don't check if xrealloc returns NULL, it can't. (xmalloc, xrealloc, xcalloc, xstrdup): Don't define. * collect2.c (my_strsignal): Likewise. All callers changed to use strsignal instead. (locatelib): Call xstrdup, not xmalloc/strcpy. * 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc. * dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy. * i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc. * mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy. * cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero. * dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/... * except.c (new_eh_region_entry): Call xmalloc/xrealloc, not malloc/realloc. (find_all_handler_type_matches): Likewise. Don't check return value. (get_new_handler, init_insn_eh_region, process_nestinfo): Call xmalloc, not malloc. (init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero. * gcc.c (xstrerror, xmalloc, xrealloc): Don't define. (init_spec): Call xcalloc, not xmalloc/bzero. (set_spec): Call xstrdup, not save_string. (record_temp_file): Call xstrdup, not xmalloc/strcpy. (find_a_file): Call xstrdup, not xmalloc/strcpy. (process_command): Call xstrdup, not save_string. (main): Call xcalloc, not xmalloc/bzero. * gcov.c (xmalloc): Don't define. (create_program_flow_graph): Call xcalloc, not xmalloc/bzero. (scan_for_source_files): Call xstrdup, not xmalloc/strcpy. (output_data): Call xcalloc, not xmalloc/bzero. * haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero. * mips-tdump.c (xmalloc): Don't define. (print_symbol): Call xmalloc, not malloc. (read_tfile): Call xcalloc, not calloc. * mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc): Don't define. All callers of xfree/my_strsignal changed to use free/strsignal instead. (allocate_cluster): Call xcalloc, not calloc. * objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/... Fix memory leak, free allocated memory. * prefix.c (translate_name): Call xstrdup, not save_string. (update_path): Likewise. * profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy. * protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2): Don't define. Callers of xfree/savestring2 changed to use free/concat instead. * reload1.c (reload): Call xcalloc, not xmalloc/bzero. (init_elim_table): Likewise. * resource.c (init_resource_info): Likewise. * stupid.c (stupid_life_analysis): Likewise. * toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define. (open_dump_file): Call concat, not xmalloc/strcpy/... (clean_dump_file): Likewise. (compile_file): Call xstrdup, not xmalloc/strcpy. From-SVN: r29148
1999-09-07 04:36:41 +02:00
if (! strcmp(name, "ld") && access (DEFAULT_LINKER, mode) == 0)
return xstrdup (DEFAULT_LINKER);
#endif
1992-02-01 06:15:32 +01:00
/* Determine the filename to execute (special case for absolute paths). */
if (IS_ABSOLUTE_PATH (name))
1992-02-01 06:15:32 +01:00
{
if (access (name, mode) == 0)
return xstrdup (name);
return NULL;
}
info.name = name;
info.suffix = (mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "";
info.name_len = strlen (info.name);
info.suffix_len = strlen (info.suffix);
info.mode = mode;
1992-02-01 06:15:32 +01:00
return for_each_path (pprefix, do_multi, info.name_len + info.suffix_len,
file_at_path, &info);
1992-02-01 06:15:32 +01:00
}
/* Ranking of prefixes in the sort list. -B prefixes are put before
all others. */
enum path_prefix_priority
{
PREFIX_PRIORITY_B_OPT,
PREFIX_PRIORITY_LAST
};
/* Add an entry for PREFIX in PLIST. The PLIST is kept in ascending
order according to PRIORITY. Within each PRIORITY, new entries are
appended.
1992-02-01 06:15:32 +01:00
If WARN is nonzero, we will warn if no file is found
through this prefix. WARN should point to an int
1992-07-08 05:40:47 +02:00
which will be set to 1 if this entry is used.
COMPONENT is the value to be passed to update_path.
1992-07-08 05:40:47 +02:00
REQUIRE_MACHINE_SUFFIX is 1 if this prefix can't be used without
the complete value of machine_suffix.
2 means try both machine_suffix and just_machine_suffix. */
1992-02-01 06:15:32 +01:00
static void
add_prefix (struct path_prefix *pprefix, const char *prefix,
const char *component, /* enum prefix_priority */ int priority,
int require_machine_suffix, int os_multilib)
1992-02-01 06:15:32 +01:00
{
struct prefix_list *pl, **prev;
int len;
for (prev = &pprefix->plist;
(*prev) != NULL && (*prev)->priority <= priority;
prev = &(*prev)->next)
;
1992-02-01 06:15:32 +01:00
/* Keep track of the longest prefix. */
1992-02-01 06:15:32 +01:00
prefix = update_path (prefix, component);
1992-02-01 06:15:32 +01:00
len = strlen (prefix);
if (len > pprefix->max_len)
pprefix->max_len = len;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
pl = XNEW (struct prefix_list);
pl->prefix = prefix;
1992-02-01 06:15:32 +01:00
pl->require_machine_suffix = require_machine_suffix;
pl->priority = priority;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
pl->os_multilib = os_multilib;
1992-02-01 06:15:32 +01:00
/* Insert after PREV. */
pl->next = (*prev);
(*prev) = pl;
1992-02-01 06:15:32 +01:00
}
/* Same as add_prefix, but prepending target_system_root to prefix. */
/* The target_system_root prefix has been relocated by gcc_exec_prefix. */
static void
add_sysrooted_prefix (struct path_prefix *pprefix, const char *prefix,
const char *component,
/* enum prefix_priority */ int priority,
int require_machine_suffix, int os_multilib)
{
if (!IS_ABSOLUTE_PATH (prefix))
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("system path '%s' is not absolute", prefix);
if (target_system_root)
{
if (target_sysroot_suffix)
prefix = concat (target_sysroot_suffix, prefix, NULL);
prefix = concat (target_system_root, prefix, NULL);
/* We have to override this because GCC's notion of sysroot
moves along with GCC. */
component = "GCC";
}
add_prefix (pprefix, prefix, component, priority,
require_machine_suffix, os_multilib);
}
1992-02-01 06:15:32 +01:00
/* Execute the command specified by the arguments on the current line of spec.
When using pipes, this includes several piped-together commands
with `|' between them.
Return 0 if successful, -1 if failed. */
static int
execute (void)
1992-02-01 06:15:32 +01:00
{
int i;
int n_commands; /* # of command. */
char *string;
struct pex_obj *pex;
1992-02-01 06:15:32 +01:00
struct command
{
const char *prog; /* program name. */
const char **argv; /* vector of args. */
};
1992-02-01 06:15:32 +01:00
struct command *commands; /* each command buffer with above info. */
gcc_assert (!processing_spec_function);
1992-02-01 06:15:32 +01:00
/* Count # of piped commands. */
for (n_commands = 1, i = 0; i < argbuf_index; i++)
if (strcmp (argbuf[i], "|") == 0)
n_commands++;
/* Get storage for each command. */
commands = alloca (n_commands * sizeof (struct command));
1992-02-01 06:15:32 +01:00
/* Split argbuf into its separate piped processes,
and record info about each one.
Also search for the programs that are to be run. */
commands[0].prog = argbuf[0]; /* first command. */
commands[0].argv = &argbuf[0];
string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, false);
1992-02-01 06:15:32 +01:00
if (string)
commands[0].argv[0] = string;
for (n_commands = 1, i = 0; i < argbuf_index; i++)
if (strcmp (argbuf[i], "|") == 0)
{ /* each command. */
#if defined (__MSDOS__) || defined (OS2) || defined (VMS)
fatal ("-pipe not supported");
1992-02-01 06:15:32 +01:00
#endif
argbuf[i] = 0; /* termination of command args. */
commands[n_commands].prog = argbuf[i + 1];
commands[n_commands].argv = &argbuf[i + 1];
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
string = find_a_file (&exec_prefixes, commands[n_commands].prog,
X_OK, false);
1992-02-01 06:15:32 +01:00
if (string)
commands[n_commands].argv[0] = string;
n_commands++;
}
argbuf[argbuf_index] = 0;
/* If -v, print what we are about to do, and maybe query. */
if (verbose_flag)
1992-02-01 06:15:32 +01:00
{
1998-07-13 19:20:29 +02:00
/* For help listings, put a blank line between sub-processes. */
if (print_help_list)
fputc ('\n', stderr);
1992-02-01 06:15:32 +01:00
/* Print each piped command as a separate line. */
for (i = 0; i < n_commands; i++)
1992-02-01 06:15:32 +01:00
{
const char *const *j;
1992-02-01 06:15:32 +01:00
if (verbose_only_flag)
{
for (j = commands[i].argv; *j; j++)
{
const char *p;
fprintf (stderr, " \"");
for (p = *j; *p; ++p)
{
if (*p == '"' || *p == '\\' || *p == '$')
fputc ('\\', stderr);
fputc (*p, stderr);
}
fputc ('"', stderr);
}
}
else
for (j = commands[i].argv; *j; j++)
fprintf (stderr, " %s", *j);
1992-02-01 06:15:32 +01:00
/* Print a pipe symbol after all but the last command. */
if (i + 1 != n_commands)
fprintf (stderr, " |");
fprintf (stderr, "\n");
}
fflush (stderr);
if (verbose_only_flag != 0)
{
/* verbose_only_flag should act as if the spec was
executed, so increment execution_count before
returning. This prevents spurious warnings about
unused linker input files, etc. */
execution_count++;
return 0;
}
1992-02-01 06:15:32 +01:00
#ifdef DEBUG
notice ("\nGo ahead? (y or n) ");
1992-02-01 06:15:32 +01:00
fflush (stderr);
i = getchar ();
if (i != '\n')
while (getchar () != '\n')
;
1992-02-01 06:15:32 +01:00
if (i != 'y' && i != 'Y')
return 0;
#endif /* DEBUG */
}
#ifdef ENABLE_VALGRIND_CHECKING
/* Run the each command through valgrind. To simplify prepending the
path to valgrind and the option "-q" (for quiet operation unless
something triggers), we allocate a separate argv array. */
for (i = 0; i < n_commands; i++)
{
const char **argv;
int argc;
int j;
for (argc = 0; commands[i].argv[argc] != NULL; argc++)
;
argv = alloca ((argc + 3) * sizeof (char *));
argv[0] = VALGRIND_PATH;
argv[1] = "-q";
for (j = 2; j < argc + 2; j++)
argv[j] = commands[i].argv[j - 2];
argv[j] = NULL;
commands[i].argv = argv;
commands[i].prog = argv[0];
}
#endif
1992-02-01 06:15:32 +01:00
/* Run each piped subprocess. */
pex = pex_init (PEX_USE_PIPES | (report_times ? PEX_RECORD_TIMES : 0),
programname, temp_filename);
if (pex == NULL)
pfatal_with_name (_("pex_init failed"));
1992-02-01 06:15:32 +01:00
for (i = 0; i < n_commands; i++)
{
const char *errmsg;
int err;
const char *string = commands[i].argv[0];
1992-02-01 06:15:32 +01:00
errmsg = pex_run (pex,
((i + 1 == n_commands ? PEX_LAST : 0)
| (string == commands[i].prog ? PEX_SEARCH : 0)),
string, (char * const *) commands[i].argv,
NULL, NULL, &err);
if (errmsg != NULL)
{
if (err == 0)
fatal (errmsg);
else
{
errno = err;
pfatal_with_name (errmsg);
}
}
1992-02-01 06:15:32 +01:00
if (string != commands[i].prog)
free ((void *) string);
1992-02-01 06:15:32 +01:00
}
execution_count++;
/* Wait for all the subprocesses to finish. */
1992-02-01 06:15:32 +01:00
{
int *statuses;
struct pex_time *times = NULL;
1992-02-01 06:15:32 +01:00
int ret_code = 0;
statuses = alloca (n_commands * sizeof (int));
if (!pex_get_status (pex, n_commands, statuses))
pfatal_with_name (_("failed to get exit status"));
if (report_times)
1992-02-01 06:15:32 +01:00
{
times = alloca (n_commands * sizeof (struct pex_time));
if (!pex_get_times (pex, n_commands, times))
pfatal_with_name (_("failed to get process times"));
}
1992-02-01 06:15:32 +01:00
pex_free (pex);
1992-02-01 06:15:32 +01:00
for (i = 0; i < n_commands; ++i)
{
int status = statuses[i];
if (WIFSIGNALED (status))
{
#ifdef SIGPIPE
/* SIGPIPE is a special case. It happens in -pipe mode
when the compiler dies before the preprocessor is done,
or the assembler dies before the compiler is done.
There's generally been an error already, and this is
just fallout. So don't generate another error unless
we would otherwise have succeeded. */
if (WTERMSIG (status) == SIGPIPE
&& (signal_count || greatest_status >= MIN_FATAL_STATUS))
{
signal_count++;
ret_code = -1;
}
else
#endif
fatal_ice ("\
Internal error: %s (program %s)\n\
Please submit a full bug report.\n\
See %s for instructions.",
strsignal (WTERMSIG (status)), commands[i].prog,
bug_report_url);
}
else if (WIFEXITED (status)
&& WEXITSTATUS (status) >= MIN_FATAL_STATUS)
{
if (WEXITSTATUS (status) > greatest_status)
greatest_status = WEXITSTATUS (status);
ret_code = -1;
}
if (report_times)
{
struct pex_time *pt = &times[i];
double ut, st;
ut = ((double) pt->user_seconds
+ (double) pt->user_microseconds / 1.0e6);
st = ((double) pt->system_seconds
+ (double) pt->system_microseconds / 1.0e6);
if (ut + st != 0)
notice ("# %s %.2f %.2f\n", commands[i].prog, ut, st);
}
1992-02-01 06:15:32 +01:00
}
1992-02-01 06:15:32 +01:00
return ret_code;
}
}
/* Find all the switches given to us
and make a vector describing them.
The elements of the vector are strings, one per switch given.
If a switch uses following arguments, then the `part1' field
is the switch itself and the `args' field
is a null-terminated vector containing the following arguments.
The `live_cond' field is:
0 when initialized
1 if the switch is true in a conditional spec,
-1 if false (overridden by a later switch)
-2 if this switch should be ignored (used in %<S)
The `validated' field is nonzero if any spec has looked at this switch;
1992-02-01 06:15:32 +01:00
if it remains zero at the end of the run, it must be meaningless. */
#define SWITCH_OK 0
#define SWITCH_FALSE -1
#define SWITCH_IGNORE -2
#define SWITCH_LIVE 1
1992-02-01 06:15:32 +01:00
struct switchstr
{
const char *part1;
const char **args;
int live_cond;
unsigned char validated;
unsigned char ordering;
1992-02-01 06:15:32 +01:00
};
static struct switchstr *switches;
static int n_switches;
/* Language is one of three things:
1) The name of a real programming language.
2) NULL, indicating that no one has figured out
what it is yet.
3) '*', indicating that the file should be passed
to the linker. */
1992-02-01 06:15:32 +01:00
struct infile
{
const char *name;
const char *language;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
struct compiler *incompiler;
bool compiled;
bool preprocessed;
1992-02-01 06:15:32 +01:00
};
/* Also a vector of input files specified. */
static struct infile *infiles;
int n_infiles;
1992-02-01 06:15:32 +01:00
Index: ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * c-decl.c (finish_decl): Handle 'used' here... * cgraphunit.c (cgraph_finalize_function): ... and here ... * c-common.c: (handle_used_attribute): ... not here. * configure.in (onstep): Support --enable-intermodule. * Makefile.in (OBJS-common): New. (OBJS-md): New. (OBJS-archive): New. (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive. (OBJS-onestep): New. (libbackend.a): Support @onestep@. (libbackend.o): New. * configure: Regenerate. * c-common.h (c_reset_state): New prototype. (c_parse_file): New prototype. (finish_file): Move prototype from c-tree.h. * c-decl.c: Include <hashtab.h>. (builtin_decls): New. (current_file_decl): New. (duplicate_decls): Add extra parameter. Change all callers. Don't output duplicate common symbols. (link_hash_hash): New. (link_hash_eq): New. (poplevel): Handle popping of the top level. (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL. (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate. (pushdecl_top_level): Likewise. (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL. (c_init_decl_processing): Create TRANSLATION_UNIT_DECL. (finish_decl): Handle TRANSLATION_UNIT_DECL. (merge_translation_unit_decls): New. (c_write_global_declarations): New. (c_reset_state): New. (implicitly_declare): Handle TRANSLATION_UNIT_DECL. * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New. * c-objc-common.c (c_cannot_inline_tree_fn): Handle TRANSLATION_UNIT_DECL. (c_objc_common_finish_file): Call merge_translation_unit_decls. * c-opts.c (in_fnames): Rename from in_fname. (c_common_decode_option): Handle multiple input filenames. (c_common_post_options): Likewise. (c_common_parse_file): Likewise; also, call c_parse_file rather than yyparse. * c-parse.in: Move cleanup code to c_parse_file. (free_parser_stacks): Move contents to c_parse_file. (c_parse_file): New. * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT for integer types. (C_DECL_FILE_SCOPE): New. (finish_file): Move prototype to c-common.h. (merge_translation_unit_decls): New prototype. (comptypes): Add extra parameter to prototype. (c_write_global_declarations): New prototype. * c-typeck.c (tagged_types_tu_compatible_p): New. (function_types_compatible_p): Add extra parameter, change all callers. (type_lists_compatible_p): Likewise. (comptypes): Likewise. (struct tagged_tu_seen): New. (tagged_tu_seen_base): New. (build_unary_op): Handle TRANSLATION_UNIT_DECL. (c_mark_addressable): Remove #if 0 code. * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add comment explaining why it shouldn't have to. * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY options. * cppinit.c (cpp_read_next_file): New. (cpp_read_main_file): Use it. * cpplib.c (undefine_macros): New. (cpp_undef_all): New. * cpplib.h (cpp_read_next_file): Prototype. (cpp_undef_all): Prototype. * langhooks-def.h (write_global_declarations): Remove prototype. * toplev.h (write_global_declarations): Add prototype. * tree.c (decl_type_context): Use switch statement, handle TRANSLATION_UNIT_DECL. * tree.def: Update documentation for TRANSLATION_UNIT_DECL. (TRANSLATION_UNIT_DECL): New kind of tree. * tree.h: Update documentation for TRANSLATION_UNIT_DECL. * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies. * doc/invoke.texi: Make attempt to document new functionality. 2003-05-19 Per Bothner <bothner@apple.com> * gcc.c (combine_inputs): New. (process_command): Set combine_inputs. (do_spec_1): Handle combine_inputs. (main): Likewise. Index: cp/ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * decl.c (cp_finish_decl): Handle 'used' attribute. * cp-lang.c (c_reset_state): New dummy routine. * cp-tree.h (finish_file): Move prototype to c-common.h. * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. From-SVN: r69224
2003-07-11 10:33:21 +02:00
/* True if multiple input files are being compiled to a single
assembly file. */
static bool combine_inputs;
/* This counts the number of libraries added by lang_specific_driver, so that
we can tell if there were any user supplied any files or libraries. */
static int added_libraries;
1992-02-01 06:15:32 +01:00
/* And a vector of corresponding output files is made up later. */
const char **outfiles;
#if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
/* Convert NAME to a new name if it is the standard suffix. DO_EXE
is true if we should look for an executable suffix. DO_OBJ
is true if we should look for an object suffix. */
static const char *
convert_filename (const char *name, int do_exe ATTRIBUTE_UNUSED,
int do_obj ATTRIBUTE_UNUSED)
{
#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
int i;
#endif
int len;
if (name == NULL)
return NULL;
len = strlen (name);
#ifdef HAVE_TARGET_OBJECT_SUFFIX
/* Convert x.o to x.obj if TARGET_OBJECT_SUFFIX is ".obj". */
if (do_obj && len > 2
&& name[len - 2] == '.'
&& name[len - 1] == 'o')
{
obstack_grow (&obstack, name, len - 2);
obstack_grow0 (&obstack, TARGET_OBJECT_SUFFIX, strlen (TARGET_OBJECT_SUFFIX));
name = XOBFINISH (&obstack, const char *);
}
#endif
#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
/* If there is no filetype, make it the executable suffix (which includes
the "."). But don't get confused if we have just "-o". */
if (! do_exe || TARGET_EXECUTABLE_SUFFIX[0] == 0 || (len == 2 && name[0] == '-'))
return name;
for (i = len - 1; i >= 0; i--)
if (IS_DIR_SEPARATOR (name[i]))
break;
for (i++; i < len; i++)
if (name[i] == '.')
return name;
obstack_grow (&obstack, name, len);
obstack_grow0 (&obstack, TARGET_EXECUTABLE_SUFFIX,
strlen (TARGET_EXECUTABLE_SUFFIX));
name = XOBFINISH (&obstack, const char *);
#endif
return name;
}
#endif
1998-07-13 19:20:29 +02:00
/* Display the command line switches accepted by gcc. */
static void
display_help (void)
1998-07-13 19:20:29 +02:00
{
printf (_("Usage: %s [options] file...\n"), programname);
fputs (_("Options:\n"), stdout);
1998-07-13 19:20:29 +02:00
fputs (_(" -pass-exit-codes Exit with highest error code from a phase\n"), stdout);
fputs (_(" --help Display this information\n"), stdout);
fputs (_(" --target-help Display target specific command line options\n"), stdout);
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
fputs (_(" --help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]\n"), stdout);
fputs (_(" Display specific types of command line options\n"), stdout);
1998-07-13 19:20:29 +02:00
if (! verbose_flag)
fputs (_(" (Use '-v --help' to display command line options of sub-processes)\n"), stdout);
fputs (_(" -dumpspecs Display all of the built in spec strings\n"), stdout);
fputs (_(" -dumpversion Display the version of the compiler\n"), stdout);
fputs (_(" -dumpmachine Display the compiler's target processor\n"), stdout);
fputs (_(" -print-search-dirs Display the directories in the compiler's search path\n"), stdout);
fputs (_(" -print-libgcc-file-name Display the name of the compiler's companion library\n"), stdout);
fputs (_(" -print-file-name=<lib> Display the full path to library <lib>\n"), stdout);
fputs (_(" -print-prog-name=<prog> Display the full path to compiler component <prog>\n"), stdout);
fputs (_(" -print-multi-directory Display the root directory for versions of libgcc\n"), stdout);
fputs (_("\
-print-multi-lib Display the mapping between command line options and\n\
multiple library search directories\n"), stdout);
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
fputs (_(" -print-multi-os-directory Display the relative path to OS libraries\n"), stdout);
re PR bootstrap/31020 (cannot write in </test/gnu/gcc/objdir/prev-gcc/../gcc/./include>) fixincludes: * mkheaders.in: Fix headers for each multilib required. gcc: PR bootstrap/31020 * configure.ac (CROSS_SYSTEM_HEADER_DIR, build_system_header_dir): Define using $${sysroot_headers_suffix}. * configure: Regenerate. * cppdefault.c (cpp_include_defaults): Make FIXED_INCLUDE_DIR a multilib-suffixed directory if SYSROOT_HEADERS_SUFFIX_SPEC defined. * doc/invoke.texi (-print-sysroot-headers-suffix): Document. * gcc.c (print_sysroot_headers_suffix): New. (option_map): Include --print-sysroot-headers-suffix. (display_help): Mention -print-sysroot-headers-suffix. (process_command): Handle -print-sysroot-headers-suffix. (do_spec_1): Append multilib directory to include-fixed path if sysroot suffixes in use. (main): Handle -print-sysroot-headers-suffix. * Makefile.in (start.encap): Don't depend on xlimits.h (xlimits.h): Remove. (stmp-int-hdrs): Don't depend on xlimits.h. Inline generation of limits.h for each multilib in fixinc_list. (fixinc_list, s-fixinc_list): New. (stmp-fixinc): Depend on fixinc_list. If not copying headers, generate them for each multilib in fixinc_list. (stmp-fixproto): Use include-fixed. Run fixproto for each multilib in fixinc_list. (mostlyclean): Don't remove xlimits.h. (clean): Remove include-fixed. (real-install-headers-tar, real-install-headers-cpio, real-install-headers-cp): Don't copy include, only include-fixed. (install-mkheaders): Depend on fixinc_list. Don't depend on xlimits.h. Save limits.h files for each multilib in fixinc_list. Always save mkinstalldirs. Preserve ${sysroot_headers_suffix} in SYSTEM_HEADER_DIR setting in mkheaders.conf. From-SVN: r122620
2007-03-06 16:50:28 +01:00
fputs (_(" -print-sysroot-headers-suffix Display the sysroot suffix used to find headers\n"), stdout);
fputs (_(" -Wa,<options> Pass comma-separated <options> on to the assembler\n"), stdout);
fputs (_(" -Wp,<options> Pass comma-separated <options> on to the preprocessor\n"), stdout);
fputs (_(" -Wl,<options> Pass comma-separated <options> on to the linker\n"), stdout);
fputs (_(" -Xassembler <arg> Pass <arg> on to the assembler\n"), stdout);
fputs (_(" -Xpreprocessor <arg> Pass <arg> on to the preprocessor\n"), stdout);
fputs (_(" -Xlinker <arg> Pass <arg> on to the linker\n"), stdout);
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
fputs (_(" -combine Pass multiple source files to compiler at once\n"), stdout);
fputs (_(" -save-temps Do not delete intermediate files\n"), stdout);
fputs (_(" -pipe Use pipes rather than intermediate files\n"), stdout);
fputs (_(" -time Time the execution of each subprocess\n"), stdout);
fputs (_(" -specs=<file> Override built-in specs with the contents of <file>\n"), stdout);
fputs (_(" -std=<standard> Assume that the input sources are for <standard>\n"), stdout);
fputs (_("\
--sysroot=<directory> Use <directory> as the root directory for headers\n\
and libraries\n"), stdout);
fputs (_(" -B <directory> Add <directory> to the compiler's search paths\n"), stdout);
fputs (_(" -b <machine> Run gcc for target <machine>, if installed\n"), stdout);
fputs (_(" -V <version> Run gcc version number <version>, if installed\n"), stdout);
fputs (_(" -v Display the programs invoked by the compiler\n"), stdout);
fputs (_(" -### Like -v but options quoted and commands not executed\n"), stdout);
fputs (_(" -E Preprocess only; do not compile, assemble or link\n"), stdout);
fputs (_(" -S Compile only; do not assemble or link\n"), stdout);
fputs (_(" -c Compile and assemble, but do not link\n"), stdout);
fputs (_(" -o <file> Place the output into <file>\n"), stdout);
fputs (_("\
-x <language> Specify the language of the following input files\n\
Permissible languages include: c c++ assembler none\n\
'none' means revert to the default behavior of\n\
guessing the language based on the file's extension\n\
"), stdout);
printf (_("\
\nOptions starting with -g, -f, -m, -O, -W, or --param are automatically\n\
passed on to the various sub-processes invoked by %s. In order to pass\n\
other options on to these processes the -W<letter> options must be used.\n\
"), programname);
1998-07-13 19:20:29 +02:00
/* The rest of the options are displayed by invocations of the various
sub-processes. */
}
static void
add_preprocessor_option (const char *option, int len)
{
n_preprocessor_options++;
if (! preprocessor_options)
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
preprocessor_options = XNEWVEC (char *, n_preprocessor_options);
else
preprocessor_options = xrealloc (preprocessor_options,
n_preprocessor_options * sizeof (char *));
preprocessor_options [n_preprocessor_options - 1] =
save_string (option, len);
}
static void
add_assembler_option (const char *option, int len)
{
n_assembler_options++;
if (! assembler_options)
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
assembler_options = XNEWVEC (char *, n_assembler_options);
else
assembler_options = xrealloc (assembler_options,
n_assembler_options * sizeof (char *));
assembler_options [n_assembler_options - 1] = save_string (option, len);
1998-07-13 19:20:29 +02:00
}
static void
add_linker_option (const char *option, int len)
{
n_linker_options++;
if (! linker_options)
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
linker_options = XNEWVEC (char *, n_linker_options);
else
linker_options = xrealloc (linker_options,
n_linker_options * sizeof (char *));
linker_options [n_linker_options - 1] = save_string (option, len);
}
1992-02-01 06:15:32 +01:00
/* Create the vector `switches' and its contents.
Store its length in `n_switches'. */
static void
process_command (int argc, const char **argv)
1992-02-01 06:15:32 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
int i;
const char *temp;
char *temp1;
const char *spec_lang = 0;
1992-02-01 06:15:32 +01:00
int last_language_n_infiles;
int lang_n_infiles = 0;
#ifdef MODIFY_TARGET_NAME
int is_modify_target_name;
unsigned int j;
#endif
const char *tooldir_prefix;
1992-02-01 06:15:32 +01:00
GET_ENVIRONMENT (gcc_exec_prefix, "GCC_EXEC_PREFIX");
1992-02-01 06:15:32 +01:00
n_switches = 0;
n_infiles = 0;
added_libraries = 0;
/* Figure compiler version from version string. */
compiler_version = temp1 = xstrdup (version_string);
c-aux-info.c (concat): Don't define. * c-aux-info.c (concat): Don't define. * cccp.c (my_strerror): Likewise. All callers changed to use xstrerror instead. (do_include): Call xstrdup, not xmalloc/strcpy. (grow_outbuf): Don't check if xrealloc returns NULL, it can't. (xmalloc, xrealloc, xcalloc, xstrdup): Don't define. * collect2.c (my_strsignal): Likewise. All callers changed to use strsignal instead. (locatelib): Call xstrdup, not xmalloc/strcpy. * 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc. * dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy. * i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc. * mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy. * cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero. * dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/... * except.c (new_eh_region_entry): Call xmalloc/xrealloc, not malloc/realloc. (find_all_handler_type_matches): Likewise. Don't check return value. (get_new_handler, init_insn_eh_region, process_nestinfo): Call xmalloc, not malloc. (init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero. * gcc.c (xstrerror, xmalloc, xrealloc): Don't define. (init_spec): Call xcalloc, not xmalloc/bzero. (set_spec): Call xstrdup, not save_string. (record_temp_file): Call xstrdup, not xmalloc/strcpy. (find_a_file): Call xstrdup, not xmalloc/strcpy. (process_command): Call xstrdup, not save_string. (main): Call xcalloc, not xmalloc/bzero. * gcov.c (xmalloc): Don't define. (create_program_flow_graph): Call xcalloc, not xmalloc/bzero. (scan_for_source_files): Call xstrdup, not xmalloc/strcpy. (output_data): Call xcalloc, not xmalloc/bzero. * haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero. * mips-tdump.c (xmalloc): Don't define. (print_symbol): Call xmalloc, not malloc. (read_tfile): Call xcalloc, not calloc. * mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc): Don't define. All callers of xfree/my_strsignal changed to use free/strsignal instead. (allocate_cluster): Call xcalloc, not calloc. * objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/... Fix memory leak, free allocated memory. * prefix.c (translate_name): Call xstrdup, not save_string. (update_path): Likewise. * profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy. * protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2): Don't define. Callers of xfree/savestring2 changed to use free/concat instead. * reload1.c (reload): Call xcalloc, not xmalloc/bzero. (init_elim_table): Likewise. * resource.c (init_resource_info): Likewise. * stupid.c (stupid_life_analysis): Likewise. * toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define. (open_dump_file): Call concat, not xmalloc/strcpy/... (clean_dump_file): Likewise. (compile_file): Call xstrdup, not xmalloc/strcpy. From-SVN: r29148
1999-09-07 04:36:41 +02:00
for (; *temp1; ++temp1)
{
if (*temp1 == ' ')
{
*temp1 = '\0';
break;
}
}
1992-02-01 06:15:32 +01:00
/* If there is a -V or -b option (or both), process it now, before
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
trying to interpret the rest of the command line.
Use heuristic that all configuration names must have at least
one dash '-'. This allows us to pass options starting with -b. */
if (argc > 1 && argv[1][0] == '-'
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
&& (argv[1][1] == 'V' ||
((argv[1][1] == 'b') && (NULL != strchr(argv[1] + 2,'-')))))
{
const char *new_version = DEFAULT_TARGET_VERSION;
const char *new_machine = DEFAULT_TARGET_MACHINE;
const char *progname = argv[0];
char **new_argv;
char *new_argv0;
int baselen;
while (argc > 1 && argv[1][0] == '-'
&& (argv[1][1] == 'V' ||
((argv[1][1] == 'b') && ( NULL != strchr(argv[1] + 2,'-')))))
{
char opt = argv[1][1];
const char *arg;
if (argv[1][2] != '\0')
{
arg = argv[1] + 2;
argc -= 1;
argv += 1;
}
else if (argc > 2)
{
arg = argv[2];
argc -= 2;
argv += 2;
}
else
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("'-%c' option must have argument", opt);
if (opt == 'V')
new_version = arg;
else
new_machine = arg;
}
for (baselen = strlen (progname); baselen > 0; baselen--)
if (IS_DIR_SEPARATOR (progname[baselen-1]))
break;
new_argv0 = xmemdup (progname, baselen,
baselen + concat_length (new_version, new_machine,
"-gcc-", NULL) + 1);
strcpy (new_argv0 + baselen, new_machine);
strcat (new_argv0, "-gcc-");
strcat (new_argv0, new_version);
new_argv = xmemdup (argv, (argc + 1) * sizeof (argv[0]),
(argc + 1) * sizeof (argv[0]));
new_argv[0] = new_argv0;
execvp (new_argv0, new_argv);
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("couldn't run '%s': %s", new_argv0, xstrerror (errno));
}
[multiple changes] Tue Nov 9 10:30:08 1999 Tom Tromey <tromey@cygnus.com> * config/i386/xm-djgpp.h (HAVE_DOS_BASED_FILE_SYSTEM): Renamed from HAVE_DOS_BASED_FILESYSTEM. * gcc.c (find_a_file): Use HAVE_DOS_BASED_FILE_SYSTEM, not HAVE_DOS_BASED_FILESYSTEM. (main): Likewise. (split_directories): Only special-case DOS file names if HAVE_DOS_BASED_FILE_SYSTEM is defined. Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (make_relative_prefix): Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (process_command): Only use make_relative_prefix if !VMS. (free_split_directories): Conditionalize on !VMS. (DIR_UP): Conditionalize on !VMS. Wed Jun 9 16:57:11 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (STANDARD_BINDIR_PREFIX): Provide default. Fri Feb 5 14:22:01 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (make_relative_prefix): Handle the HAVE_EXECUTABLE_SUFFIX case. Mon Nov 8 14:16:57 1999 Michael Meissner <meissner@cygnus.com> * invoke.texi (Environment Variables): Document relative path lookup. * gcc.c (DIR_UP): If not defined, define as "..". (standard_bindir_prefix): New static, holds target location to install binaries. (split_directories): New function to split a filename into component directories. (free_split_directories): New function, release memory allocated by split_directories. (make_relative_prefix): New function, make a relative pathname if the compiler is not in the expected location. (process_command): If GCC_EXEC_PREFIX was not specified, see if we can figure out an appropriate prefix from argv[0]. * Makefile.in (DRIVER_DEFINES): Use unlibsubdir in definition of STANDARD_STARTFILE_PREFIX and TOOLDIR_BASE_PREFIX. Define STANDARD_BINDIR_PREFIX. From-SVN: r30464
1999-11-10 02:19:08 +01:00
/* Set up the default search paths. If there is no GCC_EXEC_PREFIX,
see if we can create it from the pathname specified in argv[0]. */
gcc_libexec_prefix = standard_libexec_prefix;
[multiple changes] Tue Nov 9 10:30:08 1999 Tom Tromey <tromey@cygnus.com> * config/i386/xm-djgpp.h (HAVE_DOS_BASED_FILE_SYSTEM): Renamed from HAVE_DOS_BASED_FILESYSTEM. * gcc.c (find_a_file): Use HAVE_DOS_BASED_FILE_SYSTEM, not HAVE_DOS_BASED_FILESYSTEM. (main): Likewise. (split_directories): Only special-case DOS file names if HAVE_DOS_BASED_FILE_SYSTEM is defined. Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (make_relative_prefix): Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (process_command): Only use make_relative_prefix if !VMS. (free_split_directories): Conditionalize on !VMS. (DIR_UP): Conditionalize on !VMS. Wed Jun 9 16:57:11 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (STANDARD_BINDIR_PREFIX): Provide default. Fri Feb 5 14:22:01 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (make_relative_prefix): Handle the HAVE_EXECUTABLE_SUFFIX case. Mon Nov 8 14:16:57 1999 Michael Meissner <meissner@cygnus.com> * invoke.texi (Environment Variables): Document relative path lookup. * gcc.c (DIR_UP): If not defined, define as "..". (standard_bindir_prefix): New static, holds target location to install binaries. (split_directories): New function to split a filename into component directories. (free_split_directories): New function, release memory allocated by split_directories. (make_relative_prefix): New function, make a relative pathname if the compiler is not in the expected location. (process_command): If GCC_EXEC_PREFIX was not specified, see if we can figure out an appropriate prefix from argv[0]. * Makefile.in (DRIVER_DEFINES): Use unlibsubdir in definition of STANDARD_STARTFILE_PREFIX and TOOLDIR_BASE_PREFIX. Define STANDARD_BINDIR_PREFIX. From-SVN: r30464
1999-11-10 02:19:08 +01:00
#ifndef VMS
/* FIXME: make_relative_prefix doesn't yet work for VMS. */
if (!gcc_exec_prefix)
{
gcc_exec_prefix = make_relative_prefix (argv[0], standard_bindir_prefix,
standard_exec_prefix);
gcc_libexec_prefix = make_relative_prefix (argv[0],
standard_bindir_prefix,
standard_libexec_prefix);
[multiple changes] Tue Nov 9 10:30:08 1999 Tom Tromey <tromey@cygnus.com> * config/i386/xm-djgpp.h (HAVE_DOS_BASED_FILE_SYSTEM): Renamed from HAVE_DOS_BASED_FILESYSTEM. * gcc.c (find_a_file): Use HAVE_DOS_BASED_FILE_SYSTEM, not HAVE_DOS_BASED_FILESYSTEM. (main): Likewise. (split_directories): Only special-case DOS file names if HAVE_DOS_BASED_FILE_SYSTEM is defined. Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (make_relative_prefix): Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (process_command): Only use make_relative_prefix if !VMS. (free_split_directories): Conditionalize on !VMS. (DIR_UP): Conditionalize on !VMS. Wed Jun 9 16:57:11 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (STANDARD_BINDIR_PREFIX): Provide default. Fri Feb 5 14:22:01 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (make_relative_prefix): Handle the HAVE_EXECUTABLE_SUFFIX case. Mon Nov 8 14:16:57 1999 Michael Meissner <meissner@cygnus.com> * invoke.texi (Environment Variables): Document relative path lookup. * gcc.c (DIR_UP): If not defined, define as "..". (standard_bindir_prefix): New static, holds target location to install binaries. (split_directories): New function to split a filename into component directories. (free_split_directories): New function, release memory allocated by split_directories. (make_relative_prefix): New function, make a relative pathname if the compiler is not in the expected location. (process_command): If GCC_EXEC_PREFIX was not specified, see if we can figure out an appropriate prefix from argv[0]. * Makefile.in (DRIVER_DEFINES): Use unlibsubdir in definition of STANDARD_STARTFILE_PREFIX and TOOLDIR_BASE_PREFIX. Define STANDARD_BINDIR_PREFIX. From-SVN: r30464
1999-11-10 02:19:08 +01:00
if (gcc_exec_prefix)
putenv (concat ("GCC_EXEC_PREFIX=", gcc_exec_prefix, NULL));
[multiple changes] Tue Nov 9 10:30:08 1999 Tom Tromey <tromey@cygnus.com> * config/i386/xm-djgpp.h (HAVE_DOS_BASED_FILE_SYSTEM): Renamed from HAVE_DOS_BASED_FILESYSTEM. * gcc.c (find_a_file): Use HAVE_DOS_BASED_FILE_SYSTEM, not HAVE_DOS_BASED_FILESYSTEM. (main): Likewise. (split_directories): Only special-case DOS file names if HAVE_DOS_BASED_FILE_SYSTEM is defined. Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (make_relative_prefix): Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (process_command): Only use make_relative_prefix if !VMS. (free_split_directories): Conditionalize on !VMS. (DIR_UP): Conditionalize on !VMS. Wed Jun 9 16:57:11 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (STANDARD_BINDIR_PREFIX): Provide default. Fri Feb 5 14:22:01 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (make_relative_prefix): Handle the HAVE_EXECUTABLE_SUFFIX case. Mon Nov 8 14:16:57 1999 Michael Meissner <meissner@cygnus.com> * invoke.texi (Environment Variables): Document relative path lookup. * gcc.c (DIR_UP): If not defined, define as "..". (standard_bindir_prefix): New static, holds target location to install binaries. (split_directories): New function to split a filename into component directories. (free_split_directories): New function, release memory allocated by split_directories. (make_relative_prefix): New function, make a relative pathname if the compiler is not in the expected location. (process_command): If GCC_EXEC_PREFIX was not specified, see if we can figure out an appropriate prefix from argv[0]. * Makefile.in (DRIVER_DEFINES): Use unlibsubdir in definition of STANDARD_STARTFILE_PREFIX and TOOLDIR_BASE_PREFIX. Define STANDARD_BINDIR_PREFIX. From-SVN: r30464
1999-11-10 02:19:08 +01:00
}
else
{
/* make_relative_prefix requires a program name, but
GCC_EXEC_PREFIX is typically a directory name with a trailing
/ (which is ignored by make_relative_prefix), so append a
program name. */
char *tmp_prefix = concat (gcc_exec_prefix, "gcc", NULL);
gcc_libexec_prefix = make_relative_prefix (tmp_prefix,
standard_exec_prefix,
standard_libexec_prefix);
/* The path is unrelocated, so fallback to the original setting. */
if (!gcc_libexec_prefix)
gcc_libexec_prefix = standard_libexec_prefix;
free (tmp_prefix);
}
#else
[multiple changes] Tue Nov 9 10:30:08 1999 Tom Tromey <tromey@cygnus.com> * config/i386/xm-djgpp.h (HAVE_DOS_BASED_FILE_SYSTEM): Renamed from HAVE_DOS_BASED_FILESYSTEM. * gcc.c (find_a_file): Use HAVE_DOS_BASED_FILE_SYSTEM, not HAVE_DOS_BASED_FILESYSTEM. (main): Likewise. (split_directories): Only special-case DOS file names if HAVE_DOS_BASED_FILE_SYSTEM is defined. Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (make_relative_prefix): Use IS_DIR_SEPARATOR instead of explicit tests. Conditionalize on !VMS. (process_command): Only use make_relative_prefix if !VMS. (free_split_directories): Conditionalize on !VMS. (DIR_UP): Conditionalize on !VMS. Wed Jun 9 16:57:11 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (STANDARD_BINDIR_PREFIX): Provide default. Fri Feb 5 14:22:01 1999 Mumit Khan <khan@xraylith.wisc.edu> * gcc.c (make_relative_prefix): Handle the HAVE_EXECUTABLE_SUFFIX case. Mon Nov 8 14:16:57 1999 Michael Meissner <meissner@cygnus.com> * invoke.texi (Environment Variables): Document relative path lookup. * gcc.c (DIR_UP): If not defined, define as "..". (standard_bindir_prefix): New static, holds target location to install binaries. (split_directories): New function to split a filename into component directories. (free_split_directories): New function, release memory allocated by split_directories. (make_relative_prefix): New function, make a relative pathname if the compiler is not in the expected location. (process_command): If GCC_EXEC_PREFIX was not specified, see if we can figure out an appropriate prefix from argv[0]. * Makefile.in (DRIVER_DEFINES): Use unlibsubdir in definition of STANDARD_STARTFILE_PREFIX and TOOLDIR_BASE_PREFIX. Define STANDARD_BINDIR_PREFIX. From-SVN: r30464
1999-11-10 02:19:08 +01:00
#endif
/* From this point onward, gcc_exec_prefix is non-null if the toolchain
is relocated. The toolchain was either relocated using GCC_EXEC_PREFIX
or an automatically created GCC_EXEC_PREFIX from argv[0]. */
1992-02-01 06:15:32 +01:00
if (gcc_exec_prefix)
1992-02-01 06:15:32 +01:00
{
int len = strlen (gcc_exec_prefix);
if (len > (int) sizeof ("/lib/gcc/") - 1
&& (IS_DIR_SEPARATOR (gcc_exec_prefix[len-1])))
{
temp = gcc_exec_prefix + len - sizeof ("/lib/gcc/") + 1;
if (IS_DIR_SEPARATOR (*temp)
&& strncmp (temp + 1, "lib", 3) == 0
&& IS_DIR_SEPARATOR (temp[4])
&& strncmp (temp + 5, "gcc", 3) == 0)
len -= sizeof ("/lib/gcc/") - 1;
}
set_std_prefix (gcc_exec_prefix, len);
add_prefix (&exec_prefixes, gcc_libexec_prefix, "GCC",
PREFIX_PRIORITY_LAST, 0, 0);
add_prefix (&startfile_prefixes, gcc_exec_prefix, "GCC",
PREFIX_PRIORITY_LAST, 0, 0);
1992-02-01 06:15:32 +01:00
}
/* COMPILER_PATH and LIBRARY_PATH have values
that are lists of directory names with colons. */
GET_ENVIRONMENT (temp, "COMPILER_PATH");
1992-02-01 06:15:32 +01:00
if (temp)
{
const char *startp, *endp;
char *nstore = alloca (strlen (temp) + 3);
1992-02-01 06:15:32 +01:00
startp = endp = temp;
while (1)
{
if (*endp == PATH_SEPARATOR || *endp == 0)
1992-02-01 06:15:32 +01:00
{
strncpy (nstore, startp, endp - startp);
1992-02-01 06:15:32 +01:00
if (endp == startp)
strcpy (nstore, concat (".", dir_separator_str, NULL));
else if (!IS_DIR_SEPARATOR (endp[-1]))
1992-02-01 06:15:32 +01:00
{
nstore[endp - startp] = DIR_SEPARATOR;
nstore[endp - startp + 1] = 0;
1992-02-01 06:15:32 +01:00
}
else
nstore[endp - startp] = 0;
add_prefix (&exec_prefixes, nstore, 0,
PREFIX_PRIORITY_LAST, 0, 0);
add_prefix (&include_prefixes, nstore, 0,
PREFIX_PRIORITY_LAST, 0, 0);
1992-02-01 06:15:32 +01:00
if (*endp == 0)
break;
endp = startp = endp + 1;
}
else
endp++;
}
}
GET_ENVIRONMENT (temp, LIBRARY_PATH_ENV);
1997-01-17 00:59:37 +01:00
if (temp && *cross_compile == '0')
1992-02-01 06:15:32 +01:00
{
const char *startp, *endp;
char *nstore = alloca (strlen (temp) + 3);
1992-02-01 06:15:32 +01:00
startp = endp = temp;
while (1)
{
if (*endp == PATH_SEPARATOR || *endp == 0)
1992-02-01 06:15:32 +01:00
{
strncpy (nstore, startp, endp - startp);
1992-02-01 06:15:32 +01:00
if (endp == startp)
strcpy (nstore, concat (".", dir_separator_str, NULL));
else if (!IS_DIR_SEPARATOR (endp[-1]))
1992-02-01 06:15:32 +01:00
{
nstore[endp - startp] = DIR_SEPARATOR;
nstore[endp - startp + 1] = 0;
1992-02-01 06:15:32 +01:00
}
else
nstore[endp - startp] = 0;
add_prefix (&startfile_prefixes, nstore, NULL,
PREFIX_PRIORITY_LAST, 0, 1);
1992-02-01 06:15:32 +01:00
if (*endp == 0)
break;
endp = startp = endp + 1;
}
else
endp++;
}
}
/* Use LPATH like LIBRARY_PATH (for the CMU build program). */
GET_ENVIRONMENT (temp, "LPATH");
1997-01-17 00:59:37 +01:00
if (temp && *cross_compile == '0')
1992-02-01 06:15:32 +01:00
{
const char *startp, *endp;
char *nstore = alloca (strlen (temp) + 3);
1992-02-01 06:15:32 +01:00
startp = endp = temp;
while (1)
{
if (*endp == PATH_SEPARATOR || *endp == 0)
1992-02-01 06:15:32 +01:00
{
strncpy (nstore, startp, endp - startp);
1992-02-01 06:15:32 +01:00
if (endp == startp)
strcpy (nstore, concat (".", dir_separator_str, NULL));
else if (!IS_DIR_SEPARATOR (endp[-1]))
1992-02-01 06:15:32 +01:00
{
nstore[endp - startp] = DIR_SEPARATOR;
nstore[endp - startp + 1] = 0;
1992-02-01 06:15:32 +01:00
}
else
nstore[endp - startp] = 0;
add_prefix (&startfile_prefixes, nstore, NULL,
PREFIX_PRIORITY_LAST, 0, 1);
1992-02-01 06:15:32 +01:00
if (*endp == 0)
break;
endp = startp = endp + 1;
}
else
endp++;
}
}
/* Convert new-style -- options to old-style. */
translate_options (&argc, (const char *const **) &argv);
/* Do language-specific adjustment/addition of flags. */
lang_specific_driver (&argc, (const char *const **) &argv, &added_libraries);
1992-02-01 06:15:32 +01:00
/* Scan argv twice. Here, the first time, just count how many switches
there will be in their vector, and how many input files in theirs.
Here we also parse the switches that cc itself uses (e.g. -v). */
for (i = 1; i < argc; i++)
{
if (! strcmp (argv[i], "-dumpspecs"))
{
1997-01-16 23:15:53 +01:00
struct spec_list *sl;
init_spec ();
1997-01-16 23:15:53 +01:00
for (sl = specs; sl; sl = sl->next)
printf ("*%s:\n%s\n\n", sl->name, *(sl->ptr_spec));
if (link_command_spec)
printf ("*link_command:\n%s\n\n", link_command_spec);
1992-02-01 06:15:32 +01:00
exit (0);
}
else if (! strcmp (argv[i], "-dumpversion"))
{
printf ("%s\n", spec_version);
1992-02-01 06:15:32 +01:00
exit (0);
}
else if (! strcmp (argv[i], "-dumpmachine"))
{
printf ("%s\n", spec_machine);
exit (0);
}
else if (strcmp (argv[i], "-fversion") == 0)
{
/* translate_options () has turned --version into -fversion. */
printf (_("%s (GCC) %s\n"), programname, version_string);
printf ("Copyright %s 2007 Free Software Foundation, Inc.\n",
_("(C)"));
fputs (_("This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"),
stdout);
exit (0);
}
1998-07-13 19:20:29 +02:00
else if (strcmp (argv[i], "-fhelp") == 0)
{
/* translate_options () has turned --help into -fhelp. */
print_help_list = 1;
/* We will be passing a dummy file on to the sub-processes. */
n_infiles++;
n_switches++;
/* CPP driver cannot obtain switch from cc1_options. */
if (is_cpp_driver)
add_preprocessor_option ("--help", 6);
1998-07-13 19:20:29 +02:00
add_assembler_option ("--help", 6);
add_linker_option ("--help", 6);
}
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
else if (strncmp (argv[i], "-fhelp=", 7) == 0)
{
/* translate_options () has turned --help into -fhelp. */
print_subprocess_help = 2;
/* We will be passing a dummy file on to the sub-processes. */
n_infiles++;
n_switches++;
}
else if (strcmp (argv[i], "-ftarget-help") == 0)
{
/* translate_options() has turned --target-help into -ftarget-help. */
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
print_subprocess_help = 1;
/* We will be passing a dummy file on to the sub-processes. */
n_infiles++;
n_switches++;
/* CPP driver cannot obtain switch from cc1_options. */
if (is_cpp_driver)
add_preprocessor_option ("--target-help", 13);
add_assembler_option ("--target-help", 13);
add_linker_option ("--target-help", 13);
}
[multiple changes] Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR> * gcov.c (DIR_SEPARATOR): Provide default. (output_data): Add test for MS-DOS format absolute filename. (fancy_abort): Correct program name. (open_files): Open all files in binary mode. * libgcc2.c (__bb_exit_func): Likewise. * profile.c (init_branch_prob): Specify binary when opening files. * flags.h (flag_unwind_tables): New decl. * toplev.c (flag_unwind_table): New definition. (f_options): Add -funwind-tables. (decode_g_option): Clarify warning when unknown -g option is given. (rest_of_compilation): If inside an inlined external function, pretend we are just being declared. * dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables. (dwarf2out_frame_finish): Likewise. Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com> * flow.c (propagate_block): When the last reference to a label before an ADDR_VEC is deleted because the reference is a dead store, delete the ADDR_VEC. Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt> * fold-const.c (merge_ranges): In not in0, but in1, handle upper bounds equal like subset case. Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com> * dbxout.c (dbxout_parms): Generate a second stabs line for parameters passed in a register but moved to the stack. Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr> * gcc.c (pass_exit_codes, greatest_status): New variables. (struct option_map): Add entry for "--pass-exit-codes". (execute): Update greatest_status if error. (display_help): Add documentation for -pass-exit-codes. (process_command): Handle -pass-exit-codes. (main): Look at pass_exit_codes and greatest_status on call to exit. Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * reload.c (find_reloads): Refine test for no input reload case to not includes reloads emitted after insn. * function.c (find_temp_slots_from_address): Handle sum involving a register that points to a temp slot. (update_temp_slot_address): Make recursive call if both old and new are PLUS with a common operand. * calls.c (expand_call): Mark temp slot for result as having address taken. * rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case. * gcc.c (process_command): Add standard_exec_prefix with "GCC" component as well as "BINUTILS". * integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS. * integrate.c (copy_rtx_and_substitute): Likewise. (expand_inline_function, integrate_parm_decls, integrate_decl_tree): All callers changed. * unroll.c (inital_reg_note_copy, copy_loop_body): Likewise. * dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use gdb extensions, write size of type; also be more consistent in using references when this is a subtype. * pa.md (extv, extzv, insv): Use define_expand to reject constant that is out of range. * loop.c (unknown_constant_address_altered): New variable. (prescan_loop): Initialize it. (note_addr_stored): Set it for RTX_UNCHANGING_P MEM. (invariant_p, case MEM): Remove handling for volatile and readony; check new variable if readonly. (check_dbra_loop): Chdeck unknown_constant_address_altered. * cse.c (canon_hash, case MEM): Do not record if BLKmode. (addr_affects_sp_p): Removed from note_mem_written and only define #ifdef AUTO_INC_DEC. * alpha.c (input_operand, case ADDRESSOF): Treat as REG. * regclass.c (record_reg_classes): Properly handle register move directions. * varasm.c (initializer_constant_valid_p, case MINUS_EXPR): Don't think valid if both operands are invalid. (struct constant_descriptor): New field RTL. (mark_const_hash_entry): Mark it. (record_constant{,_rtx}): Initialize it. (output_constant_def): Allocate RTL in permanent obstack and save in table. ({record,compare}_constant_1): Modes must match for CONSTRUCTOR of ARRAY_TYPE. * c-common.h (initializer_constant_valid_p): Delete decl from here. * output.h (initializer_constant_valid_p): Move decl to here. * c-common.c (initializer_constant_valid_p): Delete function from here. * varasm.c (initializer_constant_valid_p): Move function to here. * tree.h (STRIP_SIGN_NOPS): New macro. * fold-const.c (optimize_minmax_comparison): New function. (invert_truthvalue, case WITH_RECORD_EXPR): New case. (fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS. (fold, case EQ_EXPR): Call optimize_minmax_comparison and add cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and widening conversions. (fold, case LE_EXPR): Rework changing unsigned to signed comparisons to look at size of mode, not precision of type; also add missing cases. (optimize_bit_field_compare, decode_field_reference): Don't try to optimize COMPONENT_REF of a PLACEHOLDER_EXPR. * dwarf2out.c (ctype.h): Include. (dwarf2out_set_demangle_name_func): New function. (size_of_line_info): Deleted. (output_line_info): Compute size of line info table from difference of labels. (base_type_die, add_name_attribute): Call demangle function, if any. (field_byte_offset): Use bits per word for variable length fields. (gen_array_type_die): Add array name. (gen_subprogram_die): Ignore DECL_INLINE if -fno-inline. (dwarf2out_add_library_unit_info): New function. * explow.c (set_stack_check_libfunc): New function. (stack_check_libfunc): New static variable. (probe_stack_range): Allow front-end to set up a libfunc to call. * combine.c (simplify_comparison): When making comparison in wider mode, check for having commuted an AND and a SUBREG. (contains_muldiv): New function. (try_combine): Call it when dividing a PARALLEL. (simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart. (simplify_comparison, case ASHIFTRT): Recognize sign-extension of a PLUS. (record_value_for_reg): If TEM is a binary operation with two CLOBBERs, use one of the CLOBBERs instead. (if_then_else_cond): If comparing against zero, just return thing being compared. * optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x). Don't generate shifts and subtract if have conditional arithmetic. * rtl.h (delete_barrier): New declaration. * jump.c (jump_optimize): Set up to handle conditional call. In conditional arithmetic case, handle CALL_INSN followed by a BARRIER. (delete_barrier): New function. * rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode. * recog.c (nonmemory_operand): Accept ADDRESSOF. * tree.c (build_type_attribute_variant): Push to obstack of ttype around type_hash_canon call. * expr.c (placeholder_list): Move decl to file scope. (expand_expr): Don't force access to volatile just because its address is taken. If ignoring reference operations, just expand the operands. (expand_expr, case COMPONENT_REF): Propagate EXPAND_CONST_ADDRESS to recursive call when expanding inner. Refine test for using bitfield operations vs pointer punning. (expand_expr, case CONVERT_EXPR): If converting to BLKmode UNION_TYPE from BLKmode, just return inner object. Use proper mode in store_field call. Properly set sizes of object to store and total size in store_field call for convert to union. (expand_expr, case ARRAY_REF): If OP0 is in a register, put it in memory (like for ADDR_EXPR). Also, don't put constant in register if we'll want it in memory. (readonly_fields_p): New function. (expand_expr, case INDIRECT_REF): Call it if LHS. (expand_assignment): Handle a RESULT_DECL where DECL_RTL is a PARALLEL. (do_jump, case WITH_RECORD_EXPR): New case. (get_inner_reference): Always go inside a CONVERT_EXPR and NOP_EXPR if both modes are the same. (store_field): Use bitfield operations if size of bitsize is not same as size of RHS's type. Check for bitpos not a multiple of alignment in BLKmode case. Do block move in largest possible alignment. (store_constructor): Set BITSIZE to -1 for variable size and properly in case of array of BLKmode. (expand_expr_unaligned): New function. (do_compare_and_jump): Call it. * mips/iris5.h (SWITCHES_NEED_SPACES): New macro. * collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES does not include 'o'. * function.c (instantiate_virtual_regs_1, case SET): Handle case where both SET_DEST and SET_SRC reference a virtual register. (gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG. * integrate.c (expand_inline_function): Handle case of setting virtual stack vars register (from built in setjmp); when parameter lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early. (subst_constant): Add new parm, MEMONLY. (expand_inline_function, integrate_parm_decls): Pass new parm. (integrate_decl_tree): Likewise. (copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P. (try_constants): Call subst_constants twice, with MEMONLY 0 and 1. (copy_rtx_and_substitute, case SET): Add explicit calls to copy_rtx_and_substitute for both sides. * stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for constraints. (pushcase{,_range}): Convert to NOMINAL_TYPE after checking for within INDEX_TYPE, instead of before. (fixup_gotos): Use f->target_rtl, not the next insn, since latter may be from a later fixup. (expand_value_return): Correctly convert VAL when promoting function return; support RETURN_REG being a PARALLEL. (expand_return): When checking for result in regs and having cleanup, consider PARALLEL in DECL_RTL as being in regs. From-SVN: r30299
1999-11-01 02:11:22 +01:00
else if (! strcmp (argv[i], "-pass-exit-codes"))
{
pass_exit_codes = 1;
n_switches++;
}
else if (! strcmp (argv[i], "-print-search-dirs"))
print_search_dirs = 1;
else if (! strcmp (argv[i], "-print-libgcc-file-name"))
print_file_name = "libgcc.a";
else if (! strncmp (argv[i], "-print-file-name=", 17))
print_file_name = argv[i] + 17;
else if (! strncmp (argv[i], "-print-prog-name=", 17))
print_prog_name = argv[i] + 17;
else if (! strcmp (argv[i], "-print-multi-lib"))
print_multi_lib = 1;
else if (! strcmp (argv[i], "-print-multi-directory"))
print_multi_directory = 1;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
else if (! strcmp (argv[i], "-print-multi-os-directory"))
print_multi_os_directory = 1;
re PR bootstrap/31020 (cannot write in </test/gnu/gcc/objdir/prev-gcc/../gcc/./include>) fixincludes: * mkheaders.in: Fix headers for each multilib required. gcc: PR bootstrap/31020 * configure.ac (CROSS_SYSTEM_HEADER_DIR, build_system_header_dir): Define using $${sysroot_headers_suffix}. * configure: Regenerate. * cppdefault.c (cpp_include_defaults): Make FIXED_INCLUDE_DIR a multilib-suffixed directory if SYSROOT_HEADERS_SUFFIX_SPEC defined. * doc/invoke.texi (-print-sysroot-headers-suffix): Document. * gcc.c (print_sysroot_headers_suffix): New. (option_map): Include --print-sysroot-headers-suffix. (display_help): Mention -print-sysroot-headers-suffix. (process_command): Handle -print-sysroot-headers-suffix. (do_spec_1): Append multilib directory to include-fixed path if sysroot suffixes in use. (main): Handle -print-sysroot-headers-suffix. * Makefile.in (start.encap): Don't depend on xlimits.h (xlimits.h): Remove. (stmp-int-hdrs): Don't depend on xlimits.h. Inline generation of limits.h for each multilib in fixinc_list. (fixinc_list, s-fixinc_list): New. (stmp-fixinc): Depend on fixinc_list. If not copying headers, generate them for each multilib in fixinc_list. (stmp-fixproto): Use include-fixed. Run fixproto for each multilib in fixinc_list. (mostlyclean): Don't remove xlimits.h. (clean): Remove include-fixed. (real-install-headers-tar, real-install-headers-cpio, real-install-headers-cp): Don't copy include, only include-fixed. (install-mkheaders): Depend on fixinc_list. Don't depend on xlimits.h. Save limits.h files for each multilib in fixinc_list. Always save mkinstalldirs. Preserve ${sysroot_headers_suffix} in SYSTEM_HEADER_DIR setting in mkheaders.conf. From-SVN: r122620
2007-03-06 16:50:28 +01:00
else if (! strcmp (argv[i], "-print-sysroot-headers-suffix"))
print_sysroot_headers_suffix = 1;
else if (! strncmp (argv[i], "-Wa,", 4))
{
int prev, j;
/* Pass the rest of this option to the assembler. */
/* Split the argument at commas. */
prev = 4;
for (j = 4; argv[i][j]; j++)
if (argv[i][j] == ',')
{
1998-07-13 19:20:29 +02:00
add_assembler_option (argv[i] + prev, j - prev);
prev = j + 1;
}
/* Record the part after the last comma. */
1998-07-13 19:20:29 +02:00
add_assembler_option (argv[i] + prev, j - prev);
}
else if (! strncmp (argv[i], "-Wp,", 4))
{
int prev, j;
/* Pass the rest of this option to the preprocessor. */
/* Split the argument at commas. */
prev = 4;
for (j = 4; argv[i][j]; j++)
if (argv[i][j] == ',')
{
1998-07-13 19:20:29 +02:00
add_preprocessor_option (argv[i] + prev, j - prev);
prev = j + 1;
}
/* Record the part after the last comma. */
1998-07-13 19:20:29 +02:00
add_preprocessor_option (argv[i] + prev, j - prev);
}
else if (argv[i][0] == '+' && argv[i][1] == 'e')
/* The +e options to the C++ front-end. */
n_switches++;
else if (strncmp (argv[i], "-Wl,", 4) == 0)
{
int j;
/* Split the argument at commas. */
for (j = 3; argv[i][j]; j++)
n_infiles += (argv[i][j] == ',');
}
else if (strcmp (argv[i], "-Xlinker") == 0)
{
if (i + 1 == argc)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("argument to '-Xlinker' is missing");
n_infiles++;
i++;
}
else if (strcmp (argv[i], "-Xpreprocessor") == 0)
{
if (i + 1 == argc)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("argument to '-Xpreprocessor' is missing");
add_preprocessor_option (argv[i+1], strlen (argv[i+1]));
}
else if (strcmp (argv[i], "-Xassembler") == 0)
{
if (i + 1 == argc)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("argument to '-Xassembler' is missing");
add_assembler_option (argv[i+1], strlen (argv[i+1]));
}
else if (strcmp (argv[i], "-l") == 0)
{
if (i + 1 == argc)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("argument to '-l' is missing");
n_infiles++;
i++;
}
else if (strncmp (argv[i], "-l", 2) == 0)
n_infiles++;
else if (strcmp (argv[i], "-save-temps") == 0)
{
save_temps_flag = 1;
n_switches++;
}
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
else if (strcmp (argv[i], "-combine") == 0)
{
combine_flag = 1;
n_switches++;
}
1996-10-29 22:21:57 +01:00
else if (strcmp (argv[i], "-specs") == 0)
{
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
struct user_specs *user = XNEW (struct user_specs);
1996-10-29 22:21:57 +01:00
if (++i >= argc)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("argument to '-specs' is missing");
1996-10-29 22:21:57 +01:00
user->next = (struct user_specs *) 0;
1996-10-29 22:21:57 +01:00
user->filename = argv[i];
if (user_specs_tail)
user_specs_tail->next = user;
else
user_specs_head = user;
user_specs_tail = user;
}
else if (strncmp (argv[i], "-specs=", 7) == 0)
{
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
struct user_specs *user = XNEW (struct user_specs);
1996-10-29 22:21:57 +01:00
if (strlen (argv[i]) == 7)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("argument to '-specs=' is missing");
1996-10-29 22:21:57 +01:00
user->next = (struct user_specs *) 0;
user->filename = argv[i] + 7;
1996-10-29 22:21:57 +01:00
if (user_specs_tail)
user_specs_tail->next = user;
else
user_specs_head = user;
user_specs_tail = user;
}
else if (strcmp (argv[i], "-time") == 0)
report_times = 1;
else if (strcmp (argv[i], "-pipe") == 0)
{
/* -pipe has to go into the switches array as well as
setting a flag. */
use_pipes = 1;
n_switches++;
}
else if (strcmp (argv[i], "-###") == 0)
{
/* This is similar to -v except that there is no execution
of the commands and the echoed arguments are quoted. It
is intended for use in shell scripts to capture the
driver-generated command line. */
verbose_only_flag++;
verbose_flag++;
}
else if (argv[i][0] == '-' && argv[i][1] != 0)
1992-02-01 06:15:32 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
const char *p = &argv[i][1];
int c = *p;
1992-02-01 06:15:32 +01:00
switch (c)
{
case 'b':
if (NULL == strchr(argv[i] + 2, '-'))
goto normal_switch;
/* Fall through. */
case 'V':
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("'-%c' must come at the start of the command line", c);
1992-02-01 06:15:32 +01:00
break;
case 'B':
{
const char *value;
int len;
1992-02-01 06:15:32 +01:00
if (p[1] == 0 && i + 1 == argc)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("argument to '-B' is missing");
1992-02-01 06:15:32 +01:00
if (p[1] == 0)
value = argv[++i];
else
value = p + 1;
len = strlen (value);
/* Catch the case where the user has forgotten to append a
directory separator to the path. Note, they may be using
-B to add an executable name prefix, eg "i386-elf-", in
order to distinguish between multiple installations of
GCC in the same directory. Hence we must check to see
if appending a directory separator actually makes a
valid directory name. */
if (! IS_DIR_SEPARATOR (value [len - 1])
&& is_directory (value, false))
{
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
char *tmp = XNEWVEC (char, len + 2);
strcpy (tmp, value);
tmp[len] = DIR_SEPARATOR;
tmp[++ len] = 0;
value = tmp;
}
add_prefix (&exec_prefixes, value, NULL,
PREFIX_PRIORITY_B_OPT, 0, 0);
add_prefix (&startfile_prefixes, value, NULL,
PREFIX_PRIORITY_B_OPT, 0, 0);
add_prefix (&include_prefixes, value, NULL,
PREFIX_PRIORITY_B_OPT, 0, 0);
n_switches++;
1992-02-01 06:15:32 +01:00
}
break;
case 'v': /* Print our subcommands and print versions. */
n_switches++;
/* If they do anything other than exactly `-v', don't set
verbose_flag; rather, continue on to give the error. */
if (p[1] != 0)
break;
verbose_flag++;
1992-02-01 06:15:32 +01:00
break;
case 'S':
case 'c':
if (p[1] == 0)
1992-02-01 06:15:32 +01:00
{
have_c = 1;
n_switches++;
1992-02-01 06:15:32 +01:00
break;
}
goto normal_switch;
case 'o':
have_o = 1;
#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
if (! have_c)
{
int skip;
/* Forward scan, just in case -S or -c is specified
after -o. */
int j = i + 1;
if (p[1] == 0)
++j;
while (j < argc)
{
if (argv[j][0] == '-')
{
if (SWITCH_CURTAILS_COMPILATION (argv[j][1])
&& argv[j][2] == 0)
{
have_c = 1;
break;
}
else if ((skip = SWITCH_TAKES_ARG (argv[j][1])))
j += skip - (argv[j][2] != 0);
else if ((skip = WORD_SWITCH_TAKES_ARG (argv[j] + 1)))
j += skip;
}
j++;
}
}
#endif
#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX) || defined(HAVE_TARGET_OBJECT_SUFFIX)
if (p[1] == 0)
argv[i + 1] = convert_filename (argv[i + 1], ! have_c, 0);
else
argv[i] = convert_filename (argv[i], ! have_c, 0);
#endif
goto normal_switch;
1992-02-01 06:15:32 +01:00
default:
normal_switch:
#ifdef MODIFY_TARGET_NAME
is_modify_target_name = 0;
for (j = 0; j < ARRAY_SIZE (modify_target); j++)
if (! strcmp (argv[i], modify_target[j].sw))
{
char *new_name = xmalloc (strlen (modify_target[j].str)
+ strlen (spec_machine));
const char *p, *r;
char *q;
int made_addition = 0;
is_modify_target_name = 1;
for (p = spec_machine, q = new_name; *p != 0; )
{
if (modify_target[j].add_del == DELETE
&& (! strncmp (q, modify_target[j].str,
strlen (modify_target[j].str))))
p += strlen (modify_target[j].str);
else if (modify_target[j].add_del == ADD
&& ! made_addition && *p == '-')
{
for (r = modify_target[j].str; *r != 0; )
*q++ = *r++;
made_addition = 1;
}
*q++ = *p++;
}
spec_machine = new_name;
}
if (is_modify_target_name)
break;
#endif
1992-02-01 06:15:32 +01:00
n_switches++;
if (SWITCH_TAKES_ARG (c) > (p[1] != 0))
i += SWITCH_TAKES_ARG (c) - (p[1] != 0);
else if (WORD_SWITCH_TAKES_ARG (p))
i += WORD_SWITCH_TAKES_ARG (p);
}
}
else
{
n_infiles++;
lang_n_infiles++;
}
1992-02-01 06:15:32 +01:00
}
if (save_temps_flag && use_pipes)
{
/* -save-temps overrides -pipe, so that temp files are produced */
if (save_temps_flag)
error ("warning: -pipe ignored because -save-temps specified");
use_pipes = 0;
}
/* Set up the search paths. We add directories that we expect to
contain GNU Toolchain components before directories specified by
the machine description so that we will find GNU components (like
the GNU assembler) before those of the host system. */
1992-02-01 06:15:32 +01:00
/* If we don't know where the toolchain has been installed, use the
configured-in locations. */
if (!gcc_exec_prefix)
{
#ifndef OS2
add_prefix (&exec_prefixes, standard_libexec_prefix, "GCC",
PREFIX_PRIORITY_LAST, 1, 0);
add_prefix (&exec_prefixes, standard_libexec_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 2, 0);
add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 2, 0);
#endif
add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 1, 0);
}
1992-02-01 06:15:32 +01:00
/* If not cross-compiling, search well-known system locations. */
if (*cross_compile == '0')
{
#ifndef OS2
add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
PREFIX_PRIORITY_LAST, 2, 0);
add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
PREFIX_PRIORITY_LAST, 2, 0);
#endif
add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
PREFIX_PRIORITY_LAST, 1, 0);
}
1992-02-01 06:15:32 +01:00
gcc_assert (!IS_ABSOLUTE_PATH (tooldir_base_prefix));
tooldir_prefix = concat (tooldir_base_prefix, spec_machine,
dir_separator_str, NULL);
/* Look for tools relative to the location from which the driver is
running, or, if that is not available, the configured prefix. */
tooldir_prefix
= concat (gcc_exec_prefix ? gcc_exec_prefix : standard_exec_prefix,
spec_machine, dir_separator_str,
spec_version, dir_separator_str, tooldir_prefix, NULL);
add_prefix (&exec_prefixes,
concat (tooldir_prefix, "bin", dir_separator_str, NULL),
"BINUTILS", PREFIX_PRIORITY_LAST, 0, 0);
add_prefix (&startfile_prefixes,
concat (tooldir_prefix, "lib", dir_separator_str, NULL),
"BINUTILS", PREFIX_PRIORITY_LAST, 0, 1);
#if defined(TARGET_SYSTEM_ROOT_RELOCATABLE) && !defined(VMS)
/* If the normal TARGET_SYSTEM_ROOT is inside of $exec_prefix,
then consider it to relocate with the rest of the GCC installation
if GCC_EXEC_PREFIX is set.
``make_relative_prefix'' is not compiled for VMS, so don't call it. */
if (target_system_root && gcc_exec_prefix)
{
char *tmp_prefix = make_relative_prefix (argv[0],
standard_bindir_prefix,
target_system_root);
if (tmp_prefix && access_check (tmp_prefix, F_OK) == 0)
{
target_system_root = tmp_prefix;
target_system_root_changed = 1;
}
}
#endif
/* More prefixes are enabled in main, after we read the specs file
and determine whether this is cross-compilation or not. */
1992-02-01 06:15:32 +01:00
/* Then create the space for the vectors and scan again. */
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
switches = XNEWVEC (struct switchstr, n_switches + 1);
infiles = XNEWVEC (struct infile, n_infiles + 1);
1992-02-01 06:15:32 +01:00
n_switches = 0;
n_infiles = 0;
last_language_n_infiles = -1;
/* This, time, copy the text of each switch and store a pointer
to the copy in the vector of switches.
Store all the infiles in their vector. */
for (i = 1; i < argc; i++)
{
/* Just skip the switches that were handled by the preceding loop. */
#ifdef MODIFY_TARGET_NAME
is_modify_target_name = 0;
for (j = 0; j < ARRAY_SIZE (modify_target); j++)
if (! strcmp (argv[i], modify_target[j].sw))
is_modify_target_name = 1;
if (is_modify_target_name)
;
else
#endif
if (! strncmp (argv[i], "-Wa,", 4))
;
else if (! strncmp (argv[i], "-Wp,", 4))
;
[multiple changes] Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR> * gcov.c (DIR_SEPARATOR): Provide default. (output_data): Add test for MS-DOS format absolute filename. (fancy_abort): Correct program name. (open_files): Open all files in binary mode. * libgcc2.c (__bb_exit_func): Likewise. * profile.c (init_branch_prob): Specify binary when opening files. * flags.h (flag_unwind_tables): New decl. * toplev.c (flag_unwind_table): New definition. (f_options): Add -funwind-tables. (decode_g_option): Clarify warning when unknown -g option is given. (rest_of_compilation): If inside an inlined external function, pretend we are just being declared. * dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables. (dwarf2out_frame_finish): Likewise. Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com> * flow.c (propagate_block): When the last reference to a label before an ADDR_VEC is deleted because the reference is a dead store, delete the ADDR_VEC. Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt> * fold-const.c (merge_ranges): In not in0, but in1, handle upper bounds equal like subset case. Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com> * dbxout.c (dbxout_parms): Generate a second stabs line for parameters passed in a register but moved to the stack. Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr> * gcc.c (pass_exit_codes, greatest_status): New variables. (struct option_map): Add entry for "--pass-exit-codes". (execute): Update greatest_status if error. (display_help): Add documentation for -pass-exit-codes. (process_command): Handle -pass-exit-codes. (main): Look at pass_exit_codes and greatest_status on call to exit. Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * reload.c (find_reloads): Refine test for no input reload case to not includes reloads emitted after insn. * function.c (find_temp_slots_from_address): Handle sum involving a register that points to a temp slot. (update_temp_slot_address): Make recursive call if both old and new are PLUS with a common operand. * calls.c (expand_call): Mark temp slot for result as having address taken. * rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case. * gcc.c (process_command): Add standard_exec_prefix with "GCC" component as well as "BINUTILS". * integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS. * integrate.c (copy_rtx_and_substitute): Likewise. (expand_inline_function, integrate_parm_decls, integrate_decl_tree): All callers changed. * unroll.c (inital_reg_note_copy, copy_loop_body): Likewise. * dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use gdb extensions, write size of type; also be more consistent in using references when this is a subtype. * pa.md (extv, extzv, insv): Use define_expand to reject constant that is out of range. * loop.c (unknown_constant_address_altered): New variable. (prescan_loop): Initialize it. (note_addr_stored): Set it for RTX_UNCHANGING_P MEM. (invariant_p, case MEM): Remove handling for volatile and readony; check new variable if readonly. (check_dbra_loop): Chdeck unknown_constant_address_altered. * cse.c (canon_hash, case MEM): Do not record if BLKmode. (addr_affects_sp_p): Removed from note_mem_written and only define #ifdef AUTO_INC_DEC. * alpha.c (input_operand, case ADDRESSOF): Treat as REG. * regclass.c (record_reg_classes): Properly handle register move directions. * varasm.c (initializer_constant_valid_p, case MINUS_EXPR): Don't think valid if both operands are invalid. (struct constant_descriptor): New field RTL. (mark_const_hash_entry): Mark it. (record_constant{,_rtx}): Initialize it. (output_constant_def): Allocate RTL in permanent obstack and save in table. ({record,compare}_constant_1): Modes must match for CONSTRUCTOR of ARRAY_TYPE. * c-common.h (initializer_constant_valid_p): Delete decl from here. * output.h (initializer_constant_valid_p): Move decl to here. * c-common.c (initializer_constant_valid_p): Delete function from here. * varasm.c (initializer_constant_valid_p): Move function to here. * tree.h (STRIP_SIGN_NOPS): New macro. * fold-const.c (optimize_minmax_comparison): New function. (invert_truthvalue, case WITH_RECORD_EXPR): New case. (fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS. (fold, case EQ_EXPR): Call optimize_minmax_comparison and add cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and widening conversions. (fold, case LE_EXPR): Rework changing unsigned to signed comparisons to look at size of mode, not precision of type; also add missing cases. (optimize_bit_field_compare, decode_field_reference): Don't try to optimize COMPONENT_REF of a PLACEHOLDER_EXPR. * dwarf2out.c (ctype.h): Include. (dwarf2out_set_demangle_name_func): New function. (size_of_line_info): Deleted. (output_line_info): Compute size of line info table from difference of labels. (base_type_die, add_name_attribute): Call demangle function, if any. (field_byte_offset): Use bits per word for variable length fields. (gen_array_type_die): Add array name. (gen_subprogram_die): Ignore DECL_INLINE if -fno-inline. (dwarf2out_add_library_unit_info): New function. * explow.c (set_stack_check_libfunc): New function. (stack_check_libfunc): New static variable. (probe_stack_range): Allow front-end to set up a libfunc to call. * combine.c (simplify_comparison): When making comparison in wider mode, check for having commuted an AND and a SUBREG. (contains_muldiv): New function. (try_combine): Call it when dividing a PARALLEL. (simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart. (simplify_comparison, case ASHIFTRT): Recognize sign-extension of a PLUS. (record_value_for_reg): If TEM is a binary operation with two CLOBBERs, use one of the CLOBBERs instead. (if_then_else_cond): If comparing against zero, just return thing being compared. * optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x). Don't generate shifts and subtract if have conditional arithmetic. * rtl.h (delete_barrier): New declaration. * jump.c (jump_optimize): Set up to handle conditional call. In conditional arithmetic case, handle CALL_INSN followed by a BARRIER. (delete_barrier): New function. * rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode. * recog.c (nonmemory_operand): Accept ADDRESSOF. * tree.c (build_type_attribute_variant): Push to obstack of ttype around type_hash_canon call. * expr.c (placeholder_list): Move decl to file scope. (expand_expr): Don't force access to volatile just because its address is taken. If ignoring reference operations, just expand the operands. (expand_expr, case COMPONENT_REF): Propagate EXPAND_CONST_ADDRESS to recursive call when expanding inner. Refine test for using bitfield operations vs pointer punning. (expand_expr, case CONVERT_EXPR): If converting to BLKmode UNION_TYPE from BLKmode, just return inner object. Use proper mode in store_field call. Properly set sizes of object to store and total size in store_field call for convert to union. (expand_expr, case ARRAY_REF): If OP0 is in a register, put it in memory (like for ADDR_EXPR). Also, don't put constant in register if we'll want it in memory. (readonly_fields_p): New function. (expand_expr, case INDIRECT_REF): Call it if LHS. (expand_assignment): Handle a RESULT_DECL where DECL_RTL is a PARALLEL. (do_jump, case WITH_RECORD_EXPR): New case. (get_inner_reference): Always go inside a CONVERT_EXPR and NOP_EXPR if both modes are the same. (store_field): Use bitfield operations if size of bitsize is not same as size of RHS's type. Check for bitpos not a multiple of alignment in BLKmode case. Do block move in largest possible alignment. (store_constructor): Set BITSIZE to -1 for variable size and properly in case of array of BLKmode. (expand_expr_unaligned): New function. (do_compare_and_jump): Call it. * mips/iris5.h (SWITCHES_NEED_SPACES): New macro. * collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES does not include 'o'. * function.c (instantiate_virtual_regs_1, case SET): Handle case where both SET_DEST and SET_SRC reference a virtual register. (gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG. * integrate.c (expand_inline_function): Handle case of setting virtual stack vars register (from built in setjmp); when parameter lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early. (subst_constant): Add new parm, MEMONLY. (expand_inline_function, integrate_parm_decls): Pass new parm. (integrate_decl_tree): Likewise. (copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P. (try_constants): Call subst_constants twice, with MEMONLY 0 and 1. (copy_rtx_and_substitute, case SET): Add explicit calls to copy_rtx_and_substitute for both sides. * stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for constraints. (pushcase{,_range}): Convert to NOMINAL_TYPE after checking for within INDEX_TYPE, instead of before. (fixup_gotos): Use f->target_rtl, not the next insn, since latter may be from a later fixup. (expand_value_return): Correctly convert VAL when promoting function return; support RETURN_REG being a PARALLEL. (expand_return): When checking for result in regs and having cleanup, consider PARALLEL in DECL_RTL as being in regs. From-SVN: r30299
1999-11-01 02:11:22 +01:00
else if (! strcmp (argv[i], "-pass-exit-codes"))
;
else if (! strcmp (argv[i], "-print-search-dirs"))
;
else if (! strcmp (argv[i], "-print-libgcc-file-name"))
;
else if (! strncmp (argv[i], "-print-file-name=", 17))
;
else if (! strncmp (argv[i], "-print-prog-name=", 17))
;
else if (! strcmp (argv[i], "-print-multi-lib"))
;
else if (! strcmp (argv[i], "-print-multi-directory"))
;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
else if (! strcmp (argv[i], "-print-multi-os-directory"))
;
re PR bootstrap/31020 (cannot write in </test/gnu/gcc/objdir/prev-gcc/../gcc/./include>) fixincludes: * mkheaders.in: Fix headers for each multilib required. gcc: PR bootstrap/31020 * configure.ac (CROSS_SYSTEM_HEADER_DIR, build_system_header_dir): Define using $${sysroot_headers_suffix}. * configure: Regenerate. * cppdefault.c (cpp_include_defaults): Make FIXED_INCLUDE_DIR a multilib-suffixed directory if SYSROOT_HEADERS_SUFFIX_SPEC defined. * doc/invoke.texi (-print-sysroot-headers-suffix): Document. * gcc.c (print_sysroot_headers_suffix): New. (option_map): Include --print-sysroot-headers-suffix. (display_help): Mention -print-sysroot-headers-suffix. (process_command): Handle -print-sysroot-headers-suffix. (do_spec_1): Append multilib directory to include-fixed path if sysroot suffixes in use. (main): Handle -print-sysroot-headers-suffix. * Makefile.in (start.encap): Don't depend on xlimits.h (xlimits.h): Remove. (stmp-int-hdrs): Don't depend on xlimits.h. Inline generation of limits.h for each multilib in fixinc_list. (fixinc_list, s-fixinc_list): New. (stmp-fixinc): Depend on fixinc_list. If not copying headers, generate them for each multilib in fixinc_list. (stmp-fixproto): Use include-fixed. Run fixproto for each multilib in fixinc_list. (mostlyclean): Don't remove xlimits.h. (clean): Remove include-fixed. (real-install-headers-tar, real-install-headers-cpio, real-install-headers-cp): Don't copy include, only include-fixed. (install-mkheaders): Depend on fixinc_list. Don't depend on xlimits.h. Save limits.h files for each multilib in fixinc_list. Always save mkinstalldirs. Preserve ${sysroot_headers_suffix} in SYSTEM_HEADER_DIR setting in mkheaders.conf. From-SVN: r122620
2007-03-06 16:50:28 +01:00
else if (! strcmp (argv[i], "-print-sysroot-headers-suffix"))
;
else if (! strncmp (argv[i], "--sysroot=", strlen ("--sysroot=")))
{
target_system_root = argv[i] + strlen ("--sysroot=");
target_system_root_changed = 1;
}
else if (argv[i][0] == '+' && argv[i][1] == 'e')
{
/* Compensate for the +e options to the C++ front-end;
they're there simply for cfront call-compatibility. We do
some magic in default_compilers to pass them down properly.
Note we deliberately start at the `+' here, to avoid passing
-e0 or -e1 down into the linker. */
switches[n_switches].part1 = &argv[i][0];
switches[n_switches].args = 0;
switches[n_switches].live_cond = SWITCH_OK;
switches[n_switches].validated = 0;
n_switches++;
}
else if (strncmp (argv[i], "-Wl,", 4) == 0)
{
int prev, j;
/* Split the argument at commas. */
prev = 4;
for (j = 4; argv[i][j]; j++)
if (argv[i][j] == ',')
{
infiles[n_infiles].language = "*";
infiles[n_infiles++].name
= save_string (argv[i] + prev, j - prev);
prev = j + 1;
}
/* Record the part after the last comma. */
infiles[n_infiles].language = "*";
infiles[n_infiles++].name = argv[i] + prev;
}
else if (strcmp (argv[i], "-Xlinker") == 0)
{
infiles[n_infiles].language = "*";
infiles[n_infiles++].name = argv[++i];
}
/* Xassembler and Xpreprocessor were already handled in the first argv
scan, so all we need to do here is ignore them and their argument. */
else if (strcmp (argv[i], "-Xassembler") == 0)
i++;
else if (strcmp (argv[i], "-Xpreprocessor") == 0)
i++;
else if (strcmp (argv[i], "-l") == 0)
{ /* POSIX allows separation of -l and the lib arg;
canonicalize by concatenating -l with its arg */
infiles[n_infiles].language = "*";
infiles[n_infiles++].name = concat ("-l", argv[++i], NULL);
}
else if (strncmp (argv[i], "-l", 2) == 0)
{
infiles[n_infiles].language = "*";
infiles[n_infiles++].name = argv[i];
}
1996-10-29 22:21:57 +01:00
else if (strcmp (argv[i], "-specs") == 0)
i++;
else if (strncmp (argv[i], "-specs=", 7) == 0)
;
else if (strcmp (argv[i], "-time") == 0)
;
else if (strcmp (argv[i], "-###") == 0)
;
else if (argv[i][0] == '-' && argv[i][1] != 0)
1992-02-01 06:15:32 +01:00
{
const char *p = &argv[i][1];
int c = *p;
1992-02-01 06:15:32 +01:00
if (c == 'x')
{
if (p[1] == 0 && i + 1 == argc)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("argument to '-x' is missing");
1992-02-01 06:15:32 +01:00
if (p[1] == 0)
spec_lang = argv[++i];
else
spec_lang = p + 1;
if (! strcmp (spec_lang, "none"))
/* Suppress the warning if -xnone comes after the last input
file, because alternate command interfaces like g++ might
find it useful to place -xnone after each input file. */
1992-02-01 06:15:32 +01:00
spec_lang = 0;
else
last_language_n_infiles = n_infiles;
continue;
}
switches[n_switches].part1 = p;
/* Deal with option arguments in separate argv elements. */
if ((SWITCH_TAKES_ARG (c) > (p[1] != 0))
|| WORD_SWITCH_TAKES_ARG (p))
{
int j = 0;
int n_args = WORD_SWITCH_TAKES_ARG (p);
1992-02-01 06:15:32 +01:00
if (n_args == 0)
{
/* Count only the option arguments in separate argv elements. */
n_args = SWITCH_TAKES_ARG (c) - (p[1] != 0);
}
if (i + n_args >= argc)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("argument to '-%s' is missing", p);
switches[n_switches].args
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
= XNEWVEC (const char *, n_args + 1);
while (j < n_args)
switches[n_switches].args[j++] = argv[++i];
/* Null-terminate the vector. */
switches[n_switches].args[j] = 0;
1992-02-01 06:15:32 +01:00
}
else if (strchr (switches_need_spaces, c))
{
/* On some systems, ld cannot handle some options without
a space. So split the option from its argument. */
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
char *part1 = XNEWVEC (char, 2);
part1[0] = c;
part1[1] = '\0';
switches[n_switches].part1 = part1;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
switches[n_switches].args = XNEWVEC (const char *, 2);
switches[n_switches].args[0] = xstrdup (p+1);
switches[n_switches].args[1] = 0;
}
else
1992-02-01 06:15:32 +01:00
switches[n_switches].args = 0;
switches[n_switches].live_cond = SWITCH_OK;
switches[n_switches].validated = 0;
switches[n_switches].ordering = 0;
/* These are always valid, since gcc.c itself understands the
first four and gfortranspec.c understands -static-libgfortran. */
if (!strcmp (p, "save-temps")
|| !strcmp (p, "static-libgcc")
|| !strcmp (p, "shared-libgcc")
|| !strcmp (p, "pipe")
|| !strcmp (p, "static-libgfortran"))
switches[n_switches].validated = 1;
else
{
char ch = switches[n_switches].part1[0];
if (ch == 'B')
switches[n_switches].validated = 1;
}
1992-02-01 06:15:32 +01:00
n_switches++;
}
else
{
#ifdef HAVE_TARGET_OBJECT_SUFFIX
argv[i] = convert_filename (argv[i], 0, access (argv[i], F_OK));
#endif
if (strcmp (argv[i], "-") != 0 && access (argv[i], F_OK) < 0)
{
perror_with_name (argv[i]);
error_count++;
}
else
{
infiles[n_infiles].language = spec_lang;
infiles[n_infiles++].name = argv[i];
}
1992-02-01 06:15:32 +01:00
}
}
if (n_infiles == last_language_n_infiles && spec_lang != 0)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
error ("warning: '-x %s' after last input file has no effect", spec_lang);
1992-02-01 06:15:32 +01:00
/* Ensure we only invoke each subprocess once. */
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
if (print_subprocess_help || print_help_list)
{
n_infiles = 1;
invoke.texi (Overall Options): Document --help=. * doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-02-12 17:25:14 +01:00
/* Create a dummy input file, so that we can pass
the help option on to the various sub-processes. */
infiles[0].language = "c";
infiles[0].name = "help-dummy";
}
1992-02-01 06:15:32 +01:00
switches[n_switches].part1 = 0;
infiles[n_infiles].name = 0;
}
/* Store switches not filtered out by %<S in spec in COLLECT_GCC_OPTIONS
and place that in the environment. */
static void
set_collect_gcc_options (void)
{
int i;
int first_time;
/* Build COLLECT_GCC_OPTIONS to have all of the options specified to
the compiler. */
obstack_grow (&collect_obstack, "COLLECT_GCC_OPTIONS=",
sizeof ("COLLECT_GCC_OPTIONS=") - 1);
first_time = TRUE;
for (i = 0; (int) i < n_switches; i++)
{
const char *const *args;
const char *p, *q;
if (!first_time)
obstack_grow (&collect_obstack, " ", 1);
first_time = FALSE;
/* Ignore elided switches. */
if (switches[i].live_cond == SWITCH_IGNORE)
continue;
obstack_grow (&collect_obstack, "'-", 2);
q = switches[i].part1;
while ((p = strchr (q, '\'')))
{
obstack_grow (&collect_obstack, q, p - q);
obstack_grow (&collect_obstack, "'\\''", 4);
q = ++p;
}
obstack_grow (&collect_obstack, q, strlen (q));
obstack_grow (&collect_obstack, "'", 1);
for (args = switches[i].args; args && *args; args++)
{
obstack_grow (&collect_obstack, " '", 2);
q = *args;
while ((p = strchr (q, '\'')))
{
obstack_grow (&collect_obstack, q, p - q);
obstack_grow (&collect_obstack, "'\\''", 4);
q = ++p;
}
obstack_grow (&collect_obstack, q, strlen (q));
obstack_grow (&collect_obstack, "'", 1);
}
}
obstack_grow (&collect_obstack, "\0", 1);
putenv (XOBFINISH (&collect_obstack, char *));
}
1992-02-01 06:15:32 +01:00
/* Process a spec string, accumulating and running commands. */
/* These variables describe the input file name.
input_file_number is the index on outfiles of this file,
so that the output file name can be stored for later use by %o.
input_basename is the start of the part of the input file
sans all directory names, and basename_length is the number
of characters starting there excluding the suffix .c or whatever. */
static const char *input_filename;
1992-02-01 06:15:32 +01:00
static int input_file_number;
size_t input_filename_length;
1992-02-01 06:15:32 +01:00
static int basename_length;
static int suffixed_basename_length;
static const char *input_basename;
static const char *input_suffix;
#ifndef HOST_LACKS_INODE_NUMBERS
static struct stat input_stat;
#endif
static int input_stat_set;
1992-02-01 06:15:32 +01:00
/* The compiler used to process the current input file. */
static struct compiler *input_file_compiler;
1992-02-01 06:15:32 +01:00
/* These are variables used within do_spec and do_spec_1. */
/* Nonzero if an arg has been started and not yet terminated
(with space, tab or newline). */
static int arg_going;
/* Nonzero means %d or %g has been seen; the next arg to be terminated
is a temporary file name. */
static int delete_this_arg;
/* Nonzero means %w has been seen; the next arg to be terminated
is the output file name of this compilation. */
static int this_is_output_file;
/* Nonzero means %s has been seen; the next arg to be terminated
is the name of a library file and we should try the standard
search dirs for it. */
static int this_is_library_file;
/* Nonzero means that the input of this command is coming from a pipe. */
static int input_from_pipe;
/* Nonnull means substitute this for any suffix when outputting a switches
arguments. */
static const char *suffix_subst;
1992-02-01 06:15:32 +01:00
/* Process the spec SPEC and run the commands specified therein.
Returns 0 if the spec is successfully processed; -1 if failed. */
int
do_spec (const char *spec)
1992-02-01 06:15:32 +01:00
{
int value;
value = do_spec_2 (spec);
1992-02-01 06:15:32 +01:00
/* Force out any unfinished command.
If -pipe, this forces out the last command if it ended in `|'. */
if (value == 0)
{
if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
argbuf_index--;
set_collect_gcc_options ();
1992-02-01 06:15:32 +01:00
if (argbuf_index > 0)
value = execute ();
}
return value;
}
static int
do_spec_2 (const char *spec)
{
const char *string;
int result;
clear_args ();
arg_going = 0;
delete_this_arg = 0;
this_is_output_file = 0;
this_is_library_file = 0;
input_from_pipe = 0;
suffix_subst = NULL;
result = do_spec_1 (spec, 0, NULL);
/* End any pending argument. */
if (arg_going)
{
obstack_1grow (&obstack, 0);
string = XOBFINISH (&obstack, const char *);
if (this_is_library_file)
string = find_file (string);
store_arg (string, delete_this_arg, this_is_output_file);
if (this_is_output_file)
outfiles[input_file_number] = string;
arg_going = 0;
}
return result;
}
/* Process the given spec string and add any new options to the end
of the switches/n_switches array. */
static void
do_option_spec (const char *name, const char *spec)
{
unsigned int i, value_count, value_len;
const char *p, *q, *value;
char *tmp_spec, *tmp_spec_p;
if (configure_default_options[0].name == NULL)
return;
for (i = 0; i < ARRAY_SIZE (configure_default_options); i++)
if (strcmp (configure_default_options[i].name, name) == 0)
break;
if (i == ARRAY_SIZE (configure_default_options))
return;
value = configure_default_options[i].value;
value_len = strlen (value);
/* Compute the size of the final spec. */
value_count = 0;
p = spec;
while ((p = strstr (p, "%(VALUE)")) != NULL)
{
p ++;
value_count ++;
}
/* Replace each %(VALUE) by the specified value. */
tmp_spec = alloca (strlen (spec) + 1
+ value_count * (value_len - strlen ("%(VALUE)")));
tmp_spec_p = tmp_spec;
q = spec;
while ((p = strstr (q, "%(VALUE)")) != NULL)
{
memcpy (tmp_spec_p, q, p - q);
tmp_spec_p = tmp_spec_p + (p - q);
memcpy (tmp_spec_p, value, value_len);
tmp_spec_p += value_len;
q = p + strlen ("%(VALUE)");
}
strcpy (tmp_spec_p, q);
do_self_spec (tmp_spec);
}
/* Process the given spec string and add any new options to the end
of the switches/n_switches array. */
static void
do_self_spec (const char *spec)
{
do_spec_2 (spec);
do_spec_1 (" ", 0, NULL);
if (argbuf_index > 0)
{
int i, first;
first = n_switches;
n_switches += argbuf_index;
switches = xrealloc (switches,
sizeof (struct switchstr) * (n_switches + 1));
switches[n_switches] = switches[first];
for (i = 0; i < argbuf_index; i++)
{
struct switchstr *sw;
/* Each switch should start with '-'. */
if (argbuf[i][0] != '-')
fatal ("switch '%s' does not start with '-'", argbuf[i]);
sw = &switches[i + first];
sw->part1 = &argbuf[i][1];
sw->args = 0;
sw->live_cond = SWITCH_OK;
sw->validated = 0;
sw->ordering = 0;
}
}
}
/* Callback for processing %D and %I specs. */
struct spec_path_info {
const char *option;
const char *append;
size_t append_len;
bool omit_relative;
bool separate_options;
};
static void *
spec_path (char *path, void *data)
{
struct spec_path_info *info = data;
size_t len = 0;
char save = 0;
if (info->omit_relative && !IS_ABSOLUTE_PATH (path))
return NULL;
if (info->append_len != 0)
{
len = strlen (path);
memcpy (path + len, info->append, info->append_len + 1);
}
if (!is_directory (path, true))
return NULL;
do_spec_1 (info->option, 1, NULL);
if (info->separate_options)
do_spec_1 (" ", 0, NULL);
if (info->append_len == 0)
{
len = strlen (path);
save = path[len - 1];
if (IS_DIR_SEPARATOR (path[len - 1]))
path[len - 1] = '\0';
}
do_spec_1 (path, 1, NULL);
do_spec_1 (" ", 0, NULL);
/* Must not damage the original path. */
if (info->append_len == 0)
path[len - 1] = save;
return NULL;
}
1992-02-01 06:15:32 +01:00
/* Process the sub-spec SPEC as a portion of a larger spec.
This is like processing a whole spec except that we do
not initialize at the beginning and we do not supply a
newline by default at the end.
INSWITCH nonzero means don't process %-sequences in SPEC;
in this case, % is treated as an ordinary character.
This is used while substituting switches.
INSWITCH nonzero also causes SPC not to terminate an argument.
Value is zero unless a line was finished
and the command on that line reported an error. */
static int
do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
1992-02-01 06:15:32 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
const char *p = spec;
int c;
1992-02-01 06:15:32 +01:00
int i;
const char *string;
int value;
1992-02-01 06:15:32 +01:00
while ((c = *p++))
1992-02-01 06:15:32 +01:00
/* If substituting a switch, treat all chars like letters.
Otherwise, NL, SPC, TAB and % are special. */
switch (inswitch ? 'a' : c)
{
case '\n':
/* End of line: finish any pending argument,
then run the pending command if one has been started. */
if (arg_going)
{
obstack_1grow (&obstack, 0);
string = XOBFINISH (&obstack, const char *);
1992-02-01 06:15:32 +01:00
if (this_is_library_file)
string = find_file (string);
store_arg (string, delete_this_arg, this_is_output_file);
if (this_is_output_file)
outfiles[input_file_number] = string;
}
arg_going = 0;
if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
{
/* A `|' before the newline means use a pipe here,
but only if -pipe was specified.
Otherwise, execute now and don't pass the `|' as an arg. */
if (use_pipes)
1992-02-01 06:15:32 +01:00
{
input_from_pipe = 1;
1992-02-01 06:15:32 +01:00
break;
}
else
argbuf_index--;
}
set_collect_gcc_options ();
1992-02-01 06:15:32 +01:00
if (argbuf_index > 0)
{
value = execute ();
1992-02-01 06:15:32 +01:00
if (value)
return value;
}
/* Reinitialize for a new command, and for a new argument. */
clear_args ();
arg_going = 0;
delete_this_arg = 0;
this_is_output_file = 0;
this_is_library_file = 0;
input_from_pipe = 0;
1992-02-01 06:15:32 +01:00
break;
case '|':
/* End any pending argument. */
if (arg_going)
{
obstack_1grow (&obstack, 0);
string = XOBFINISH (&obstack, const char *);
1992-02-01 06:15:32 +01:00
if (this_is_library_file)
string = find_file (string);
store_arg (string, delete_this_arg, this_is_output_file);
if (this_is_output_file)
outfiles[input_file_number] = string;
}
/* Use pipe */
obstack_1grow (&obstack, c);
arg_going = 1;
break;
case '\t':
case ' ':
/* Space or tab ends an argument if one is pending. */
if (arg_going)
{
obstack_1grow (&obstack, 0);
string = XOBFINISH (&obstack, const char *);
1992-02-01 06:15:32 +01:00
if (this_is_library_file)
string = find_file (string);
store_arg (string, delete_this_arg, this_is_output_file);
if (this_is_output_file)
outfiles[input_file_number] = string;
}
/* Reinitialize for a new argument. */
arg_going = 0;
delete_this_arg = 0;
this_is_output_file = 0;
this_is_library_file = 0;
break;
case '%':
switch (c = *p++)
{
case 0:
fatal ("spec '%s' invalid", spec);
1992-02-01 06:15:32 +01:00
case 'b':
obstack_grow (&obstack, input_basename, basename_length);
arg_going = 1;
break;
case 'B':
obstack_grow (&obstack, input_basename, suffixed_basename_length);
arg_going = 1;
break;
1992-02-01 06:15:32 +01:00
case 'd':
delete_this_arg = 2;
break;
/* Dump out the directories specified with LIBRARY_PATH,
followed by the absolute directories
that we search for startfiles. */
1992-02-01 06:15:32 +01:00
case 'D':
{
struct spec_path_info info;
info.option = "-L";
info.append_len = 0;
#ifdef RELATIVE_PREFIX_NOT_LINKDIR
/* Used on systems which record the specified -L dirs
and use them to search for dynamic linking.
Relative directories always come from -B,
and it is better not to use them for searching
at run time. In particular, stage1 loses. */
info.omit_relative = true;
#else
info.omit_relative = false;
#endif
info.separate_options = false;
for_each_path (&startfile_prefixes, true, 0, spec_path, &info);
}
1992-02-01 06:15:32 +01:00
break;
case 'e':
/* %efoo means report an error with `foo' as error message
1992-02-01 06:15:32 +01:00
and don't execute any more commands for this file. */
{
const char *q = p;
1992-02-01 06:15:32 +01:00
char *buf;
while (*p != 0 && *p != '\n')
p++;
buf = alloca (p - q + 1);
1992-02-01 06:15:32 +01:00
strncpy (buf, q, p - q);
buf[p - q] = 0;
error ("%s", buf);
1992-02-01 06:15:32 +01:00
return -1;
}
break;
case 'n':
/* %nfoo means report a notice with `foo' on stderr. */
{
const char *q = p;
char *buf;
while (*p != 0 && *p != '\n')
p++;
buf = alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
notice ("%s\n", buf);
if (*p)
p++;
}
break;
1992-02-01 06:15:32 +01:00
case 'j':
{
struct stat st;
/* If save_temps_flag is off, and the HOST_BIT_BUCKET is
defined, and it is not a directory, and it is
writable, use it. Otherwise, treat this like any
other temporary file. */
if ((!save_temps_flag)
&& (stat (HOST_BIT_BUCKET, &st) == 0) && (!S_ISDIR (st.st_mode))
&& (access (HOST_BIT_BUCKET, W_OK) == 0))
{
obstack_grow (&obstack, HOST_BIT_BUCKET,
strlen (HOST_BIT_BUCKET));
delete_this_arg = 0;
arg_going = 1;
break;
}
}
goto create_temp_file;
case '|':
if (use_pipes)
{
obstack_1grow (&obstack, '-');
delete_this_arg = 0;
arg_going = 1;
/* consume suffix */
while (*p == '.' || ISALNUM ((unsigned char) *p))
p++;
if (p[0] == '%' && p[1] == 'O')
p += 2;
break;
}
goto create_temp_file;
case 'm':
if (use_pipes)
{
/* consume suffix */
while (*p == '.' || ISALNUM ((unsigned char) *p))
p++;
if (p[0] == '%' && p[1] == 'O')
p += 2;
break;
}
goto create_temp_file;
1992-02-01 06:15:32 +01:00
case 'g':
case 'u':
case 'U':
create_temp_file:
1992-02-01 06:15:32 +01:00
{
struct temp_name *t;
int suffix_length;
const char *suffix = p;
char *saved_suffix = NULL;
while (*p == '.' || ISALNUM ((unsigned char) *p))
p++;
suffix_length = p - suffix;
if (p[0] == '%' && p[1] == 'O')
{
p += 2;
/* We don't support extra suffix characters after %O. */
if (*p == '.' || ISALNUM ((unsigned char) *p))
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("spec '%s' has invalid '%%0%c'", spec, *p);
if (suffix_length == 0)
suffix = TARGET_OBJECT_SUFFIX;
else
{
saved_suffix
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
= XNEWVEC (char, suffix_length
+ strlen (TARGET_OBJECT_SUFFIX));
strncpy (saved_suffix, suffix, suffix_length);
strcpy (saved_suffix + suffix_length,
TARGET_OBJECT_SUFFIX);
}
suffix_length += strlen (TARGET_OBJECT_SUFFIX);
}
/* If the input_filename has the same suffix specified
for the %g, %u, or %U, and -save-temps is specified,
we could end up using that file as an intermediate
thus clobbering the user's source file (.e.g.,
gcc -save-temps foo.s would clobber foo.s with the
output of cpp0). So check for this condition and
generate a temp file as the intermediate. */
if (save_temps_flag)
{
temp_filename_length = basename_length + suffix_length;
temp_filename = alloca (temp_filename_length + 1);
strncpy ((char *) temp_filename, input_basename, basename_length);
strncpy ((char *) temp_filename + basename_length, suffix,
suffix_length);
*((char *) temp_filename + temp_filename_length) = '\0';
if (strcmp (temp_filename, input_filename) != 0)
{
#ifndef HOST_LACKS_INODE_NUMBERS
struct stat st_temp;
/* Note, set_input() resets input_stat_set to 0. */
if (input_stat_set == 0)
{
input_stat_set = stat (input_filename, &input_stat);
if (input_stat_set >= 0)
input_stat_set = 1;
}
/* If we have the stat for the input_filename
and we can do the stat for the temp_filename
then the they could still refer to the same
file if st_dev/st_ino's are the same. */
if (input_stat_set != 1
|| stat (temp_filename, &st_temp) < 0
|| input_stat.st_dev != st_temp.st_dev
|| input_stat.st_ino != st_temp.st_ino)
#else
/* Just compare canonical pathnames. */
char* input_realname = lrealpath (input_filename);
char* temp_realname = lrealpath (temp_filename);
bool files_differ = strcmp (input_realname, temp_realname);
free (input_realname);
free (temp_realname);
if (files_differ)
#endif
{
temp_filename = save_string (temp_filename,
temp_filename_length + 1);
obstack_grow (&obstack, temp_filename,
temp_filename_length);
arg_going = 1;
delete_this_arg = 0;
break;
}
}
}
/* See if we already have an association of %g/%u/%U and
suffix. */
for (t = temp_names; t; t = t->next)
if (t->length == suffix_length
&& strncmp (t->suffix, suffix, suffix_length) == 0
&& t->unique == (c == 'u' || c == 'U' || c == 'j'))
break;
/* Make a new association if needed. %u and %j
require one. */
if (t == 0 || c == 'u' || c == 'j')
{
if (t == 0)
{
t = xmalloc (sizeof (struct temp_name));
t->next = temp_names;
temp_names = t;
}
t->length = suffix_length;
if (saved_suffix)
{
t->suffix = saved_suffix;
saved_suffix = NULL;
}
else
t->suffix = save_string (suffix, suffix_length);
t->unique = (c == 'u' || c == 'U' || c == 'j');
temp_filename = make_temp_file (t->suffix);
temp_filename_length = strlen (temp_filename);
t->filename = temp_filename;
t->filename_length = temp_filename_length;
}
if (saved_suffix)
free (saved_suffix);
obstack_grow (&obstack, t->filename, t->filename_length);
delete_this_arg = 1;
1992-02-01 06:15:32 +01:00
}
arg_going = 1;
break;
case 'i':
Index: ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * c-decl.c (finish_decl): Handle 'used' here... * cgraphunit.c (cgraph_finalize_function): ... and here ... * c-common.c: (handle_used_attribute): ... not here. * configure.in (onstep): Support --enable-intermodule. * Makefile.in (OBJS-common): New. (OBJS-md): New. (OBJS-archive): New. (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive. (OBJS-onestep): New. (libbackend.a): Support @onestep@. (libbackend.o): New. * configure: Regenerate. * c-common.h (c_reset_state): New prototype. (c_parse_file): New prototype. (finish_file): Move prototype from c-tree.h. * c-decl.c: Include <hashtab.h>. (builtin_decls): New. (current_file_decl): New. (duplicate_decls): Add extra parameter. Change all callers. Don't output duplicate common symbols. (link_hash_hash): New. (link_hash_eq): New. (poplevel): Handle popping of the top level. (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL. (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate. (pushdecl_top_level): Likewise. (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL. (c_init_decl_processing): Create TRANSLATION_UNIT_DECL. (finish_decl): Handle TRANSLATION_UNIT_DECL. (merge_translation_unit_decls): New. (c_write_global_declarations): New. (c_reset_state): New. (implicitly_declare): Handle TRANSLATION_UNIT_DECL. * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New. * c-objc-common.c (c_cannot_inline_tree_fn): Handle TRANSLATION_UNIT_DECL. (c_objc_common_finish_file): Call merge_translation_unit_decls. * c-opts.c (in_fnames): Rename from in_fname. (c_common_decode_option): Handle multiple input filenames. (c_common_post_options): Likewise. (c_common_parse_file): Likewise; also, call c_parse_file rather than yyparse. * c-parse.in: Move cleanup code to c_parse_file. (free_parser_stacks): Move contents to c_parse_file. (c_parse_file): New. * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT for integer types. (C_DECL_FILE_SCOPE): New. (finish_file): Move prototype to c-common.h. (merge_translation_unit_decls): New prototype. (comptypes): Add extra parameter to prototype. (c_write_global_declarations): New prototype. * c-typeck.c (tagged_types_tu_compatible_p): New. (function_types_compatible_p): Add extra parameter, change all callers. (type_lists_compatible_p): Likewise. (comptypes): Likewise. (struct tagged_tu_seen): New. (tagged_tu_seen_base): New. (build_unary_op): Handle TRANSLATION_UNIT_DECL. (c_mark_addressable): Remove #if 0 code. * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add comment explaining why it shouldn't have to. * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY options. * cppinit.c (cpp_read_next_file): New. (cpp_read_main_file): Use it. * cpplib.c (undefine_macros): New. (cpp_undef_all): New. * cpplib.h (cpp_read_next_file): Prototype. (cpp_undef_all): Prototype. * langhooks-def.h (write_global_declarations): Remove prototype. * toplev.h (write_global_declarations): Add prototype. * tree.c (decl_type_context): Use switch statement, handle TRANSLATION_UNIT_DECL. * tree.def: Update documentation for TRANSLATION_UNIT_DECL. (TRANSLATION_UNIT_DECL): New kind of tree. * tree.h: Update documentation for TRANSLATION_UNIT_DECL. * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies. * doc/invoke.texi: Make attempt to document new functionality. 2003-05-19 Per Bothner <bothner@apple.com> * gcc.c (combine_inputs): New. (process_command): Set combine_inputs. (do_spec_1): Handle combine_inputs. (main): Likewise. Index: cp/ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * decl.c (cp_finish_decl): Handle 'used' attribute. * cp-lang.c (c_reset_state): New dummy routine. * cp-tree.h (finish_file): Move prototype to c-common.h. * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. From-SVN: r69224
2003-07-11 10:33:21 +02:00
if (combine_inputs)
{
for (i = 0; (int) i < n_infiles; i++)
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
if ((!infiles[i].language) || (infiles[i].language[0] != '*'))
if (infiles[i].incompiler == input_file_compiler)
{
store_arg (infiles[i].name, 0, 0);
infiles[i].compiled = true;
}
Index: ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * c-decl.c (finish_decl): Handle 'used' here... * cgraphunit.c (cgraph_finalize_function): ... and here ... * c-common.c: (handle_used_attribute): ... not here. * configure.in (onstep): Support --enable-intermodule. * Makefile.in (OBJS-common): New. (OBJS-md): New. (OBJS-archive): New. (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive. (OBJS-onestep): New. (libbackend.a): Support @onestep@. (libbackend.o): New. * configure: Regenerate. * c-common.h (c_reset_state): New prototype. (c_parse_file): New prototype. (finish_file): Move prototype from c-tree.h. * c-decl.c: Include <hashtab.h>. (builtin_decls): New. (current_file_decl): New. (duplicate_decls): Add extra parameter. Change all callers. Don't output duplicate common symbols. (link_hash_hash): New. (link_hash_eq): New. (poplevel): Handle popping of the top level. (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL. (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate. (pushdecl_top_level): Likewise. (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL. (c_init_decl_processing): Create TRANSLATION_UNIT_DECL. (finish_decl): Handle TRANSLATION_UNIT_DECL. (merge_translation_unit_decls): New. (c_write_global_declarations): New. (c_reset_state): New. (implicitly_declare): Handle TRANSLATION_UNIT_DECL. * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New. * c-objc-common.c (c_cannot_inline_tree_fn): Handle TRANSLATION_UNIT_DECL. (c_objc_common_finish_file): Call merge_translation_unit_decls. * c-opts.c (in_fnames): Rename from in_fname. (c_common_decode_option): Handle multiple input filenames. (c_common_post_options): Likewise. (c_common_parse_file): Likewise; also, call c_parse_file rather than yyparse. * c-parse.in: Move cleanup code to c_parse_file. (free_parser_stacks): Move contents to c_parse_file. (c_parse_file): New. * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT for integer types. (C_DECL_FILE_SCOPE): New. (finish_file): Move prototype to c-common.h. (merge_translation_unit_decls): New prototype. (comptypes): Add extra parameter to prototype. (c_write_global_declarations): New prototype. * c-typeck.c (tagged_types_tu_compatible_p): New. (function_types_compatible_p): Add extra parameter, change all callers. (type_lists_compatible_p): Likewise. (comptypes): Likewise. (struct tagged_tu_seen): New. (tagged_tu_seen_base): New. (build_unary_op): Handle TRANSLATION_UNIT_DECL. (c_mark_addressable): Remove #if 0 code. * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add comment explaining why it shouldn't have to. * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY options. * cppinit.c (cpp_read_next_file): New. (cpp_read_main_file): Use it. * cpplib.c (undefine_macros): New. (cpp_undef_all): New. * cpplib.h (cpp_read_next_file): Prototype. (cpp_undef_all): Prototype. * langhooks-def.h (write_global_declarations): Remove prototype. * toplev.h (write_global_declarations): Add prototype. * tree.c (decl_type_context): Use switch statement, handle TRANSLATION_UNIT_DECL. * tree.def: Update documentation for TRANSLATION_UNIT_DECL. (TRANSLATION_UNIT_DECL): New kind of tree. * tree.h: Update documentation for TRANSLATION_UNIT_DECL. * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies. * doc/invoke.texi: Make attempt to document new functionality. 2003-05-19 Per Bothner <bothner@apple.com> * gcc.c (combine_inputs): New. (process_command): Set combine_inputs. (do_spec_1): Handle combine_inputs. (main): Likewise. Index: cp/ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * decl.c (cp_finish_decl): Handle 'used' attribute. * cp-lang.c (c_reset_state): New dummy routine. * cp-tree.h (finish_file): Move prototype to c-common.h. * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. From-SVN: r69224
2003-07-11 10:33:21 +02:00
}
else
{
obstack_grow (&obstack, input_filename, input_filename_length);
arg_going = 1;
}
1992-02-01 06:15:32 +01:00
break;
case 'I':
{
struct spec_path_info info;
if (multilib_dir)
{
do_spec_1 ("-imultilib", 1, NULL);
/* Make this a separate argument. */
do_spec_1 (" ", 0, NULL);
do_spec_1 (multilib_dir, 1, NULL);
do_spec_1 (" ", 0, NULL);
}
if (gcc_exec_prefix)
{
do_spec_1 ("-iprefix", 1, NULL);
/* Make this a separate argument. */
do_spec_1 (" ", 0, NULL);
do_spec_1 (gcc_exec_prefix, 1, NULL);
do_spec_1 (" ", 0, NULL);
}
if (target_system_root_changed ||
(target_system_root && target_sysroot_hdrs_suffix))
{
do_spec_1 ("-isysroot", 1, NULL);
/* Make this a separate argument. */
do_spec_1 (" ", 0, NULL);
do_spec_1 (target_system_root, 1, NULL);
if (target_sysroot_hdrs_suffix)
do_spec_1 (target_sysroot_hdrs_suffix, 1, NULL);
do_spec_1 (" ", 0, NULL);
}
info.option = "-isystem";
info.append = "include";
info.append_len = strlen (info.append);
info.omit_relative = false;
info.separate_options = true;
for_each_path (&include_prefixes, false, info.append_len,
spec_path, &info);
info.append = "include-fixed";
re PR bootstrap/31020 (cannot write in </test/gnu/gcc/objdir/prev-gcc/../gcc/./include>) fixincludes: * mkheaders.in: Fix headers for each multilib required. gcc: PR bootstrap/31020 * configure.ac (CROSS_SYSTEM_HEADER_DIR, build_system_header_dir): Define using $${sysroot_headers_suffix}. * configure: Regenerate. * cppdefault.c (cpp_include_defaults): Make FIXED_INCLUDE_DIR a multilib-suffixed directory if SYSROOT_HEADERS_SUFFIX_SPEC defined. * doc/invoke.texi (-print-sysroot-headers-suffix): Document. * gcc.c (print_sysroot_headers_suffix): New. (option_map): Include --print-sysroot-headers-suffix. (display_help): Mention -print-sysroot-headers-suffix. (process_command): Handle -print-sysroot-headers-suffix. (do_spec_1): Append multilib directory to include-fixed path if sysroot suffixes in use. (main): Handle -print-sysroot-headers-suffix. * Makefile.in (start.encap): Don't depend on xlimits.h (xlimits.h): Remove. (stmp-int-hdrs): Don't depend on xlimits.h. Inline generation of limits.h for each multilib in fixinc_list. (fixinc_list, s-fixinc_list): New. (stmp-fixinc): Depend on fixinc_list. If not copying headers, generate them for each multilib in fixinc_list. (stmp-fixproto): Use include-fixed. Run fixproto for each multilib in fixinc_list. (mostlyclean): Don't remove xlimits.h. (clean): Remove include-fixed. (real-install-headers-tar, real-install-headers-cpio, real-install-headers-cp): Don't copy include, only include-fixed. (install-mkheaders): Depend on fixinc_list. Don't depend on xlimits.h. Save limits.h files for each multilib in fixinc_list. Always save mkinstalldirs. Preserve ${sysroot_headers_suffix} in SYSTEM_HEADER_DIR setting in mkheaders.conf. From-SVN: r122620
2007-03-06 16:50:28 +01:00
if (*sysroot_hdrs_suffix_spec)
info.append = concat (info.append, dir_separator_str,
multilib_dir, NULL);
info.append_len = strlen (info.append);
for_each_path (&include_prefixes, false, info.append_len,
spec_path, &info);
}
break;
1992-02-01 06:15:32 +01:00
case 'o':
{
int max = n_infiles;
max += lang_specific_extra_outfiles;
if (HAVE_GNU_LD && at_file_supplied)
{
/* We are going to expand `%o' to `@FILE', where FILE
is a newly-created temporary filename. The filenames
that would usually be expanded in place of %o will be
written to the temporary file. */
char *temp_file = make_temp_file ("");
char *at_argument;
char **argv;
int n_files, j, status;
FILE *f;
at_argument = concat ("@", temp_file, NULL);
store_arg (at_argument, 0, 0);
/* Convert OUTFILES into a form suitable for writeargv. */
/* Determine how many are non-NULL. */
for (n_files = 0, i = 0; i < max; i++)
n_files += outfiles[i] != NULL;
argv = alloca (sizeof (char *) * (n_files + 1));
/* Copy the strings over. */
for (i = 0, j = 0; i < max; i++)
if (outfiles[i])
{
argv[j] = (char *) outfiles[i];
j++;
}
argv[j] = NULL;
f = fopen (temp_file, "w");
if (f == NULL)
fatal ("could not open temporary response file %s",
temp_file);
status = writeargv (argv, f);
if (status)
fatal ("could not write to temporary response file %s",
temp_file);
status = fclose (f);
if (EOF == status)
fatal ("could not close temporary response file %s",
temp_file);
record_temp_file (temp_file, !save_temps_flag, !save_temps_flag);
}
else
for (i = 0; i < max; i++)
if (outfiles[i])
store_arg (outfiles[i], 0, 0);
break;
}
1992-02-01 06:15:32 +01:00
case 'O':
obstack_grow (&obstack, TARGET_OBJECT_SUFFIX, strlen (TARGET_OBJECT_SUFFIX));
arg_going = 1;
break;
1992-02-01 06:15:32 +01:00
case 's':
this_is_library_file = 1;
break;
case 'V':
outfiles[input_file_number] = NULL;
break;
1992-02-01 06:15:32 +01:00
case 'w':
this_is_output_file = 1;
break;
case 'W':
{
int cur_index = argbuf_index;
1992-02-01 06:15:32 +01:00
/* Handle the {...} following the %W. */
if (*p != '{')
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("spec '%s' has invalid '%%W%c", spec, *p);
1992-02-01 06:15:32 +01:00
p = handle_braces (p + 1);
if (p == 0)
return -1;
/* End any pending argument. */
if (arg_going)
{
obstack_1grow (&obstack, 0);
string = XOBFINISH (&obstack, const char *);
if (this_is_library_file)
string = find_file (string);
store_arg (string, delete_this_arg, this_is_output_file);
if (this_is_output_file)
outfiles[input_file_number] = string;
arg_going = 0;
}
1992-02-01 06:15:32 +01:00
/* If any args were output, mark the last one for deletion
on failure. */
if (argbuf_index != cur_index)
1992-02-01 06:15:32 +01:00
record_temp_file (argbuf[argbuf_index - 1], 0, 1);
break;
}
/* %x{OPTION} records OPTION for %X to output. */
case 'x':
{
const char *p1 = p;
1992-02-01 06:15:32 +01:00
char *string;
/* Skip past the option value and make a copy. */
if (*p != '{')
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("spec '%s' has invalid '%%x%c'", spec, *p);
1992-02-01 06:15:32 +01:00
while (*p++ != '}')
;
string = save_string (p1 + 1, p - p1 - 2);
/* See if we already recorded this option. */
for (i = 0; i < n_linker_options; i++)
if (! strcmp (string, linker_options[i]))
{
free (string);
return 0;
}
/* This option is new; add it. */
1998-07-13 19:20:29 +02:00
add_linker_option (string, strlen (string));
1992-02-01 06:15:32 +01:00
}
break;
/* Dump out the options accumulated previously using %x. */
1992-02-01 06:15:32 +01:00
case 'X':
for (i = 0; i < n_linker_options; i++)
{
do_spec_1 (linker_options[i], 1, NULL);
1992-02-01 06:15:32 +01:00
/* Make each accumulated option a separate argument. */
do_spec_1 (" ", 0, NULL);
1992-02-01 06:15:32 +01:00
}
break;
/* Dump out the options accumulated previously using -Wa,. */
case 'Y':
for (i = 0; i < n_assembler_options; i++)
{
do_spec_1 (assembler_options[i], 1, NULL);
/* Make each accumulated option a separate argument. */
do_spec_1 (" ", 0, NULL);
}
break;
/* Dump out the options accumulated previously using -Wp,. */
case 'Z':
for (i = 0; i < n_preprocessor_options; i++)
{
do_spec_1 (preprocessor_options[i], 1, NULL);
/* Make each accumulated option a separate argument. */
do_spec_1 (" ", 0, NULL);
}
break;
1992-02-01 06:15:32 +01:00
/* Here are digits and numbers that just process
a certain constant string as a spec. */
case '1':
value = do_spec_1 (cc1_spec, 0, NULL);
if (value != 0)
return value;
1992-02-01 06:15:32 +01:00
break;
case '2':
value = do_spec_1 (cc1plus_spec, 0, NULL);
if (value != 0)
return value;
1992-02-01 06:15:32 +01:00
break;
case 'a':
value = do_spec_1 (asm_spec, 0, NULL);
if (value != 0)
return value;
1992-02-01 06:15:32 +01:00
break;
case 'A':
value = do_spec_1 (asm_final_spec, 0, NULL);
if (value != 0)
return value;
1992-02-01 06:15:32 +01:00
break;
case 'C':
{
c-parse.in (yyerror): Const-ification and/or static-ization. * c-parse.in (yyerror): Const-ification and/or static-ization. * c-typeck.c (push_member_name): Likewise. * collect2.c (main): Likewise. * dbxout.c (dbxout_parms): Likewise. * diagnostic.c (format_with_decl): Likewise. * dwarf2out.c (output_ranges): Likewise. * dwarfout.c (fundamental_type_code): Likewise. * except.c (dw2_output_call_site_table): Likewise. * gcc.c (do_spec_1): Likewise. * genopinit.c (optabs): Likewise. * objc/objc-act.c (synth_id_with_class_suffix, start_class, gen_declaration_1, handle_impent): Likewise. * protoize.c (default_include, in_system_include_dir, abspath): Likewise. * sched-vis.c (visualize_stall_cycles): Likewise. * sdbout.c (plain_type_1, sdbout_end_function, sdbout_end_epilogue): Likewise. * varasm.c (decode_reg_name): Likewise. * 1750a.c (mod_regno_adjust): Likewise. * alpha.c (alpha_write_one_linkage, unicosmk_output_default_externs): Likewise. * arm.c (arm_condition_codes): Likewise. * arm.h (arm_condition_codes): Likewise. * avr.c (output_movsisf, encode_section_info): Likewise. * darwin.h (GEN_BINDER_NAME_FOR_STUB, GEN_SYMBOL_NAME_FOR_SYMBOL): Likewise. * i386.c (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. * i386.h (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. * m88k.c (output_function_profiler): Likewise. * mips.c (mips_output_conditional_branch): Likewise. * ns32k.c (ns32k_out_reg_names): Likewise. * ns32k.h (ns32k_out_reg_names): Likewise. * pj.c (pj_output_rval): Likewise. * rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Likewise. * sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue): Likewise. cp: * decl.c (warn_extern_redeclared_static, cp_make_fname_decl): Const-ification. * pt.c (tsubst_decl): Likewise. f: * bad.c (ffebad_finish): Const-ification and/or static-ization. * intrin.c (ffeintrin_cmp_name_): Likewise. * stc.c (ffestc_R904): Likewise. java: * expr.c (expand_invoke): Const-ification. * parse.y (patch_method_invocation): Likewise. From-SVN: r45581
2001-09-13 16:37:29 +02:00
const char *const spec
= (input_file_compiler->cpp_spec
? input_file_compiler->cpp_spec
: cpp_spec);
value = do_spec_1 (spec, 0, NULL);
if (value != 0)
return value;
}
1992-02-01 06:15:32 +01:00
break;
case 'E':
value = do_spec_1 (endfile_spec, 0, NULL);
if (value != 0)
return value;
1992-02-01 06:15:32 +01:00
break;
case 'l':
value = do_spec_1 (link_spec, 0, NULL);
if (value != 0)
return value;
1992-02-01 06:15:32 +01:00
break;
case 'L':
value = do_spec_1 (lib_spec, 0, NULL);
if (value != 0)
return value;
1992-02-01 06:15:32 +01:00
break;
case 'G':
value = do_spec_1 (libgcc_spec, 0, NULL);
if (value != 0)
return value;
break;
case 'R':
/* We assume there is a directory
separator at the end of this string. */
if (target_system_root)
{
obstack_grow (&obstack, target_system_root,
strlen (target_system_root));
if (target_sysroot_suffix)
obstack_grow (&obstack, target_sysroot_suffix,
strlen (target_sysroot_suffix));
}
break;
1992-02-01 06:15:32 +01:00
case 'S':
value = do_spec_1 (startfile_spec, 0, NULL);
if (value != 0)
return value;
1992-02-01 06:15:32 +01:00
break;
/* Here we define characters other than letters and digits. */
case '{':
p = handle_braces (p);
if (p == 0)
return -1;
break;
case ':':
p = handle_spec_function (p);
if (p == 0)
return -1;
break;
1992-02-01 06:15:32 +01:00
case '%':
obstack_1grow (&obstack, '%');
break;
case '.':
{
unsigned len = 0;
while (p[len] && p[len] != ' ' && p[len] != '%')
len++;
suffix_subst = save_string (p - 1, len + 1);
p += len;
}
break;
/* Henceforth ignore the option(s) matching the pattern
after the %<. */
case '<':
{
unsigned len = 0;
int have_wildcard = 0;
int i;
while (p[len] && p[len] != ' ' && p[len] != '\t')
len++;
if (p[len-1] == '*')
have_wildcard = 1;
for (i = 0; i < n_switches; i++)
if (!strncmp (switches[i].part1, p, len - have_wildcard)
&& (have_wildcard || switches[i].part1[len] == '\0'))
{
switches[i].live_cond = SWITCH_IGNORE;
switches[i].validated = 1;
}
p += len;
}
break;
1992-02-01 06:15:32 +01:00
case '*':
if (soft_matched_part)
{
do_spec_1 (soft_matched_part, 1, NULL);
do_spec_1 (" ", 0, NULL);
}
else
/* Catch the case where a spec string contains something like
'%{foo:%*}'. i.e. there is no * in the pattern on the left
hand side of the :. */
error ("spec failure: '%%*' has not been initialized by pattern match");
1992-02-01 06:15:32 +01:00
break;
/* Process a string found as the value of a spec given by name.
This feature allows individual machine descriptions
to add and use their own specs.
%[...] modifies -D options the way %P does;
%(...) uses the spec unmodified. */
case '[':
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics. * c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
2001-12-02 01:04:36 +01:00
error ("warning: use of obsolete %%[ operator in specs");
1992-02-01 06:15:32 +01:00
case '(':
{
const char *name = p;
1992-02-01 06:15:32 +01:00
struct spec_list *sl;
int len;
/* The string after the S/P is the name of a spec that is to be
1996-07-04 00:07:53 +02:00
processed. */
while (*p && *p != ')' && *p != ']')
1992-02-01 06:15:32 +01:00
p++;
/* See if it's in the list. */
1992-02-01 06:15:32 +01:00
for (len = p - name, sl = specs; sl; sl = sl->next)
1997-01-16 23:15:53 +01:00
if (sl->name_len == len && !strncmp (sl->name, name, len))
1992-02-01 06:15:32 +01:00
{
1997-01-16 23:15:53 +01:00
name = *(sl->ptr_spec);
#ifdef DEBUG_SPECS
notice ("Processing spec %c%s%c, which is '%s'\n",
c, sl->name, (c == '(') ? ')' : ']', name);
#endif
1992-02-01 06:15:32 +01:00
break;
}
if (sl)
{
if (c == '(')
{
value = do_spec_1 (name, 0, NULL);
if (value != 0)
return value;
}
else
{
char *x = alloca (strlen (name) * 2 + 1);
char *buf = x;
const char *y = name;
int flag = 0;
/* Copy all of NAME into BUF, but put __ after
every -D and at the end of each arg. */
while (1)
{
if (! strncmp (y, "-D", 2))
{
*x++ = '-';
*x++ = 'D';
*x++ = '_';
*x++ = '_';
y += 2;
flag = 1;
continue;
}
else if (flag
&& (*y == ' ' || *y == '\t' || *y == '='
|| *y == '}' || *y == 0))
{
*x++ = '_';
*x++ = '_';
flag = 0;
}
if (*y == 0)
break;
else
*x++ = *y++;
}
*x = 0;
value = do_spec_1 (buf, 0, NULL);
if (value != 0)
return value;
}
1992-02-01 06:15:32 +01:00
}
/* Discard the closing paren or bracket. */
if (*p)
p++;
1992-02-01 06:15:32 +01:00
}
break;
default:
error ("spec failure: unrecognized spec option '%c'", c);
break;
1992-02-01 06:15:32 +01:00
}
break;
case '\\':
/* Backslash: treat next character as ordinary. */
c = *p++;
/* Fall through. */
1992-02-01 06:15:32 +01:00
default:
/* Ordinary character: put it into the current argument. */
obstack_1grow (&obstack, c);
arg_going = 1;
}
/* End of string. If we are processing a spec function, we need to
end any pending argument. */
if (processing_spec_function && arg_going)
{
obstack_1grow (&obstack, 0);
string = XOBFINISH (&obstack, const char *);
if (this_is_library_file)
string = find_file (string);
store_arg (string, delete_this_arg, this_is_output_file);
if (this_is_output_file)
outfiles[input_file_number] = string;
arg_going = 0;
}
return 0;
1992-02-01 06:15:32 +01:00
}
/* Look up a spec function. */
static const struct spec_function *
lookup_spec_function (const char *name)
{
const struct spec_function *sf;
for (sf = static_spec_functions; sf->name != NULL; sf++)
if (strcmp (sf->name, name) == 0)
return sf;
return NULL;
}
/* Evaluate a spec function. */
static const char *
eval_spec_function (const char *func, const char *args)
{
const struct spec_function *sf;
const char *funcval;
/* Saved spec processing context. */
int save_argbuf_index;
int save_argbuf_length;
const char **save_argbuf;
int save_arg_going;
int save_delete_this_arg;
int save_this_is_output_file;
int save_this_is_library_file;
int save_input_from_pipe;
const char *save_suffix_subst;
sf = lookup_spec_function (func);
if (sf == NULL)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("unknown spec function '%s'", func);
/* Push the spec processing context. */
save_argbuf_index = argbuf_index;
save_argbuf_length = argbuf_length;
save_argbuf = argbuf;
save_arg_going = arg_going;
save_delete_this_arg = delete_this_arg;
save_this_is_output_file = this_is_output_file;
save_this_is_library_file = this_is_library_file;
save_input_from_pipe = input_from_pipe;
save_suffix_subst = suffix_subst;
/* Create a new spec processing context, and build the function
arguments. */
alloc_args ();
if (do_spec_2 (args) < 0)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("error in args to spec function '%s'", func);
/* argbuf_index is an index for the next argument to be inserted, and
so contains the count of the args already inserted. */
funcval = (*sf->func) (argbuf_index, argbuf);
/* Pop the spec processing context. */
argbuf_index = save_argbuf_index;
argbuf_length = save_argbuf_length;
free (argbuf);
argbuf = save_argbuf;
arg_going = save_arg_going;
delete_this_arg = save_delete_this_arg;
this_is_output_file = save_this_is_output_file;
this_is_library_file = save_this_is_library_file;
input_from_pipe = save_input_from_pipe;
suffix_subst = save_suffix_subst;
return funcval;
}
/* Handle a spec function call of the form:
%:function(args)
ARGS is processed as a spec in a separate context and split into an
argument vector in the normal fashion. The function returns a string
containing a spec which we then process in the caller's context, or
NULL if no processing is required. */
static const char *
handle_spec_function (const char *p)
{
char *func, *args;
const char *endp, *funcval;
int count;
processing_spec_function++;
/* Get the function name. */
for (endp = p; *endp != '\0'; endp++)
{
if (*endp == '(') /* ) */
break;
/* Only allow [A-Za-z0-9], -, and _ in function names. */
if (!ISALNUM (*endp) && !(*endp == '-' || *endp == '_'))
fatal ("malformed spec function name");
}
if (*endp != '(') /* ) */
fatal ("no arguments for spec function");
func = save_string (p, endp - p);
p = ++endp;
/* Get the arguments. */
for (count = 0; *endp != '\0'; endp++)
{
/* ( */
if (*endp == ')')
{
if (count == 0)
break;
count--;
}
else if (*endp == '(') /* ) */
count++;
}
/* ( */
if (*endp != ')')
fatal ("malformed spec function arguments");
args = save_string (p, endp - p);
p = ++endp;
/* p now points to just past the end of the spec function expression. */
funcval = eval_spec_function (func, args);
if (funcval != NULL && do_spec_1 (funcval, 0, NULL) < 0)
p = NULL;
free (func);
free (args);
processing_spec_function--;
return p;
}
/* Inline subroutine of handle_braces. Returns true if the current
input suffix matches the atom bracketed by ATOM and END_ATOM. */
static inline bool
input_suffix_matches (const char *atom, const char *end_atom)
{
return (input_suffix
&& !strncmp (input_suffix, atom, end_atom - atom)
&& input_suffix[end_atom - atom] == '\0');
}
1992-02-01 06:15:32 +01:00
/* Subroutine of handle_braces. Returns true if the current
input file's spec name matches the atom bracketed by ATOM and END_ATOM. */
static bool
input_spec_matches (const char *atom, const char *end_atom)
{
return (input_file_compiler
&& input_file_compiler->suffix
&& input_file_compiler->suffix[0] != '\0'
&& !strncmp (input_file_compiler->suffix + 1, atom,
end_atom - atom)
&& input_file_compiler->suffix[end_atom - atom + 1] == '\0');
}
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
/* Subroutine of handle_braces. Returns true if a switch
matching the atom bracketed by ATOM and END_ATOM appeared on the
command line. */
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
static bool
switch_matches (const char *atom, const char *end_atom, int starred)
1992-02-01 06:15:32 +01:00
{
int i;
int len = end_atom - atom;
int plen = starred ? len : -1;
1992-02-01 06:15:32 +01:00
for (i = 0; i < n_switches; i++)
if (!strncmp (switches[i].part1, atom, len)
&& (starred || switches[i].part1[len] == '\0')
&& check_live_switch (i, plen))
return true;
return false;
}
1992-02-01 06:15:32 +01:00
/* Inline subroutine of handle_braces. Mark all of the switches which
match ATOM (extends to END_ATOM; STARRED indicates whether there
was a star after the atom) for later processing. */
static inline void
mark_matching_switches (const char *atom, const char *end_atom, int starred)
{
int i;
int len = end_atom - atom;
int plen = starred ? len : -1;
for (i = 0; i < n_switches; i++)
if (!strncmp (switches[i].part1, atom, len)
&& (starred || switches[i].part1[len] == '\0')
&& check_live_switch (i, plen))
switches[i].ordering = 1;
}
/* Inline subroutine of handle_braces. Process all the currently
marked switches through give_switch, and clear the marks. */
static inline void
process_marked_switches (void)
{
int i;
1992-02-01 06:15:32 +01:00
for (i = 0; i < n_switches; i++)
if (switches[i].ordering == 1)
{
switches[i].ordering = 0;
give_switch (i, 0);
}
}
1992-02-01 06:15:32 +01:00
/* Handle a %{ ... } construct. P points just inside the leading {.
Returns a pointer one past the end of the brace block, or 0
if we call do_spec_1 and that returns -1. */
1992-02-01 06:15:32 +01:00
static const char *
handle_braces (const char *p)
{
const char *atom, *end_atom;
const char *d_atom = NULL, *d_end_atom = NULL;
const char *orig = p;
bool a_is_suffix;
bool a_is_spectype;
bool a_is_starred;
bool a_is_negated;
bool a_matched;
bool a_must_be_last = false;
bool ordered_set = false;
bool disjunct_set = false;
bool disj_matched = false;
bool disj_starred = true;
bool n_way_choice = false;
bool n_way_matched = false;
#define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0)
do
1992-02-01 06:15:32 +01:00
{
if (a_must_be_last)
goto invalid;
/* Scan one "atom" (S in the description above of %{}, possibly
with '!', '.', '@', ',', or '*' modifiers). */
a_matched = false;
a_is_suffix = false;
a_is_starred = false;
a_is_negated = false;
a_is_spectype = false;
SKIP_WHITE();
if (*p == '!')
p++, a_is_negated = true;
1992-02-01 06:15:32 +01:00
SKIP_WHITE();
if (*p == '.')
p++, a_is_suffix = true;
else if (*p == ',')
p++, a_is_spectype = true;
1992-02-01 06:15:32 +01:00
atom = p;
while (ISIDNUM(*p) || *p == '-' || *p == '+' || *p == '='
|| *p == ',' || *p == '.' || *p == '@')
p++;
end_atom = p;
1992-02-01 06:15:32 +01:00
if (*p == '*')
p++, a_is_starred = 1;
SKIP_WHITE();
switch (*p)
{
case '&': case '}':
/* Substitute the switch(es) indicated by the current atom. */
ordered_set = true;
if (disjunct_set || n_way_choice || a_is_negated || a_is_suffix
|| a_is_spectype || atom == end_atom)
goto invalid;
1992-02-01 06:15:32 +01:00
mark_matching_switches (atom, end_atom, a_is_starred);
if (*p == '}')
process_marked_switches ();
break;
case '|': case ':':
/* Substitute some text if the current atom appears as a switch
or suffix. */
disjunct_set = true;
if (ordered_set)
goto invalid;
1992-02-01 06:15:32 +01:00
if (atom == end_atom)
1992-02-01 06:15:32 +01:00
{
if (!n_way_choice || disj_matched || *p == '|'
|| a_is_negated || a_is_suffix || a_is_spectype
|| a_is_starred)
goto invalid;
/* An empty term may appear as the last choice of an
N-way choice set; it means "otherwise". */
a_must_be_last = true;
disj_matched = !n_way_matched;
disj_starred = false;
1992-02-01 06:15:32 +01:00
}
else
1992-02-01 06:15:32 +01:00
{
if ((a_is_suffix || a_is_spectype) && a_is_starred)
goto invalid;
if (!a_is_starred)
disj_starred = false;
/* Don't bother testing this atom if we already have a
match. */
if (!disj_matched && !n_way_matched)
{
if (a_is_suffix)
a_matched = input_suffix_matches (atom, end_atom);
else if (a_is_spectype)
a_matched = input_spec_matches (atom, end_atom);
else
a_matched = switch_matches (atom, end_atom, a_is_starred);
if (a_matched != a_is_negated)
{
disj_matched = true;
d_atom = atom;
d_end_atom = end_atom;
}
}
1992-02-01 06:15:32 +01:00
}
if (*p == ':')
1992-02-01 06:15:32 +01:00
{
/* Found the body, that is, the text to substitute if the
current disjunction matches. */
p = process_brace_body (p + 1, d_atom, d_end_atom, disj_starred,
disj_matched && !n_way_matched);
if (p == 0)
return 0;
1992-02-01 06:15:32 +01:00
/* If we have an N-way choice, reset state for the next
disjunction. */
if (*p == ';')
1992-02-01 06:15:32 +01:00
{
n_way_choice = true;
n_way_matched |= disj_matched;
disj_matched = false;
disj_starred = true;
d_atom = d_end_atom = NULL;
1992-02-01 06:15:32 +01:00
}
}
break;
default:
goto invalid;
1992-02-01 06:15:32 +01:00
}
}
while (*p++ != '}');
1992-02-01 06:15:32 +01:00
return p;
invalid:
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("braced spec '%s' is invalid at '%c'", orig, *p);
#undef SKIP_WHITE
}
/* Subroutine of handle_braces. Scan and process a brace substitution body
(X in the description of %{} syntax). P points one past the colon;
ATOM and END_ATOM bracket the first atom which was found to be true
(present) in the current disjunction; STARRED indicates whether all
the atoms in the current disjunction were starred (for syntax validation);
MATCHED indicates whether the disjunction matched or not, and therefore
whether or not the body is to be processed through do_spec_1 or just
skipped. Returns a pointer to the closing } or ;, or 0 if do_spec_1
returns -1. */
static const char *
process_brace_body (const char *p, const char *atom, const char *end_atom,
int starred, int matched)
{
const char *body, *end_body;
unsigned int nesting_level;
bool have_subst = false;
/* Locate the closing } or ;, honoring nested braces.
Trim trailing whitespace. */
body = p;
nesting_level = 1;
for (;;)
{
if (*p == '{')
nesting_level++;
else if (*p == '}')
1992-02-01 06:15:32 +01:00
{
if (!--nesting_level)
break;
1992-02-01 06:15:32 +01:00
}
else if (*p == ';' && nesting_level == 1)
break;
else if (*p == '%' && p[1] == '*' && nesting_level == 1)
have_subst = true;
else if (*p == '\0')
goto invalid;
p++;
1992-02-01 06:15:32 +01:00
}
end_body = p;
while (end_body[-1] == ' ' || end_body[-1] == '\t')
end_body--;
1992-02-01 06:15:32 +01:00
if (have_subst && !starred)
goto invalid;
if (matched)
{
/* Copy the substitution body to permanent storage and execute it.
If have_subst is false, this is a simple matter of running the
body through do_spec_1... */
char *string = save_string (body, end_body - body);
if (!have_subst)
{
if (do_spec_1 (string, 0, NULL) < 0)
return 0;
}
else
{
/* ... but if have_subst is true, we have to process the
body once for each matching switch, with %* set to the
variant part of the switch. */
unsigned int hard_match_len = end_atom - atom;
int i;
for (i = 0; i < n_switches; i++)
if (!strncmp (switches[i].part1, atom, hard_match_len)
&& check_live_switch (i, hard_match_len))
{
if (do_spec_1 (string, 0,
&switches[i].part1[hard_match_len]) < 0)
return 0;
/* Pass any arguments this switch has. */
give_switch (i, 1);
suffix_subst = NULL;
}
}
}
return p;
invalid:
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("braced spec body '%s' is invalid", body);
1992-02-01 06:15:32 +01:00
}
/* Return 0 iff switch number SWITCHNUM is obsoleted by a later switch
on the command line. PREFIX_LENGTH is the length of XXX in an {XXX*}
spec, or -1 if either exact match or %* is used.
A -O switch is obsoleted by a later -O switch. A -f, -m, or -W switch
whose value does not begin with "no-" is obsoleted by the same value
with the "no-", similarly for a switch with the "no-" prefix. */
static int
check_live_switch (int switchnum, int prefix_length)
{
const char *name = switches[switchnum].part1;
int i;
/* In the common case of {<at-most-one-letter>*}, a negating
switch would always match, so ignore that case. We will just
send the conflicting switches to the compiler phase. */
if (prefix_length >= 0 && prefix_length <= 1)
return 1;
/* If we already processed this switch and determined if it was
live or not, return our past determination. */
if (switches[switchnum].live_cond != 0)
return switches[switchnum].live_cond > 0;
/* Now search for duplicate in a manner that depends on the name. */
switch (*name)
{
case 'O':
for (i = switchnum + 1; i < n_switches; i++)
if (switches[i].part1[0] == 'O')
{
switches[switchnum].validated = 1;
switches[switchnum].live_cond = SWITCH_FALSE;
return 0;
}
break;
1992-02-01 06:15:32 +01:00
case 'W': case 'f': case 'm':
if (! strncmp (name + 1, "no-", 3))
{
1996-07-04 00:07:53 +02:00
/* We have Xno-YYY, search for XYYY. */
for (i = switchnum + 1; i < n_switches; i++)
if (switches[i].part1[0] == name[0]
&& ! strcmp (&switches[i].part1[1], &name[4]))
{
switches[switchnum].validated = 1;
switches[switchnum].live_cond = SWITCH_FALSE;
return 0;
}
}
else
{
/* We have XYYY, search for Xno-YYY. */
for (i = switchnum + 1; i < n_switches; i++)
if (switches[i].part1[0] == name[0]
&& switches[i].part1[1] == 'n'
&& switches[i].part1[2] == 'o'
&& switches[i].part1[3] == '-'
&& !strcmp (&switches[i].part1[4], &name[1]))
{
switches[switchnum].validated = 1;
switches[switchnum].live_cond = SWITCH_FALSE;
return 0;
}
}
break;
}
/* Otherwise the switch is live. */
switches[switchnum].live_cond = SWITCH_LIVE;
return 1;
}
1992-02-01 06:15:32 +01:00
/* Pass a switch to the current accumulating command
in the same form that we received it.
SWITCHNUM identifies the switch; it is an index into
the vector of switches gcc received, which is `switches'.
This cannot fail since it never finishes a command line.
If OMIT_FIRST_WORD is nonzero, then we omit .part1 of the argument. */
1992-02-01 06:15:32 +01:00
static void
give_switch (int switchnum, int omit_first_word)
1992-02-01 06:15:32 +01:00
{
if (switches[switchnum].live_cond == SWITCH_IGNORE)
return;
1992-02-01 06:15:32 +01:00
if (!omit_first_word)
{
do_spec_1 ("-", 0, NULL);
do_spec_1 (switches[switchnum].part1, 1, NULL);
1992-02-01 06:15:32 +01:00
}
1992-02-01 06:15:32 +01:00
if (switches[switchnum].args != 0)
{
const char **p;
1992-02-01 06:15:32 +01:00
for (p = switches[switchnum].args; *p; p++)
{
const char *arg = *p;
do_spec_1 (" ", 0, NULL);
if (suffix_subst)
{
unsigned length = strlen (arg);
int dot = 0;
while (length-- && !IS_DIR_SEPARATOR (arg[length]))
if (arg[length] == '.')
{
((char *)arg)[length] = 0;
dot = 1;
break;
}
do_spec_1 (arg, 1, NULL);
if (dot)
((char *)arg)[length] = '.';
do_spec_1 (suffix_subst, 1, NULL);
}
else
do_spec_1 (arg, 1, NULL);
1992-02-01 06:15:32 +01:00
}
}
do_spec_1 (" ", 0, NULL);
switches[switchnum].validated = 1;
1992-02-01 06:15:32 +01:00
}
/* Search for a file named NAME trying various prefixes including the
user's -B prefix and some standard ones.
Return the absolute file name found. If nothing is found, return NAME. */
static const char *
find_file (const char *name)
1992-02-01 06:15:32 +01:00
{
char *newname = find_a_file (&startfile_prefixes, name, R_OK, true);
1992-02-01 06:15:32 +01:00
return newname ? newname : name;
}
/* Determine whether a directory exists. If LINKER, return 0 for
certain fixed names not needed by the linker. */
1992-02-01 06:15:32 +01:00
static int
is_directory (const char *path1, bool linker)
1992-02-01 06:15:32 +01:00
{
int len1;
char *path;
1992-02-01 06:15:32 +01:00
char *cp;
struct stat st;
/* Ensure the string ends with "/.". The resulting path will be a
directory even if the given path is a symbolic link. */
len1 = strlen (path1);
path = alloca (3 + len1);
memcpy (path, path1, len1);
cp = path + len1;
if (!IS_DIR_SEPARATOR (cp[-1]))
*cp++ = DIR_SEPARATOR;
1992-02-01 06:15:32 +01:00
*cp++ = '.';
*cp = '\0';
/* Exclude directories that the linker is known to search. */
if (linker
&& IS_DIR_SEPARATOR (path[0])
&& ((cp - path == 6
&& strncmp (path + 1, "lib", 3) == 0)
|| (cp - path == 10
&& strncmp (path + 1, "usr", 3) == 0
&& IS_DIR_SEPARATOR (path[4])
&& strncmp (path + 5, "lib", 3) == 0)))
1992-02-01 06:15:32 +01:00
return 0;
return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));
}
/* Set up the various global variables to indicate that we're processing
the input file named FILENAME. */
void
set_input (const char *filename)
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
const char *p;
input_filename = filename;
input_filename_length = strlen (input_filename);
input_basename = input_filename;
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
/* Skip drive name so 'x:foo' is handled properly. */
if (input_basename[1] == ':')
input_basename += 2;
#endif
for (p = input_basename; *p; p++)
if (IS_DIR_SEPARATOR (*p))
input_basename = p + 1;
/* Find a suffix starting with the last period,
and set basename_length to exclude that suffix. */
basename_length = strlen (input_basename);
suffixed_basename_length = basename_length;
p = input_basename + basename_length;
while (p != input_basename && *p != '.')
--p;
if (*p == '.' && p != input_basename)
{
basename_length = p - input_basename;
input_suffix = p + 1;
}
else
input_suffix = "";
/* If a spec for 'g', 'u', or 'U' is seen with -save-temps then
we will need to do a stat on the input_filename. The
INPUT_STAT_SET signals that the stat is needed. */
input_stat_set = 0;
}
1992-02-01 06:15:32 +01:00
/* On fatal signals, delete all the temporary files. */
static void
fatal_error (int signum)
1992-02-01 06:15:32 +01:00
{
signal (signum, SIG_DFL);
delete_failure_queue ();
delete_temp_files ();
/* Get the same signal again, this time not handled,
so its normal effect occurs. */
kill (getpid (), signum);
}
extern int main (int, char **);
1992-02-01 06:15:32 +01:00
int
main (int argc, char **argv)
1992-02-01 06:15:32 +01:00
{
size_t i;
1992-02-01 06:15:32 +01:00
int value;
int linker_was_run = 0;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
int lang_n_infiles = 0;
int num_linker_inputs = 0;
1992-02-01 06:15:32 +01:00
char *explicit_link_files;
char *specs_file;
const char *p;
1996-10-29 22:21:57 +01:00
struct user_specs *uptr;
char **old_argv = argv;
1992-02-01 06:15:32 +01:00
p = argv[0] + strlen (argv[0]);
while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
--p;
programname = p;
1992-02-01 06:15:32 +01:00
xmalloc_set_program_name (programname);
expandargv (&argc, &argv);
/* Determine if any expansions were made. */
if (argv != old_argv)
at_file_supplied = true;
re PR target/26885 (-m64 -m32 no longer creates 32-bit object) gcc/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Makefile.in (GCC_OBJS): New. (OBJS-common): Add opts-common.o. (xgcc$(exeext)): Replace gcc.o with $(GCC_OBJS). (cpp$(exeext)): Likewise. (gcc.o): Also depend on opts.h. (opts-common.o): New. * common.opt (gcoff): Add Negative(gdwarf-2). (gdwarf-2): Add Negative(gstabs). (gstabs): Add Negative(gstabs+). (gstabs+): Add Negative(gvms). (gvms): Add Negative(gxcoff). (gxcoff): Add Negative(gxcoff+). (gxcoff+): Add Negative(gcoff). * config/i386/i386.opt (m32): Add Negative(m64). (m64): Add Negative(m32). * doc/options.texi: Document the Negative option. * gcc.c: Include "opts.h". (main): Call prune_options after expandargv. * optc-gen.awk: Generate common declarations for all flag variables in options.c. Output the neg_index field. * opts.c (find_opt): Moved to ... * opts-common.c: Here. New file. * opts.h (cl_option): Add a neg_index field. (find_opt): New. (prune_options): Likewise. gcc/cp/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (GXX_OBJS): Replace gcc.o with $(GCC_OBJS). gcc/fortran/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (GFORTRAN_D_OBJS): Replace gcc.o with $(GCC_OBJS). gcc/java/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in ($(GCJ)$(exeext)): Replace gcc.o with $(GCC_OBJS). gcc/treelang/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (gtreelang$(exeext)): Replace gcc.o with $(GCC_OBJS). From-SVN: r113824
2006-05-16 16:27:18 +02:00
prune_options (&argc, &argv);
#ifdef GCC_DRIVER_HOST_INITIALIZATION
/* Perform host dependent initialization when needed. */
GCC_DRIVER_HOST_INITIALIZATION;
#endif
/* Unlock the stdio streams. */
unlock_std_streams ();
gcc_init_libintl ();
1992-02-01 06:15:32 +01:00
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
signal (SIGINT, fatal_error);
#ifdef SIGHUP
1992-02-01 06:15:32 +01:00
if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
signal (SIGHUP, fatal_error);
#endif
1992-02-01 06:15:32 +01:00
if (signal (SIGTERM, SIG_IGN) != SIG_IGN)
signal (SIGTERM, fatal_error);
#ifdef SIGPIPE
if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
signal (SIGPIPE, fatal_error);
#endif
#ifdef SIGCHLD
2001-03-09 00:26:14 +01:00
/* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will
receive the signal. A different setting is inheritable */
signal (SIGCHLD, SIG_DFL);
#endif
1992-02-01 06:15:32 +01:00
/* Allocate the argument vector. */
alloc_args ();
1992-02-01 06:15:32 +01:00
obstack_init (&obstack);
/* Build multilib_select, et. al from the separate lines that make up each
multilib selection. */
{
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *const *q = multilib_raw;
int need_space;
obstack_init (&multilib_obstack);
1996-07-04 00:07:53 +02:00
while ((p = *q++) != (char *) 0)
obstack_grow (&multilib_obstack, p, strlen (p));
obstack_1grow (&multilib_obstack, 0);
multilib_select = XOBFINISH (&multilib_obstack, const char *);
q = multilib_matches_raw;
while ((p = *q++) != (char *) 0)
obstack_grow (&multilib_obstack, p, strlen (p));
obstack_1grow (&multilib_obstack, 0);
multilib_matches = XOBFINISH (&multilib_obstack, const char *);
q = multilib_exclusions_raw;
while ((p = *q++) != (char *) 0)
obstack_grow (&multilib_obstack, p, strlen (p));
obstack_1grow (&multilib_obstack, 0);
multilib_exclusions = XOBFINISH (&multilib_obstack, const char *);
need_space = FALSE;
optabs.c (init_optabs): Initialize fixtab... * optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab, and extendtab within their proper array boundaries. * emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds for the entire array. * config/arm/arm.c (arm_override_options): Use ARRAY_SIZE. * config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise. * config/avr/avr.c (order_regs_for_local_alloc): Likewise. * config/fr30/fr30.c (fr30_print_operand): Likewise. * config/i386/dgux.c (output_options): Likewise. * config/i386/dgux.h (ASM_FILE_START): Likewise. * config/m88k/m88k.c (output_options): Likewise. * config/m88k/m88k.h (ASM_FILE_START): Likewise. * config/mcore/mcore.c (mcore_output_inline_const_forced, layout_mcore_frame, handle_structs_in_regs): Likewise. * config/mips/mips.c (output_block_move): Likewise. * config/rs6000/rs6000.c (rs6000_override_options, rs6000_file_start): Likewise. * config/sparc/sparc.c (sparc_add_gc_roots): Likewise. * fixinc/fixfixes.c (FIX_TABLE_CT): Likewise. * fixinc/fixtests.c (TEST_TABLE_CT): Likewise. * builtins.c (expand_builtin_setjmp): Likewise. * expr.c (safe_from_p): Likewise. * flow.c (life_analysis): Likewise. * fold-const.c (size_int_type_wide): Likewise. * gcc.c (translate_options, init_spec, set_spec, main): Likewise. * genattrtab.c (make_length_attrs): Likewise. * genopinit.c (gen_insn): Likewise. * genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise. * global.c (global_alloc): Likewise. * local-alloc.c (find_free_reg): Likewise. * mips-tdump.c (print_symbol): Likewise. * mips-tfile.c (parse_def, parse_input): Likewise. * reload1.c (NUM_ELIMINABLE_REGS): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * stor-layout.c (set_sizetype): Likewise. * varasm.c (decode_reg_name): Likewise. * toplev.c (decode_f_option, decode_W_option, set_target_switch, print_switch_values): Likewise. (NUM_ELEM): Remove macro. (display_help, main): s/NUM_ELEM/ARRAY_SIZE/ From-SVN: r35949
2000-08-24 22:31:35 +02:00
for (i = 0; i < ARRAY_SIZE (multilib_defaults_raw); i++)
{
if (need_space)
obstack_1grow (&multilib_obstack, ' ');
obstack_grow (&multilib_obstack,
multilib_defaults_raw[i],
strlen (multilib_defaults_raw[i]));
need_space = TRUE;
}
obstack_1grow (&multilib_obstack, 0);
multilib_defaults = XOBFINISH (&multilib_obstack, const char *);
}
/* Set up to remember the pathname of gcc and any options
needed for collect. We use argv[0] instead of programname because
we need the complete pathname. */
obstack_init (&collect_obstack);
obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=") - 1);
obstack_grow (&collect_obstack, argv[0], strlen (argv[0]) + 1);
putenv (XOBFINISH (&collect_obstack, char *));
#ifdef INIT_ENVIRONMENT
/* Set up any other necessary machine specific environment variables. */
putenv (INIT_ENVIRONMENT);
#endif
1992-02-01 06:15:32 +01:00
/* Make a table of what switches there are (switches, n_switches).
Make a table of specified input files (infiles, n_infiles).
Decode switches that are handled locally. */
process_command (argc, (const char **) argv);
1992-02-01 06:15:32 +01:00
/* Initialize the vector of specs to just the default.
This means one element containing 0s, as a terminator. */
compilers = xmalloc (sizeof default_compilers);
memcpy (compilers, default_compilers, sizeof default_compilers);
1992-02-01 06:15:32 +01:00
n_compilers = n_default_compilers;
/* Read specs from a file if there is one. */
machine_suffix = concat (spec_machine, dir_separator_str,
spec_version, dir_separator_str, NULL);
just_machine_suffix = concat (spec_machine, dir_separator_str, NULL);
1992-02-01 06:15:32 +01:00
specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, true);
1992-02-01 06:15:32 +01:00
/* Read the specs file unless it is a default one. */
if (specs_file != 0 && strcmp (specs_file, "specs"))
read_specs (specs_file, TRUE);
else
init_spec ();
1996-01-18 16:19:51 +01:00
/* We need to check standard_exec_prefix/just_machine_suffix/specs
for any override of as, ld and libraries. */
specs_file = alloca (strlen (standard_exec_prefix)
+ strlen (just_machine_suffix) + sizeof ("specs"));
strcpy (specs_file, standard_exec_prefix);
strcat (specs_file, just_machine_suffix);
strcat (specs_file, "specs");
if (access (specs_file, R_OK) == 0)
read_specs (specs_file, TRUE);
/* Process any configure-time defaults specified for the command line
options, via OPTION_DEFAULT_SPECS. */
for (i = 0; i < ARRAY_SIZE (option_default_specs); i++)
do_option_spec (option_default_specs[i].name,
option_default_specs[i].spec);
/* Process DRIVER_SELF_SPECS, adding any new options to the end
of the command line. */
for (i = 0; i < ARRAY_SIZE (driver_self_specs); i++)
do_self_spec (driver_self_specs[i]);
/* If not cross-compiling, look for executables in the standard
places. */
if (*cross_compile == '0')
{
if (*md_exec_prefix)
{
add_prefix (&exec_prefixes, md_exec_prefix, "GCC",
PREFIX_PRIORITY_LAST, 0, 0);
}
}
/* Process sysroot_suffix_spec. */
if (*sysroot_suffix_spec != 0
&& do_spec_2 (sysroot_suffix_spec) == 0)
{
if (argbuf_index > 1)
error ("spec failure: more than one arg to SYSROOT_SUFFIX_SPEC");
else if (argbuf_index == 1)
target_sysroot_suffix = xstrdup (argbuf[argbuf_index -1]);
}
#ifdef HAVE_LD_SYSROOT
/* Pass the --sysroot option to the linker, if it supports that. If
there is a sysroot_suffix_spec, it has already been processed by
this point, so target_system_root really is the system root we
should be using. */
if (target_system_root)
{
obstack_grow (&obstack, "%(sysroot_spec) ", strlen ("%(sysroot_spec) "));
obstack_grow0 (&obstack, link_spec, strlen (link_spec));
set_spec ("link", XOBFINISH (&obstack, const char *));
}
#endif
/* Process sysroot_hdrs_suffix_spec. */
if (*sysroot_hdrs_suffix_spec != 0
&& do_spec_2 (sysroot_hdrs_suffix_spec) == 0)
{
if (argbuf_index > 1)
error ("spec failure: more than one arg to SYSROOT_HEADERS_SUFFIX_SPEC");
else if (argbuf_index == 1)
target_sysroot_hdrs_suffix = xstrdup (argbuf[argbuf_index -1]);
}
/* Look for startfiles in the standard places. */
if (*startfile_prefix_spec != 0
&& do_spec_2 (startfile_prefix_spec) == 0
&& do_spec_1 (" ", 0, NULL) == 0)
{
int ndx;
for (ndx = 0; ndx < argbuf_index; ndx++)
add_sysrooted_prefix (&startfile_prefixes, argbuf[ndx], "BINUTILS",
PREFIX_PRIORITY_LAST, 0, 1);
}
/* We should eventually get rid of all these and stick to
startfile_prefix_spec exclusively. */
else if (*cross_compile == '0' || target_system_root)
{
if (*md_startfile_prefix)
add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix,
"GCC", PREFIX_PRIORITY_LAST, 0, 1);
if (*md_startfile_prefix_1)
add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix_1,
"GCC", PREFIX_PRIORITY_LAST, 0, 1);
/* If standard_startfile_prefix is relative, base it on
standard_exec_prefix. This lets us move the installed tree
as a unit. If GCC_EXEC_PREFIX is defined, base
standard_startfile_prefix on that as well.
If the prefix is relative, only search it for native compilers;
otherwise we will search a directory containing host libraries. */
if (IS_ABSOLUTE_PATH (standard_startfile_prefix))
add_sysrooted_prefix (&startfile_prefixes,
standard_startfile_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 0, 1);
else if (*cross_compile == '0')
{
add_prefix (&startfile_prefixes,
concat (gcc_exec_prefix
? gcc_exec_prefix : standard_exec_prefix,
machine_suffix,
standard_startfile_prefix, NULL),
NULL, PREFIX_PRIORITY_LAST, 0, 1);
}
/* Sysrooted prefixes are relocated because target_system_root is
also relocated by gcc_exec_prefix. */
if (*standard_startfile_prefix_1)
add_sysrooted_prefix (&startfile_prefixes,
standard_startfile_prefix_1, "BINUTILS",
PREFIX_PRIORITY_LAST, 0, 1);
if (*standard_startfile_prefix_2)
add_sysrooted_prefix (&startfile_prefixes,
standard_startfile_prefix_2, "BINUTILS",
PREFIX_PRIORITY_LAST, 0, 1);
}
/* Process any user specified specs in the order given on the command
line. */
for (uptr = user_specs_head; uptr; uptr = uptr->next)
{
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
char *filename = find_a_file (&startfile_prefixes, uptr->filename,
R_OK, true);
read_specs (filename ? filename : uptr->filename, FALSE);
}
/* If we have a GCC_EXEC_PREFIX envvar, modify it for cpp's sake. */
if (gcc_exec_prefix)
gcc_exec_prefix = concat (gcc_exec_prefix, spec_machine, dir_separator_str,
spec_version, dir_separator_str, NULL);
1992-02-01 06:15:32 +01:00
/* Now we have the specs.
Set the `valid' bits for switches that match anything in any spec. */
validate_all_switches ();
/* Now that we have the switches and the specs, set
the subdirectory based on the options. */
set_multilib_dir ();
1992-02-01 06:15:32 +01:00
/* Warn about any switches that no pass was interested in. */
for (i = 0; (int) i < n_switches; i++)
if (! switches[i].validated)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
error ("unrecognized option '-%s'", switches[i].part1);
1992-02-01 06:15:32 +01:00
/* Obey some of the options. */
if (print_search_dirs)
{
printf (_("install: %s%s\n"),
gcc_exec_prefix ? gcc_exec_prefix : standard_exec_prefix,
gcc_exec_prefix ? "" : machine_suffix);
printf (_("programs: %s\n"),
build_search_list (&exec_prefixes, "", false, false));
printf (_("libraries: %s\n"),
build_search_list (&startfile_prefixes, "", false, true));
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
return (0);
}
if (print_file_name)
{
printf ("%s\n", find_file (print_file_name));
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
return (0);
}
if (print_prog_name)
{
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
char *newname = find_a_file (&exec_prefixes, print_prog_name, X_OK, 0);
printf ("%s\n", (newname ? newname : print_prog_name));
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
return (0);
}
1992-02-01 06:15:32 +01:00
if (print_multi_lib)
{
print_multilib_info ();
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
return (0);
}
if (print_multi_directory)
{
if (multilib_dir == NULL)
printf (".\n");
else
printf ("%s\n", multilib_dir);
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
return (0);
}
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
if (print_multi_os_directory)
{
if (multilib_os_dir == NULL)
printf (".\n");
else
printf ("%s\n", multilib_os_dir);
return (0);
}
re PR bootstrap/31020 (cannot write in </test/gnu/gcc/objdir/prev-gcc/../gcc/./include>) fixincludes: * mkheaders.in: Fix headers for each multilib required. gcc: PR bootstrap/31020 * configure.ac (CROSS_SYSTEM_HEADER_DIR, build_system_header_dir): Define using $${sysroot_headers_suffix}. * configure: Regenerate. * cppdefault.c (cpp_include_defaults): Make FIXED_INCLUDE_DIR a multilib-suffixed directory if SYSROOT_HEADERS_SUFFIX_SPEC defined. * doc/invoke.texi (-print-sysroot-headers-suffix): Document. * gcc.c (print_sysroot_headers_suffix): New. (option_map): Include --print-sysroot-headers-suffix. (display_help): Mention -print-sysroot-headers-suffix. (process_command): Handle -print-sysroot-headers-suffix. (do_spec_1): Append multilib directory to include-fixed path if sysroot suffixes in use. (main): Handle -print-sysroot-headers-suffix. * Makefile.in (start.encap): Don't depend on xlimits.h (xlimits.h): Remove. (stmp-int-hdrs): Don't depend on xlimits.h. Inline generation of limits.h for each multilib in fixinc_list. (fixinc_list, s-fixinc_list): New. (stmp-fixinc): Depend on fixinc_list. If not copying headers, generate them for each multilib in fixinc_list. (stmp-fixproto): Use include-fixed. Run fixproto for each multilib in fixinc_list. (mostlyclean): Don't remove xlimits.h. (clean): Remove include-fixed. (real-install-headers-tar, real-install-headers-cpio, real-install-headers-cp): Don't copy include, only include-fixed. (install-mkheaders): Depend on fixinc_list. Don't depend on xlimits.h. Save limits.h files for each multilib in fixinc_list. Always save mkinstalldirs. Preserve ${sysroot_headers_suffix} in SYSTEM_HEADER_DIR setting in mkheaders.conf. From-SVN: r122620
2007-03-06 16:50:28 +01:00
if (print_sysroot_headers_suffix)
{
if (*sysroot_hdrs_suffix_spec)
{
printf("%s\n", (target_sysroot_hdrs_suffix
? target_sysroot_hdrs_suffix
: ""));
re PR bootstrap/31020 (cannot write in </test/gnu/gcc/objdir/prev-gcc/../gcc/./include>) fixincludes: * mkheaders.in: Fix headers for each multilib required. gcc: PR bootstrap/31020 * configure.ac (CROSS_SYSTEM_HEADER_DIR, build_system_header_dir): Define using $${sysroot_headers_suffix}. * configure: Regenerate. * cppdefault.c (cpp_include_defaults): Make FIXED_INCLUDE_DIR a multilib-suffixed directory if SYSROOT_HEADERS_SUFFIX_SPEC defined. * doc/invoke.texi (-print-sysroot-headers-suffix): Document. * gcc.c (print_sysroot_headers_suffix): New. (option_map): Include --print-sysroot-headers-suffix. (display_help): Mention -print-sysroot-headers-suffix. (process_command): Handle -print-sysroot-headers-suffix. (do_spec_1): Append multilib directory to include-fixed path if sysroot suffixes in use. (main): Handle -print-sysroot-headers-suffix. * Makefile.in (start.encap): Don't depend on xlimits.h (xlimits.h): Remove. (stmp-int-hdrs): Don't depend on xlimits.h. Inline generation of limits.h for each multilib in fixinc_list. (fixinc_list, s-fixinc_list): New. (stmp-fixinc): Depend on fixinc_list. If not copying headers, generate them for each multilib in fixinc_list. (stmp-fixproto): Use include-fixed. Run fixproto for each multilib in fixinc_list. (mostlyclean): Don't remove xlimits.h. (clean): Remove include-fixed. (real-install-headers-tar, real-install-headers-cpio, real-install-headers-cp): Don't copy include, only include-fixed. (install-mkheaders): Depend on fixinc_list. Don't depend on xlimits.h. Save limits.h files for each multilib in fixinc_list. Always save mkinstalldirs. Preserve ${sysroot_headers_suffix} in SYSTEM_HEADER_DIR setting in mkheaders.conf. From-SVN: r122620
2007-03-06 16:50:28 +01:00
return (0);
}
else
/* The error status indicates that only one set of fixed
headers should be built. */
fatal ("not configured with sysroot headers suffix");
}
1998-07-13 19:20:29 +02:00
if (print_help_list)
{
display_help ();
if (! verbose_flag)
{
printf (_("\nFor bug reporting instructions, please see:\n"));
printf ("%s.\n", bug_report_url);
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
return (0);
1998-07-13 19:20:29 +02:00
}
/* We do not exit here. Instead we have created a fake input file
called 'help-dummy' which needs to be compiled, and we pass this
on the various sub-processes, along with the --help switch. */
1998-07-13 19:20:29 +02:00
}
1992-02-01 06:15:32 +01:00
if (verbose_flag)
{
int n;
const char *thrmod;
notice ("Target: %s\n", spec_machine);
notice ("Configured with: %s\n", configuration_arguments);
#ifdef THREAD_MODEL_SPEC
/* We could have defined THREAD_MODEL_SPEC to "%*" by default,
but there's no point in doing all this processing just to get
thread_model back. */
obstack_init (&obstack);
do_spec_1 (THREAD_MODEL_SPEC, 0, thread_model);
obstack_1grow (&obstack, '\0');
thrmod = XOBFINISH (&obstack, const char *);
#else
thrmod = thread_model;
#endif
notice ("Thread model: %s\n", thrmod);
/* compiler_version is truncated at the first space when initialized
from version string, so truncate version_string at the first space
before comparing. */
for (n = 0; version_string[n]; n++)
if (version_string[n] == ' ')
break;
if (! strncmp (version_string, compiler_version, n)
&& compiler_version[n] == 0)
notice ("gcc version %s\n", version_string);
else
notice ("gcc driver version %s executing gcc version %s\n",
version_string, compiler_version);
1992-02-01 06:15:32 +01:00
if (n_infiles == 0)
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
return (0);
1992-02-01 06:15:32 +01:00
}
if (n_infiles == added_libraries)
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics. * c-decl.c (duplicate_decls, push_parm_decl): Remove leading capital from diagnostics. * c-lex.c (cb_file_change): Similarly. * c-parse.in : Similarly. * cfgrtl.c (verify_flow_info): Similarly. * collect2.c: Similarly. * cppfiles.c (find_include_file): Similarly. * cppinit.c (cpp_handle_option): Similarly. * cpplex.c (cpp_spell_token): Similarly. * cppmain.c (do_preprocessing): Similarly. * gcc.c (translate_options, process_command, do_spec1, main, pfatal_execute): Similarly. * genattr.c (main): Similarly. * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, write_test_expr, main): Similarly. * gencodes.c (main): Similarly. * genconfig.c (main): Similarly. * genconstants.c (main): Similarly. * genemit.c (main): Similarly. * genextract.c (main): Similarly. * genflags.c (main): Similarly. * genopinit.c (main): Similarly. * genoutput.c (process_template, main): Similarly. * genpeep.c (main): Similarly. * genrecog.c (main): Similarly. * gensupport.c (is_predicable, identify_predicable_attribute, alter_predicate_for_insn, init_md_reader_args, main): Similarly. * ggc-page.c (alloc_anon): Similarly. * mips-tfile.c (add_string, add_procedure, add_file, read_line, parse_begin, parse_bend, parse_def, parse_end, parse_file, parse_stabs_common, parse_stabs, write_varray, write_object, read_seek, copy_object, main, error): Similarly. * profile.c (compute_branch_probabilities): Similarly. * reg-stack.c (check_asm_stack_operands): Similarly. * reload.c (find_reloads): Similarly. * reload1.c (spill_failure, failed_reload): Similarly. * rtl-error.c (_fatal_insn_not_found): Similarly. * toplev.c (read_integral_parameter, crash_signal, decode_f_option, set_target_switch, parse_options_and_default_flags) : Similarly. * tradcif.y (parse_number, yylex): Similarly. * tradcpp.c (main, fancy_abort): Similarly. * tree.c (tree_check_failed): Similarly. * varray.c (varray_check_failed): Similarly. * xcoffout.c (xcoff_output_standard_types): Similarly. cp: * call.c (build_java_interface_fn_ref): Similarly. * except.c (is_admissible_throw_operand): Similarly. * init.c (build_java_class_ref): Similarly. * xref.c (open_xref_file): Similarly. objc: * objc-act.c (get_object_ref, lookup_and_install_protocols, build_objc_string_object, objc_declare_alias, build_ivar_chain, finish_message_expr, build_protocol_expr, is_public, start_class): Similarly. testsuite: * objc.dg/alias.m: Update. * objc.dg/class-1.m: Update. * objc.dg/const-str-1.m: Update. * objc.dg/fwd-proto-1.m: Update. * objc.dg/id-1.m: Update. * objc.dg/super-class-1.m: Update. From-SVN: r47518
2001-12-02 01:04:36 +01:00
fatal ("no input files");
1992-02-01 06:15:32 +01:00
/* Make a place to record the compiler output file names
that correspond to the input files. */
i = n_infiles;
1998-06-06 12:42:32 +02:00
i += lang_specific_extra_outfiles;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
outfiles = XCNEWVEC (const char *, i);
1992-02-01 06:15:32 +01:00
/* Record which files were specified explicitly as link input. */
explicit_link_files = XCNEWVEC (char, n_infiles);
1992-02-01 06:15:32 +01:00
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
if (combine_flag)
combine_inputs = true;
else
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
combine_inputs = false;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
for (i = 0; (int) i < n_infiles; i++)
Index: ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * c-decl.c (finish_decl): Handle 'used' here... * cgraphunit.c (cgraph_finalize_function): ... and here ... * c-common.c: (handle_used_attribute): ... not here. * configure.in (onstep): Support --enable-intermodule. * Makefile.in (OBJS-common): New. (OBJS-md): New. (OBJS-archive): New. (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive. (OBJS-onestep): New. (libbackend.a): Support @onestep@. (libbackend.o): New. * configure: Regenerate. * c-common.h (c_reset_state): New prototype. (c_parse_file): New prototype. (finish_file): Move prototype from c-tree.h. * c-decl.c: Include <hashtab.h>. (builtin_decls): New. (current_file_decl): New. (duplicate_decls): Add extra parameter. Change all callers. Don't output duplicate common symbols. (link_hash_hash): New. (link_hash_eq): New. (poplevel): Handle popping of the top level. (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL. (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate. (pushdecl_top_level): Likewise. (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL. (c_init_decl_processing): Create TRANSLATION_UNIT_DECL. (finish_decl): Handle TRANSLATION_UNIT_DECL. (merge_translation_unit_decls): New. (c_write_global_declarations): New. (c_reset_state): New. (implicitly_declare): Handle TRANSLATION_UNIT_DECL. * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New. * c-objc-common.c (c_cannot_inline_tree_fn): Handle TRANSLATION_UNIT_DECL. (c_objc_common_finish_file): Call merge_translation_unit_decls. * c-opts.c (in_fnames): Rename from in_fname. (c_common_decode_option): Handle multiple input filenames. (c_common_post_options): Likewise. (c_common_parse_file): Likewise; also, call c_parse_file rather than yyparse. * c-parse.in: Move cleanup code to c_parse_file. (free_parser_stacks): Move contents to c_parse_file. (c_parse_file): New. * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT for integer types. (C_DECL_FILE_SCOPE): New. (finish_file): Move prototype to c-common.h. (merge_translation_unit_decls): New prototype. (comptypes): Add extra parameter to prototype. (c_write_global_declarations): New prototype. * c-typeck.c (tagged_types_tu_compatible_p): New. (function_types_compatible_p): Add extra parameter, change all callers. (type_lists_compatible_p): Likewise. (comptypes): Likewise. (struct tagged_tu_seen): New. (tagged_tu_seen_base): New. (build_unary_op): Handle TRANSLATION_UNIT_DECL. (c_mark_addressable): Remove #if 0 code. * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add comment explaining why it shouldn't have to. * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY options. * cppinit.c (cpp_read_next_file): New. (cpp_read_main_file): Use it. * cpplib.c (undefine_macros): New. (cpp_undef_all): New. * cpplib.h (cpp_read_next_file): Prototype. (cpp_undef_all): Prototype. * langhooks-def.h (write_global_declarations): Remove prototype. * toplev.h (write_global_declarations): Add prototype. * tree.c (decl_type_context): Use switch statement, handle TRANSLATION_UNIT_DECL. * tree.def: Update documentation for TRANSLATION_UNIT_DECL. (TRANSLATION_UNIT_DECL): New kind of tree. * tree.h: Update documentation for TRANSLATION_UNIT_DECL. * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies. * doc/invoke.texi: Make attempt to document new functionality. 2003-05-19 Per Bothner <bothner@apple.com> * gcc.c (combine_inputs): New. (process_command): Set combine_inputs. (do_spec_1): Handle combine_inputs. (main): Likewise. Index: cp/ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * decl.c (cp_finish_decl): Handle 'used' attribute. * cp-lang.c (c_reset_state): New dummy routine. * cp-tree.h (finish_file): Move prototype to c-common.h. * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. From-SVN: r69224
2003-07-11 10:33:21 +02:00
{
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
const char *name = infiles[i].name;
struct compiler *compiler = lookup_compiler (name,
strlen (name),
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
infiles[i].language);
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
if (compiler && !(compiler->combinable))
combine_inputs = false;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
if (lang_n_infiles > 0 && compiler != input_file_compiler
&& infiles[i].language && infiles[i].language[0] != '*')
infiles[i].incompiler = compiler;
else if (compiler)
{
lang_n_infiles++;
input_file_compiler = compiler;
infiles[i].incompiler = compiler;
}
else
{
/* Since there is no compiler for this input file, assume it is a
linker file. */
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
explicit_link_files[i] = 1;
infiles[i].incompiler = NULL;
}
infiles[i].compiled = false;
infiles[i].preprocessed = false;
Index: ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * c-decl.c (finish_decl): Handle 'used' here... * cgraphunit.c (cgraph_finalize_function): ... and here ... * c-common.c: (handle_used_attribute): ... not here. * configure.in (onstep): Support --enable-intermodule. * Makefile.in (OBJS-common): New. (OBJS-md): New. (OBJS-archive): New. (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive. (OBJS-onestep): New. (libbackend.a): Support @onestep@. (libbackend.o): New. * configure: Regenerate. * c-common.h (c_reset_state): New prototype. (c_parse_file): New prototype. (finish_file): Move prototype from c-tree.h. * c-decl.c: Include <hashtab.h>. (builtin_decls): New. (current_file_decl): New. (duplicate_decls): Add extra parameter. Change all callers. Don't output duplicate common symbols. (link_hash_hash): New. (link_hash_eq): New. (poplevel): Handle popping of the top level. (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL. (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate. (pushdecl_top_level): Likewise. (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL. (c_init_decl_processing): Create TRANSLATION_UNIT_DECL. (finish_decl): Handle TRANSLATION_UNIT_DECL. (merge_translation_unit_decls): New. (c_write_global_declarations): New. (c_reset_state): New. (implicitly_declare): Handle TRANSLATION_UNIT_DECL. * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New. * c-objc-common.c (c_cannot_inline_tree_fn): Handle TRANSLATION_UNIT_DECL. (c_objc_common_finish_file): Call merge_translation_unit_decls. * c-opts.c (in_fnames): Rename from in_fname. (c_common_decode_option): Handle multiple input filenames. (c_common_post_options): Likewise. (c_common_parse_file): Likewise; also, call c_parse_file rather than yyparse. * c-parse.in: Move cleanup code to c_parse_file. (free_parser_stacks): Move contents to c_parse_file. (c_parse_file): New. * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT for integer types. (C_DECL_FILE_SCOPE): New. (finish_file): Move prototype to c-common.h. (merge_translation_unit_decls): New prototype. (comptypes): Add extra parameter to prototype. (c_write_global_declarations): New prototype. * c-typeck.c (tagged_types_tu_compatible_p): New. (function_types_compatible_p): Add extra parameter, change all callers. (type_lists_compatible_p): Likewise. (comptypes): Likewise. (struct tagged_tu_seen): New. (tagged_tu_seen_base): New. (build_unary_op): Handle TRANSLATION_UNIT_DECL. (c_mark_addressable): Remove #if 0 code. * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add comment explaining why it shouldn't have to. * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY options. * cppinit.c (cpp_read_next_file): New. (cpp_read_main_file): Use it. * cpplib.c (undefine_macros): New. (cpp_undef_all): New. * cpplib.h (cpp_read_next_file): Prototype. (cpp_undef_all): Prototype. * langhooks-def.h (write_global_declarations): Remove prototype. * toplev.h (write_global_declarations): Add prototype. * tree.c (decl_type_context): Use switch statement, handle TRANSLATION_UNIT_DECL. * tree.def: Update documentation for TRANSLATION_UNIT_DECL. (TRANSLATION_UNIT_DECL): New kind of tree. * tree.h: Update documentation for TRANSLATION_UNIT_DECL. * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies. * doc/invoke.texi: Make attempt to document new functionality. 2003-05-19 Per Bothner <bothner@apple.com> * gcc.c (combine_inputs): New. (process_command): Set combine_inputs. (do_spec_1): Handle combine_inputs. (main): Likewise. Index: cp/ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * decl.c (cp_finish_decl): Handle 'used' attribute. * cp-lang.c (c_reset_state): New dummy routine. * cp-tree.h (finish_file): Move prototype to c-common.h. * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. From-SVN: r69224
2003-07-11 10:33:21 +02:00
}
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
if (!combine_inputs && have_c && have_o && lang_n_infiles > 1)
fatal ("cannot specify -o with -c or -S with multiple files");
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
if (combine_flag && save_temps_flag)
{
bool save_combine_inputs = combine_inputs;
/* Must do a separate pre-processing pass for C & Objective-C files, to
obtain individual .i files. */
combine_inputs = false;
for (i = 0; (int) i < n_infiles; i++)
{
int this_file_error = 0;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
input_file_number = i;
set_input (infiles[i].name);
if (infiles[i].incompiler
&& (infiles[i].incompiler)->needs_preprocessing)
input_file_compiler = infiles[i].incompiler;
else
continue;
if (input_file_compiler)
{
if (input_file_compiler->spec[0] == '#')
{
error ("%s: %s compiler not installed on this system",
input_filename, &input_file_compiler->spec[1]);
this_file_error = 1;
}
else
{
value = do_spec (input_file_compiler->spec);
infiles[i].preprocessed = true;
if (!have_o_argbuf_index)
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("spec '%s' is invalid", input_file_compiler->spec);
infiles[i].name = argbuf[have_o_argbuf_index];
infiles[i].incompiler
= lookup_compiler (infiles[i].name,
strlen (infiles[i].name),
infiles[i].language);
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
if (value < 0)
this_file_error = 1;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
}
}
if (this_file_error)
{
delete_failure_queue ();
error_count++;
break;
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
}
clear_failure_queue ();
}
combine_inputs = save_combine_inputs;
}
for (i = 0; (int) i < n_infiles; i++)
1992-02-01 06:15:32 +01:00
{
int this_file_error = 0;
/* Tell do_spec what to substitute for %i. */
input_file_number = i;
set_input (infiles[i].name);
1992-02-01 06:15:32 +01:00
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
if (infiles[i].compiled)
continue;
1992-02-01 06:15:32 +01:00
/* Use the same thing in %o, unless cp->spec says otherwise. */
outfiles[i] = input_filename;
/* Figure out which compiler from the file's suffix. */
Index: ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * c-decl.c (finish_decl): Handle 'used' here... * cgraphunit.c (cgraph_finalize_function): ... and here ... * c-common.c: (handle_used_attribute): ... not here. * configure.in (onstep): Support --enable-intermodule. * Makefile.in (OBJS-common): New. (OBJS-md): New. (OBJS-archive): New. (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive. (OBJS-onestep): New. (libbackend.a): Support @onestep@. (libbackend.o): New. * configure: Regenerate. * c-common.h (c_reset_state): New prototype. (c_parse_file): New prototype. (finish_file): Move prototype from c-tree.h. * c-decl.c: Include <hashtab.h>. (builtin_decls): New. (current_file_decl): New. (duplicate_decls): Add extra parameter. Change all callers. Don't output duplicate common symbols. (link_hash_hash): New. (link_hash_eq): New. (poplevel): Handle popping of the top level. (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL. (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate. (pushdecl_top_level): Likewise. (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL. (c_init_decl_processing): Create TRANSLATION_UNIT_DECL. (finish_decl): Handle TRANSLATION_UNIT_DECL. (merge_translation_unit_decls): New. (c_write_global_declarations): New. (c_reset_state): New. (implicitly_declare): Handle TRANSLATION_UNIT_DECL. * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New. * c-objc-common.c (c_cannot_inline_tree_fn): Handle TRANSLATION_UNIT_DECL. (c_objc_common_finish_file): Call merge_translation_unit_decls. * c-opts.c (in_fnames): Rename from in_fname. (c_common_decode_option): Handle multiple input filenames. (c_common_post_options): Likewise. (c_common_parse_file): Likewise; also, call c_parse_file rather than yyparse. * c-parse.in: Move cleanup code to c_parse_file. (free_parser_stacks): Move contents to c_parse_file. (c_parse_file): New. * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT for integer types. (C_DECL_FILE_SCOPE): New. (finish_file): Move prototype to c-common.h. (merge_translation_unit_decls): New prototype. (comptypes): Add extra parameter to prototype. (c_write_global_declarations): New prototype. * c-typeck.c (tagged_types_tu_compatible_p): New. (function_types_compatible_p): Add extra parameter, change all callers. (type_lists_compatible_p): Likewise. (comptypes): Likewise. (struct tagged_tu_seen): New. (tagged_tu_seen_base): New. (build_unary_op): Handle TRANSLATION_UNIT_DECL. (c_mark_addressable): Remove #if 0 code. * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add comment explaining why it shouldn't have to. * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY options. * cppinit.c (cpp_read_next_file): New. (cpp_read_main_file): Use it. * cpplib.c (undefine_macros): New. (cpp_undef_all): New. * cpplib.h (cpp_read_next_file): Prototype. (cpp_undef_all): Prototype. * langhooks-def.h (write_global_declarations): Remove prototype. * toplev.h (write_global_declarations): Add prototype. * tree.c (decl_type_context): Use switch statement, handle TRANSLATION_UNIT_DECL. * tree.def: Update documentation for TRANSLATION_UNIT_DECL. (TRANSLATION_UNIT_DECL): New kind of tree. * tree.h: Update documentation for TRANSLATION_UNIT_DECL. * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies. * doc/invoke.texi: Make attempt to document new functionality. 2003-05-19 Per Bothner <bothner@apple.com> * gcc.c (combine_inputs): New. (process_command): Set combine_inputs. (do_spec_1): Handle combine_inputs. (main): Likewise. Index: cp/ChangeLog 2003-07-10 Geoffrey Keating <geoffk@apple.com> * decl.c (cp_finish_decl): Handle 'used' attribute. * cp-lang.c (c_reset_state): New dummy routine. * cp-tree.h (finish_file): Move prototype to c-common.h. * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. From-SVN: r69224
2003-07-11 10:33:21 +02:00
if (! combine_inputs)
input_file_compiler
= lookup_compiler (infiles[i].name, input_filename_length,
infiles[i].language);
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
else
input_file_compiler = infiles[i].incompiler;
if (input_file_compiler)
1992-02-01 06:15:32 +01:00
{
/* Ok, we found an applicable compiler. Run its spec. */
if (input_file_compiler->spec[0] == '#')
{
error ("%s: %s compiler not installed on this system",
input_filename, &input_file_compiler->spec[1]);
this_file_error = 1;
}
else
{
value = do_spec (input_file_compiler->spec);
gcc.c (combine_flag): New global variable, for new driver option. 2004-04-05 Caroline Tice <ctice@apple.com> * gcc.c (combine_flag): New global variable, for new driver option. (struct compiler): Add two new fields, to be used when combining multiple input files in a single pass (IMA). (default_compilers): Add values for the new fields to all compiler entries. Modify the "@c" compiler entry for doing IMA properly with "-save-temps" and the "combine" flag. (option_map): Add new driver option, "--combine", to tell driver to pass multiple input files to compiler at one time. (have_o_argbuf_index): New global variable. (store_arg): Modify to assign value to have_o_argbuf_index. (struct infile): Add three new fields, to help with IMA. (display_help): Add help for new "combine" option. (process_command): Remove local variable have_o; add code to check for new "combine" option; remove assignment to combine_inputs. (do_spec_1): Modify to deal with IMA better. (main): Make variable 'lang_n_infiles' local to entire function rather than to a single block. Use flag combine_flag to determine whether to do IMA or not; Modify loop initializing infiles to deal properly with linker files. Add code for doing preprocessing in presence of IMA with "-save-temps" flag. Modify "main" loop to handle multiple input files, in multiple languages, with or without preprocessing, gracefully. * toplev.c (set_src_pwd): Modify to not complain if attempting to re-set it to same directory it's previously been set to (avoid irritating, meaningless warning messages when doing IMA with save-temps). * doc/invoke.texi: Add "-combine" to list of Overall Options; remove documentation about IMA that is no longer accurate; Add documentation explaining what "-combine" does. * ada/lang-specs.h: Add initialization values for new fields in "struct compiler". * cp/lang-specs.h: Likewise. * f/lang-specs.h: Likewise. * java/lang-specs.h: Likewise. * objc/lang-specs.h: Likewise. * treelang/lang-specs.h: Likewise. Fix gcc driver to work properly with IMI. From-SVN: r80435
2004-04-05 21:23:27 +02:00
infiles[i].compiled = true;
if (value < 0)
this_file_error = 1;
}
1992-02-01 06:15:32 +01:00
}
/* If this file's name does not contain a recognized suffix,
record it as explicit linker input. */
else
explicit_link_files[i] = 1;
/* Clear the delete-on-failure queue, deleting the files in it
if this compilation failed. */
if (this_file_error)
{
delete_failure_queue ();
error_count++;
}
/* If this compilation succeeded, don't delete those files later. */
clear_failure_queue ();
}
/* Reset the input file name to the first compile/object file name, for use
with %b in LINK_SPEC. We use the first input file that we can find
a compiler to compile it instead of using infiles.language since for
languages other than C we use aliases that we then lookup later. */
if (n_infiles > 0)
{
int i;
for (i = 0; i < n_infiles ; i++)
if (infiles[i].language && infiles[i].language[0] != '*')
{
set_input (infiles[i].name);
break;
}
}
if (error_count == 0)
{
/* Make sure INPUT_FILE_NUMBER points to first available open
slot. */
input_file_number = n_infiles;
if (lang_specific_pre_link ())
error_count++;
}
/* Determine if there are any linker input files. */
num_linker_inputs = 0;
for (i = 0; (int) i < n_infiles; i++)
if (explicit_link_files[i] || outfiles[i] != NULL)
num_linker_inputs++;
1992-02-01 06:15:32 +01:00
/* Run ld to link all the compiler output files. */
if (num_linker_inputs > 0 && error_count == 0 && print_subprocess_help < 2)
1992-02-01 06:15:32 +01:00
{
int tmp = execution_count;
/* We'll use ld if we can't find collect2. */
if (! strcmp (linker_name_spec, "collect2"))
{
char *s = find_a_file (&exec_prefixes, "collect2", X_OK, false);
if (s == NULL)
linker_name_spec = "ld";
}
/* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
for collect. */
putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH", false);
putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV, true);
if (print_subprocess_help == 1)
{
printf (_("\nLinker options\n==============\n\n"));
printf (_("Use \"-Wl,OPTION\" to pass \"OPTION\""
" to the linker.\n\n"));
fflush (stdout);
}
1992-02-01 06:15:32 +01:00
value = do_spec (link_command_spec);
if (value < 0)
error_count = 1;
linker_was_run = (tmp != execution_count);
}
/* If options said don't run linker,
complain about input files to be given to the linker. */
if (! linker_was_run && error_count == 0)
for (i = 0; (int) i < n_infiles; i++)
if (explicit_link_files[i]
&& !(infiles[i].language && infiles[i].language[0] == '*'))
error ("%s: linker input file unused because linking not done",
1992-02-01 06:15:32 +01:00
outfiles[i]);
/* Delete some or all of the temporary files we made. */
if (error_count)
delete_failure_queue ();
delete_temp_files ();
1998-07-13 19:20:29 +02:00
if (print_help_list)
{
printf (("\nFor bug reporting instructions, please see:\n"));
printf ("%s\n", bug_report_url);
1998-07-13 19:20:29 +02:00
}
[multiple changes] Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR> * gcov.c (DIR_SEPARATOR): Provide default. (output_data): Add test for MS-DOS format absolute filename. (fancy_abort): Correct program name. (open_files): Open all files in binary mode. * libgcc2.c (__bb_exit_func): Likewise. * profile.c (init_branch_prob): Specify binary when opening files. * flags.h (flag_unwind_tables): New decl. * toplev.c (flag_unwind_table): New definition. (f_options): Add -funwind-tables. (decode_g_option): Clarify warning when unknown -g option is given. (rest_of_compilation): If inside an inlined external function, pretend we are just being declared. * dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables. (dwarf2out_frame_finish): Likewise. Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com> * flow.c (propagate_block): When the last reference to a label before an ADDR_VEC is deleted because the reference is a dead store, delete the ADDR_VEC. Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt> * fold-const.c (merge_ranges): In not in0, but in1, handle upper bounds equal like subset case. Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com> * dbxout.c (dbxout_parms): Generate a second stabs line for parameters passed in a register but moved to the stack. Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr> * gcc.c (pass_exit_codes, greatest_status): New variables. (struct option_map): Add entry for "--pass-exit-codes". (execute): Update greatest_status if error. (display_help): Add documentation for -pass-exit-codes. (process_command): Handle -pass-exit-codes. (main): Look at pass_exit_codes and greatest_status on call to exit. Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * reload.c (find_reloads): Refine test for no input reload case to not includes reloads emitted after insn. * function.c (find_temp_slots_from_address): Handle sum involving a register that points to a temp slot. (update_temp_slot_address): Make recursive call if both old and new are PLUS with a common operand. * calls.c (expand_call): Mark temp slot for result as having address taken. * rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case. * gcc.c (process_command): Add standard_exec_prefix with "GCC" component as well as "BINUTILS". * integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS. * integrate.c (copy_rtx_and_substitute): Likewise. (expand_inline_function, integrate_parm_decls, integrate_decl_tree): All callers changed. * unroll.c (inital_reg_note_copy, copy_loop_body): Likewise. * dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use gdb extensions, write size of type; also be more consistent in using references when this is a subtype. * pa.md (extv, extzv, insv): Use define_expand to reject constant that is out of range. * loop.c (unknown_constant_address_altered): New variable. (prescan_loop): Initialize it. (note_addr_stored): Set it for RTX_UNCHANGING_P MEM. (invariant_p, case MEM): Remove handling for volatile and readony; check new variable if readonly. (check_dbra_loop): Chdeck unknown_constant_address_altered. * cse.c (canon_hash, case MEM): Do not record if BLKmode. (addr_affects_sp_p): Removed from note_mem_written and only define #ifdef AUTO_INC_DEC. * alpha.c (input_operand, case ADDRESSOF): Treat as REG. * regclass.c (record_reg_classes): Properly handle register move directions. * varasm.c (initializer_constant_valid_p, case MINUS_EXPR): Don't think valid if both operands are invalid. (struct constant_descriptor): New field RTL. (mark_const_hash_entry): Mark it. (record_constant{,_rtx}): Initialize it. (output_constant_def): Allocate RTL in permanent obstack and save in table. ({record,compare}_constant_1): Modes must match for CONSTRUCTOR of ARRAY_TYPE. * c-common.h (initializer_constant_valid_p): Delete decl from here. * output.h (initializer_constant_valid_p): Move decl to here. * c-common.c (initializer_constant_valid_p): Delete function from here. * varasm.c (initializer_constant_valid_p): Move function to here. * tree.h (STRIP_SIGN_NOPS): New macro. * fold-const.c (optimize_minmax_comparison): New function. (invert_truthvalue, case WITH_RECORD_EXPR): New case. (fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS. (fold, case EQ_EXPR): Call optimize_minmax_comparison and add cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and widening conversions. (fold, case LE_EXPR): Rework changing unsigned to signed comparisons to look at size of mode, not precision of type; also add missing cases. (optimize_bit_field_compare, decode_field_reference): Don't try to optimize COMPONENT_REF of a PLACEHOLDER_EXPR. * dwarf2out.c (ctype.h): Include. (dwarf2out_set_demangle_name_func): New function. (size_of_line_info): Deleted. (output_line_info): Compute size of line info table from difference of labels. (base_type_die, add_name_attribute): Call demangle function, if any. (field_byte_offset): Use bits per word for variable length fields. (gen_array_type_die): Add array name. (gen_subprogram_die): Ignore DECL_INLINE if -fno-inline. (dwarf2out_add_library_unit_info): New function. * explow.c (set_stack_check_libfunc): New function. (stack_check_libfunc): New static variable. (probe_stack_range): Allow front-end to set up a libfunc to call. * combine.c (simplify_comparison): When making comparison in wider mode, check for having commuted an AND and a SUBREG. (contains_muldiv): New function. (try_combine): Call it when dividing a PARALLEL. (simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart. (simplify_comparison, case ASHIFTRT): Recognize sign-extension of a PLUS. (record_value_for_reg): If TEM is a binary operation with two CLOBBERs, use one of the CLOBBERs instead. (if_then_else_cond): If comparing against zero, just return thing being compared. * optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x). Don't generate shifts and subtract if have conditional arithmetic. * rtl.h (delete_barrier): New declaration. * jump.c (jump_optimize): Set up to handle conditional call. In conditional arithmetic case, handle CALL_INSN followed by a BARRIER. (delete_barrier): New function. * rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode. * recog.c (nonmemory_operand): Accept ADDRESSOF. * tree.c (build_type_attribute_variant): Push to obstack of ttype around type_hash_canon call. * expr.c (placeholder_list): Move decl to file scope. (expand_expr): Don't force access to volatile just because its address is taken. If ignoring reference operations, just expand the operands. (expand_expr, case COMPONENT_REF): Propagate EXPAND_CONST_ADDRESS to recursive call when expanding inner. Refine test for using bitfield operations vs pointer punning. (expand_expr, case CONVERT_EXPR): If converting to BLKmode UNION_TYPE from BLKmode, just return inner object. Use proper mode in store_field call. Properly set sizes of object to store and total size in store_field call for convert to union. (expand_expr, case ARRAY_REF): If OP0 is in a register, put it in memory (like for ADDR_EXPR). Also, don't put constant in register if we'll want it in memory. (readonly_fields_p): New function. (expand_expr, case INDIRECT_REF): Call it if LHS. (expand_assignment): Handle a RESULT_DECL where DECL_RTL is a PARALLEL. (do_jump, case WITH_RECORD_EXPR): New case. (get_inner_reference): Always go inside a CONVERT_EXPR and NOP_EXPR if both modes are the same. (store_field): Use bitfield operations if size of bitsize is not same as size of RHS's type. Check for bitpos not a multiple of alignment in BLKmode case. Do block move in largest possible alignment. (store_constructor): Set BITSIZE to -1 for variable size and properly in case of array of BLKmode. (expand_expr_unaligned): New function. (do_compare_and_jump): Call it. * mips/iris5.h (SWITCHES_NEED_SPACES): New macro. * collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES does not include 'o'. * function.c (instantiate_virtual_regs_1, case SET): Handle case where both SET_DEST and SET_SRC reference a virtual register. (gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG. * integrate.c (expand_inline_function): Handle case of setting virtual stack vars register (from built in setjmp); when parameter lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early. (subst_constant): Add new parm, MEMONLY. (expand_inline_function, integrate_parm_decls): Pass new parm. (integrate_decl_tree): Likewise. (copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P. (try_constants): Call subst_constants twice, with MEMONLY 0 and 1. (copy_rtx_and_substitute, case SET): Add explicit calls to copy_rtx_and_substitute for both sides. * stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for constraints. (pushcase{,_range}): Convert to NOMINAL_TYPE after checking for within INDEX_TYPE, instead of before. (fixup_gotos): Use f->target_rtl, not the next insn, since latter may be from a later fixup. (expand_value_return): Correctly convert VAL when promoting function return; support RETURN_REG being a PARALLEL. (expand_return): When checking for result in regs and having cleanup, consider PARALLEL in DECL_RTL as being in regs. From-SVN: r30299
1999-11-01 02:11:22 +01:00
return (signal_count != 0 ? 2
: error_count > 0 ? (pass_exit_codes ? greatest_status : 1)
: 0);
1992-02-01 06:15:32 +01:00
}
/* Find the proper compilation spec for the file name NAME,
whose length is LENGTH. LANGUAGE is the specified language,
or 0 if this file is to be passed to the linker. */
1992-02-01 06:15:32 +01:00
static struct compiler *
lookup_compiler (const char *name, size_t length, const char *language)
1992-02-01 06:15:32 +01:00
{
struct compiler *cp;
/* If this was specified by the user to be a linker input, indicate that. */
if (language != 0 && language[0] == '*')
return 0;
/* Otherwise, look for the language, if one is spec'd. */
1992-02-01 06:15:32 +01:00
if (language != 0)
{
for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
if (cp->suffix[0] == '@' && !strcmp (cp->suffix + 1, language))
return cp;
1992-02-01 06:15:32 +01:00
error ("language %s not recognized", language);
return 0;
1992-02-01 06:15:32 +01:00
}
/* Look for a suffix. */
for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
{
if (/* The suffix `-' matches only the file name `-'. */
(!strcmp (cp->suffix, "-") && !strcmp (name, "-"))
|| (strlen (cp->suffix) < length
/* See if the suffix matches the end of NAME. */
&& !strcmp (cp->suffix,
name + length - strlen (cp->suffix))
))
break;
}
#if defined (OS2) ||defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* Look again, but case-insensitively this time. */
if (cp < compilers)
for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
{
if (/* The suffix `-' matches only the file name `-'. */
(!strcmp (cp->suffix, "-") && !strcmp (name, "-"))
|| (strlen (cp->suffix) < length
/* See if the suffix matches the end of NAME. */
&& ((!strcmp (cp->suffix,
name + length - strlen (cp->suffix))
|| !strpbrk (cp->suffix, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
&& !strcasecmp (cp->suffix,
name + length - strlen (cp->suffix)))
))
break;
}
#endif
if (cp >= compilers)
{
if (cp->spec[0] != '@')
/* A non-alias entry: return it. */
return cp;
/* An alias entry maps a suffix to a language.
Search for the language; pass 0 for NAME and LENGTH
to avoid infinite recursion if language not found. */
return lookup_compiler (NULL, 0, cp->spec + 1);
1992-02-01 06:15:32 +01:00
}
return 0;
}
static char *
save_string (const char *s, int len)
1992-02-01 06:15:32 +01:00
{
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
char *result = XNEWVEC (char, len + 1);
1992-02-01 06:15:32 +01:00
memcpy (result, s, len);
1992-02-01 06:15:32 +01:00
result[len] = 0;
return result;
}
void
pfatal_with_name (const char *name)
1992-02-01 06:15:32 +01:00
{
perror_with_name (name);
delete_temp_files ();
exit (1);
1992-02-01 06:15:32 +01:00
}
static void
perror_with_name (const char *name)
1992-02-01 06:15:32 +01:00
{
error ("%s: %s", name, xstrerror (errno));
1992-02-01 06:15:32 +01:00
}
/* Output an error message and exit. */
1992-02-01 06:15:32 +01:00
void
fancy_abort (const char *file, int line, const char *func)
1992-02-01 06:15:32 +01:00
{
fatal_ice ("internal gcc abort in %s, at %s:%d", func, file, line);
1992-02-01 06:15:32 +01:00
}
/* Output an error message and exit. */
1992-02-01 06:15:32 +01:00
void
fatal_ice (const char *cmsgid, ...)
{
va_list ap;
va_start (ap, cmsgid);
fprintf (stderr, "%s: ", programname);
vfprintf (stderr, _(cmsgid), ap);
va_end (ap);
fprintf (stderr, "\n");
delete_temp_files ();
exit (pass_exit_codes ? ICE_EXIT_CODE : 1);
}
Makefile.in (gcc.o, [...]): Depend on gcc.h. * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. * gcc.h: New file. (lang_specific_driver): Don't take a function pointer parameter. All callers changed. * gcc.c: Include gcc.h. (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, lang_specific_extra_outfiles, fatal): Don't declare. (multilib_defaults_raw): Constify. (read_specs): Call memset, rather than bzero. (main): Call return, not exit. (lookup_compiler): Call memcpy, not bcopy. (fatal): Make extern. * cppspec.c: Include gcc.h. (lang_specific_driver): Initialize variable `quote'. Constify a char*. All calls to the function pointer parameter now explicitly call `fatal'. * gccspec.c (lang_specific_driver): Include gcc.h. cp: * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. * g++spec.c: Include gcc.h. (lang_specific_driver): Constify a char*. Call xcalloc, not xmalloc/bzero. All calls to the function pointer parameter now explicitly call `fatal'. f: * Make-lang.in (g77spec.o): Depend on system.h and gcc.h. * g77spec.c: Include gcc.h. (g77_xargv): Constify. (g77_fn): Add parameter prototypes. (lookup_option, append_arg): Add static prototypes. (g77_newargv): Constify. (lookup_option, append_arg, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. java: * Make-lang.in (jvspec.o): Depend on system.h and gcc.h. * jvspec.c: Include gcc.h. Don't include gansidecl.h. (do_spec, lang_specific_pre_link, lang_specific_driver, input_filename, input_filename_length): Don't declare. (main_class_name, jvgenmain_spec, lang_specific_driver): Constify a char*. (lang_specific_driver): All calls to the function pointer parameter now explicitly call `fatal'. From-SVN: r29367
1999-09-13 05:57:40 +02:00
void
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
2005-06-06 21:31:40 +02:00
fatal (const char *cmsgid, ...)
1992-02-01 06:15:32 +01:00
{
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. gcc: * builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-semantics.c (build_stmt): Likewise. * calls.c (emit_library_call, emit_library_call_value): Likewise. * collect2.c (notice, fatal_perror, fatal, error): Likewise. * cpperror.c (cpp_error, cpp_error_with_line): Likewise. * diagnostic.c (build_message_string, output_printf, output_verbatim, verbatim, inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl, fnotice): Likewise. * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_nstring, dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, dw2_asm_output_encoded_addr_rtx): Likewise. * emit-rtl.c (gen_rtx, gen_rtvec): Likewise. * errors.c (warning, error, fatal, internal_error): Likewise. * final.c (output_operand_lossage, asm_fprintf): Likewise. * fix-header.c (fatal): Likewise. * gcc.c (fatal, error, notice): Likewise. * gcov.c (fnotice): Likewise. * genattrtab.c (attr_rtx, attr_printf): Likewise. * gengtype.c (error_at_line, xasprintf, oprintf): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c (fatal, error): Likewise. * protoize.c (notice): Likewise. * ra-debug.c (ra_debug_msg): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c (error_for_asm, warning_for_asm): Likewise. * tree.c (build, build_nt, build_function_type_list): Likewise. cp: * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate libiberty VA_ macros, always use stdarg. * rtti.c (create_pseudo_type_info): Likewise. * tree.c (build_min_nt, build_min): Likewise. From-SVN: r66919
2003-05-18 00:21:35 +02:00
va_list ap;
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
2005-06-06 21:31:40 +02:00
va_start (ap, cmsgid);
1992-02-01 06:15:32 +01:00
fprintf (stderr, "%s: ", programname);
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
2005-06-06 21:31:40 +02:00
vfprintf (stderr, _(cmsgid), ap);
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. gcc: * builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-semantics.c (build_stmt): Likewise. * calls.c (emit_library_call, emit_library_call_value): Likewise. * collect2.c (notice, fatal_perror, fatal, error): Likewise. * cpperror.c (cpp_error, cpp_error_with_line): Likewise. * diagnostic.c (build_message_string, output_printf, output_verbatim, verbatim, inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl, fnotice): Likewise. * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_nstring, dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, dw2_asm_output_encoded_addr_rtx): Likewise. * emit-rtl.c (gen_rtx, gen_rtvec): Likewise. * errors.c (warning, error, fatal, internal_error): Likewise. * final.c (output_operand_lossage, asm_fprintf): Likewise. * fix-header.c (fatal): Likewise. * gcc.c (fatal, error, notice): Likewise. * gcov.c (fnotice): Likewise. * genattrtab.c (attr_rtx, attr_printf): Likewise. * gengtype.c (error_at_line, xasprintf, oprintf): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c (fatal, error): Likewise. * protoize.c (notice): Likewise. * ra-debug.c (ra_debug_msg): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c (error_for_asm, warning_for_asm): Likewise. * tree.c (build, build_nt, build_function_type_list): Likewise. cp: * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate libiberty VA_ macros, always use stdarg. * rtti.c (create_pseudo_type_info): Likewise. * tree.c (build_min_nt, build_min): Likewise. From-SVN: r66919
2003-05-18 00:21:35 +02:00
va_end (ap);
1992-02-01 06:15:32 +01:00
fprintf (stderr, "\n");
delete_temp_files ();
exit (1);
}
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
2005-06-06 21:31:40 +02:00
/* The argument is actually c-format, not gcc-internal-format,
but because functions with identical names are used through
the rest of the compiler with gcc-internal-format, we just
need to hope all users of these functions use the common
subset between c-format and gcc-internal-format. */
void
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
2005-06-06 21:31:40 +02:00
error (const char *gmsgid, ...)
1992-02-01 06:15:32 +01:00
{
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. gcc: * builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-semantics.c (build_stmt): Likewise. * calls.c (emit_library_call, emit_library_call_value): Likewise. * collect2.c (notice, fatal_perror, fatal, error): Likewise. * cpperror.c (cpp_error, cpp_error_with_line): Likewise. * diagnostic.c (build_message_string, output_printf, output_verbatim, verbatim, inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl, fnotice): Likewise. * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_nstring, dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, dw2_asm_output_encoded_addr_rtx): Likewise. * emit-rtl.c (gen_rtx, gen_rtvec): Likewise. * errors.c (warning, error, fatal, internal_error): Likewise. * final.c (output_operand_lossage, asm_fprintf): Likewise. * fix-header.c (fatal): Likewise. * gcc.c (fatal, error, notice): Likewise. * gcov.c (fnotice): Likewise. * genattrtab.c (attr_rtx, attr_printf): Likewise. * gengtype.c (error_at_line, xasprintf, oprintf): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c (fatal, error): Likewise. * protoize.c (notice): Likewise. * ra-debug.c (ra_debug_msg): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c (error_for_asm, warning_for_asm): Likewise. * tree.c (build, build_nt, build_function_type_list): Likewise. cp: * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate libiberty VA_ macros, always use stdarg. * rtti.c (create_pseudo_type_info): Likewise. * tree.c (build_min_nt, build_min): Likewise. From-SVN: r66919
2003-05-18 00:21:35 +02:00
va_list ap;
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
2005-06-06 21:31:40 +02:00
va_start (ap, gmsgid);
1992-02-01 06:15:32 +01:00
fprintf (stderr, "%s: ", programname);
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
2005-06-06 21:31:40 +02:00
vfprintf (stderr, _(gmsgid), ap);
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. gcc: * builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-semantics.c (build_stmt): Likewise. * calls.c (emit_library_call, emit_library_call_value): Likewise. * collect2.c (notice, fatal_perror, fatal, error): Likewise. * cpperror.c (cpp_error, cpp_error_with_line): Likewise. * diagnostic.c (build_message_string, output_printf, output_verbatim, verbatim, inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl, fnotice): Likewise. * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_nstring, dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, dw2_asm_output_encoded_addr_rtx): Likewise. * emit-rtl.c (gen_rtx, gen_rtvec): Likewise. * errors.c (warning, error, fatal, internal_error): Likewise. * final.c (output_operand_lossage, asm_fprintf): Likewise. * fix-header.c (fatal): Likewise. * gcc.c (fatal, error, notice): Likewise. * gcov.c (fnotice): Likewise. * genattrtab.c (attr_rtx, attr_printf): Likewise. * gengtype.c (error_at_line, xasprintf, oprintf): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c (fatal, error): Likewise. * protoize.c (notice): Likewise. * ra-debug.c (ra_debug_msg): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c (error_for_asm, warning_for_asm): Likewise. * tree.c (build, build_nt, build_function_type_list): Likewise. cp: * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate libiberty VA_ macros, always use stdarg. * rtti.c (create_pseudo_type_info): Likewise. * tree.c (build_min_nt, build_min): Likewise. From-SVN: r66919
2003-05-18 00:21:35 +02:00
va_end (ap);
1992-02-01 06:15:32 +01:00
fprintf (stderr, "\n");
}
static void
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
2005-06-06 21:31:40 +02:00
notice (const char *cmsgid, ...)
{
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. gcc: * builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-semantics.c (build_stmt): Likewise. * calls.c (emit_library_call, emit_library_call_value): Likewise. * collect2.c (notice, fatal_perror, fatal, error): Likewise. * cpperror.c (cpp_error, cpp_error_with_line): Likewise. * diagnostic.c (build_message_string, output_printf, output_verbatim, verbatim, inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl, fnotice): Likewise. * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_nstring, dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, dw2_asm_output_encoded_addr_rtx): Likewise. * emit-rtl.c (gen_rtx, gen_rtvec): Likewise. * errors.c (warning, error, fatal, internal_error): Likewise. * final.c (output_operand_lossage, asm_fprintf): Likewise. * fix-header.c (fatal): Likewise. * gcc.c (fatal, error, notice): Likewise. * gcov.c (fnotice): Likewise. * genattrtab.c (attr_rtx, attr_printf): Likewise. * gengtype.c (error_at_line, xasprintf, oprintf): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c (fatal, error): Likewise. * protoize.c (notice): Likewise. * ra-debug.c (ra_debug_msg): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c (error_for_asm, warning_for_asm): Likewise. * tree.c (build, build_nt, build_function_type_list): Likewise. cp: * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate libiberty VA_ macros, always use stdarg. * rtti.c (create_pseudo_type_info): Likewise. * tree.c (build_min_nt, build_min): Likewise. From-SVN: r66919
2003-05-18 00:21:35 +02:00
va_list ap;
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
2005-06-06 21:31:40 +02:00
va_start (ap, cmsgid);
vfprintf (stderr, _(cmsgid), ap);
builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. gcc: * builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-semantics.c (build_stmt): Likewise. * calls.c (emit_library_call, emit_library_call_value): Likewise. * collect2.c (notice, fatal_perror, fatal, error): Likewise. * cpperror.c (cpp_error, cpp_error_with_line): Likewise. * diagnostic.c (build_message_string, output_printf, output_verbatim, verbatim, inform, warning, pedwarn, error, sorry, fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, error_with_decl, fnotice): Likewise. * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_nstring, dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, dw2_asm_output_encoded_addr_rtx): Likewise. * emit-rtl.c (gen_rtx, gen_rtvec): Likewise. * errors.c (warning, error, fatal, internal_error): Likewise. * final.c (output_operand_lossage, asm_fprintf): Likewise. * fix-header.c (fatal): Likewise. * gcc.c (fatal, error, notice): Likewise. * gcov.c (fnotice): Likewise. * genattrtab.c (attr_rtx, attr_printf): Likewise. * gengtype.c (error_at_line, xasprintf, oprintf): Likewise. * gensupport.c (message_with_line): Likewise. * mips-tfile.c (fatal, error): Likewise. * protoize.c (notice): Likewise. * ra-debug.c (ra_debug_msg): Likewise. * read-rtl.c (fatal_with_file_and_line): Likewise. * rtl-error.c (error_for_asm, warning_for_asm): Likewise. * tree.c (build, build_nt, build_function_type_list): Likewise. cp: * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate libiberty VA_ macros, always use stdarg. * rtti.c (create_pseudo_type_info): Likewise. * tree.c (build_min_nt, build_min): Likewise. From-SVN: r66919
2003-05-18 00:21:35 +02:00
va_end (ap);
}
1992-02-01 06:15:32 +01:00
static inline void
validate_switches_from_spec (const char *spec)
{
const char *p = spec;
char c;
while ((c = *p++))
if (c == '%' && (*p == '{' || *p == '<' || (*p == 'W' && *++p == '{')))
/* We have a switch spec. */
p = validate_switches (p + 1);
}
1992-02-01 06:15:32 +01:00
static void
validate_all_switches (void)
1992-02-01 06:15:32 +01:00
{
struct compiler *comp;
struct spec_list *spec;
1992-02-01 06:15:32 +01:00
for (comp = compilers; comp->spec; comp++)
validate_switches_from_spec (comp->spec);
1992-02-01 06:15:32 +01:00
/* Look through the linked list of specs read from the specs file. */
for (spec = specs; spec; spec = spec->next)
validate_switches_from_spec (*spec->ptr_spec);
validate_switches_from_spec (link_command_spec);
1992-02-01 06:15:32 +01:00
}
/* Look at the switch-name that comes after START
and mark as valid all supplied switches that match it. */
static const char *
validate_switches (const char *start)
1992-02-01 06:15:32 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
const char *p = start;
const char *atom;
size_t len;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
int i;
bool suffix = false;
bool starred = false;
#define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0)
next_member:
SKIP_WHITE ();
1992-02-01 06:15:32 +01:00
if (*p == '!')
p++;
1992-02-01 06:15:32 +01:00
SKIP_WHITE ();
if (*p == '.' || *p == ',')
suffix = true, p++;
1992-02-01 06:15:32 +01:00
atom = p;
while (ISIDNUM (*p) || *p == '-' || *p == '+' || *p == '='
|| *p == ',' || *p == '.' || *p == '@')
p++;
len = p - atom;
1992-02-01 06:15:32 +01:00
if (*p == '*')
starred = true, p++;
SKIP_WHITE ();
if (!suffix)
1992-02-01 06:15:32 +01:00
{
/* Mark all matching switches as valid. */
for (i = 0; i < n_switches; i++)
if (!strncmp (switches[i].part1, atom, len)
&& (starred || switches[i].part1[len] == 0))
switches[i].validated = 1;
1992-02-01 06:15:32 +01:00
}
if (*p) p++;
if (*p && (p[-1] == '|' || p[-1] == '&'))
goto next_member;
if (*p && p[-1] == ':')
1992-02-01 06:15:32 +01:00
{
while (*p && *p != ';' && *p != '}')
1992-02-01 06:15:32 +01:00
{
if (*p == '%')
{
p++;
if (*p == '{' || *p == '<')
p = validate_switches (p+1);
else if (p[0] == 'W' && p[1] == '{')
p = validate_switches (p+2);
}
else
p++;
1992-02-01 06:15:32 +01:00
}
if (*p) p++;
if (*p && p[-1] == ';')
goto next_member;
1992-02-01 06:15:32 +01:00
}
return p;
#undef SKIP_WHITE
1992-02-01 06:15:32 +01:00
}
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
struct mdswitchstr
{
const char *str;
int len;
};
static struct mdswitchstr *mdswitches;
static int n_mdswitches;
/* Check whether a particular argument was used. The first time we
1997-12-07 01:31:01 +01:00
canonicalize the switches to keep only the ones we care about. */
static int
used_arg (const char *p, int len)
{
struct mswitchstr
{
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *str;
const char *replace;
int len;
int rep_len;
};
static struct mswitchstr *mswitches;
static int n_mswitches;
int i, j;
if (!mswitches)
{
struct mswitchstr *matches;
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *q;
1996-08-13 00:15:13 +02:00
int cnt = 0;
/* Break multilib_matches into the component strings of string
and replacement string. */
for (q = multilib_matches; *q != '\0'; q++)
if (*q == ';')
cnt++;
matches = alloca ((sizeof (struct mswitchstr)) * cnt);
i = 0;
q = multilib_matches;
while (*q != '\0')
{
matches[i].str = q;
while (*q != ' ')
{
if (*q == '\0')
{
invalid_matches:
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("multilib spec '%s' is invalid", multilib_matches);
}
q++;
}
matches[i].len = q - matches[i].str;
matches[i].replace = ++q;
while (*q != ';' && *q != '\0')
{
if (*q == ' ')
goto invalid_matches;
q++;
}
matches[i].rep_len = q - matches[i].replace;
i++;
if (*q == ';')
q++;
}
/* Now build a list of the replacement string for switches that we care
about. Make sure we allocate at least one entry. This prevents
xmalloc from calling fatal, and prevents us from re-executing this
block of code. */
mswitches
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
= XNEWVEC (struct mswitchstr, n_mdswitches + (n_switches ? n_switches : 1));
for (i = 0; i < n_switches; i++)
if (switches[i].live_cond != SWITCH_IGNORE)
{
int xlen = strlen (switches[i].part1);
for (j = 0; j < cnt; j++)
if (xlen == matches[j].len
&& ! strncmp (switches[i].part1, matches[j].str, xlen))
{
mswitches[n_mswitches].str = matches[j].replace;
mswitches[n_mswitches].len = matches[j].rep_len;
mswitches[n_mswitches].replace = (char *) 0;
mswitches[n_mswitches].rep_len = 0;
n_mswitches++;
break;
}
}
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
/* Add MULTILIB_DEFAULTS switches too, as long as they were not present
on the command line nor any options mutually incompatible with
them. */
for (i = 0; i < n_mdswitches; i++)
{
const char *r;
for (q = multilib_options; *q != '\0'; q++)
{
while (*q == ' ')
q++;
r = q;
while (strncmp (q, mdswitches[i].str, mdswitches[i].len) != 0
|| strchr (" /", q[mdswitches[i].len]) == NULL)
{
while (*q != ' ' && *q != '/' && *q != '\0')
q++;
if (*q != '/')
break;
q++;
}
if (*q != ' ' && *q != '\0')
{
while (*r != ' ' && *r != '\0')
{
q = r;
while (*q != ' ' && *q != '/' && *q != '\0')
q++;
if (used_arg (r, q - r))
break;
if (*q != '/')
{
mswitches[n_mswitches].str = mdswitches[i].str;
mswitches[n_mswitches].len = mdswitches[i].len;
mswitches[n_mswitches].replace = (char *) 0;
mswitches[n_mswitches].rep_len = 0;
n_mswitches++;
break;
}
r = q + 1;
}
break;
}
}
}
}
for (i = 0; i < n_mswitches; i++)
if (len == mswitches[i].len && ! strncmp (p, mswitches[i].str, len))
return 1;
return 0;
}
static int
default_arg (const char *p, int len)
{
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
int i;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
for (i = 0; i < n_mdswitches; i++)
if (len == mdswitches[i].len && ! strncmp (p, mdswitches[i].str, len))
return 1;
return 0;
}
/* Work out the subdirectory to use based on the options. The format of
multilib_select is a list of elements. Each element is a subdirectory
name followed by a list of options followed by a semicolon. The format
of multilib_exclusions is the same, but without the preceding
directory. First gcc will check the exclusions, if none of the options
beginning with an exclamation point are present, and all of the other
options are present, then we will ignore this completely. Passing
that, gcc will consider each multilib_select in turn using the same
rules for matching the options. If a match is found, that subdirectory
will be used. */
static void
set_multilib_dir (void)
{
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *p;
unsigned int this_path_len;
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *this_path, *this_arg;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
const char *start, *end;
int not_arg;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
int ok, ndfltok, first;
n_mdswitches = 0;
start = multilib_defaults;
while (*start == ' ' || *start == '\t')
start++;
while (*start != '\0')
{
n_mdswitches++;
while (*start != ' ' && *start != '\t' && *start != '\0')
start++;
while (*start == ' ' || *start == '\t')
start++;
}
if (n_mdswitches)
{
int i = 0;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
mdswitches = XNEWVEC (struct mdswitchstr, n_mdswitches);
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
for (start = multilib_defaults; *start != '\0'; start = end + 1)
{
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
break;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
for (end = start + 1;
*end != ' ' && *end != '\t' && *end != '\0'; end++)
;
obstack_grow (&multilib_obstack, start, end - start);
obstack_1grow (&multilib_obstack, 0);
mdswitches[i].str = XOBFINISH (&multilib_obstack, const char *);
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
mdswitches[i++].len = end - start;
if (*end == '\0')
break;
}
}
p = multilib_exclusions;
while (*p != '\0')
{
/* Ignore newlines. */
if (*p == '\n')
{
++p;
continue;
}
/* Check the arguments. */
ok = 1;
while (*p != ';')
{
if (*p == '\0')
{
invalid_exclusions:
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("multilib exclusions '%s' is invalid",
multilib_exclusions);
}
if (! ok)
{
++p;
continue;
}
this_arg = p;
while (*p != ' ' && *p != ';')
{
if (*p == '\0')
goto invalid_exclusions;
++p;
}
if (*this_arg != '!')
not_arg = 0;
else
{
not_arg = 1;
++this_arg;
}
ok = used_arg (this_arg, p - this_arg);
if (not_arg)
ok = ! ok;
if (*p == ' ')
++p;
}
if (ok)
return;
++p;
}
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
first = 1;
p = multilib_select;
while (*p != '\0')
{
/* Ignore newlines. */
if (*p == '\n')
{
++p;
continue;
}
/* Get the initial path. */
this_path = p;
while (*p != ' ')
{
if (*p == '\0')
{
invalid_select:
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("multilib select '%s' is invalid",
multilib_select);
}
++p;
}
this_path_len = p - this_path;
/* Check the arguments. */
ok = 1;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
ndfltok = 1;
++p;
while (*p != ';')
{
if (*p == '\0')
goto invalid_select;
if (! ok)
{
++p;
continue;
}
this_arg = p;
while (*p != ' ' && *p != ';')
{
if (*p == '\0')
goto invalid_select;
++p;
}
if (*this_arg != '!')
not_arg = 0;
else
{
not_arg = 1;
++this_arg;
}
/* If this is a default argument, we can just ignore it.
This is true even if this_arg begins with '!'. Beginning
with '!' does not mean that this argument is necessarily
inappropriate for this library: it merely means that
there is a more specific library which uses this
argument. If this argument is a default, we need not
consider that more specific library. */
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
ok = used_arg (this_arg, p - this_arg);
if (not_arg)
ok = ! ok;
if (! ok)
ndfltok = 0;
if (default_arg (this_arg, p - this_arg))
ok = 1;
if (*p == ' ')
++p;
}
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
if (ok && first)
{
if (this_path_len != 1
|| this_path[0] != '.')
{
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
char *new_multilib_dir = XNEWVEC (char, this_path_len + 1);
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
char *q;
strncpy (new_multilib_dir, this_path, this_path_len);
new_multilib_dir[this_path_len] = '\0';
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
q = strchr (new_multilib_dir, ':');
if (q != NULL)
*q = '\0';
multilib_dir = new_multilib_dir;
}
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
first = 0;
}
if (ndfltok)
{
const char *q = this_path, *end = this_path + this_path_len;
while (q < end && *q != ':')
q++;
if (q < end)
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
{
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
char *new_multilib_os_dir = XNEWVEC (char, end - q);
memcpy (new_multilib_os_dir, q + 1, end - q - 1);
new_multilib_os_dir[end - q - 1] = '\0';
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
multilib_os_dir = new_multilib_os_dir;
break;
}
}
++p;
}
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
if (multilib_dir == NULL && multilib_os_dir != NULL
&& strcmp (multilib_os_dir, ".") == 0)
{
free ((char *) multilib_os_dir);
multilib_os_dir = NULL;
}
else if (multilib_dir != NULL && multilib_os_dir == NULL)
multilib_os_dir = multilib_dir;
}
/* Print out the multiple library subdirectory selection
information. This prints out a series of lines. Each line looks
like SUBDIRECTORY;@OPTION@OPTION, with as many options as is
required. Only the desired options are printed out, the negative
matches. The options are print without a leading dash. There are
no spaces to make it easy to use the information in the shell.
Each subdirectory is printed only once. This assumes the ordering
generated by the genmultilib script. Also, we leave out ones that match
the exclusions. */
static void
print_multilib_info (void)
{
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *p = multilib_select;
const char *last_path = 0, *this_path;
int skip;
unsigned int last_path_len = 0;
while (*p != '\0')
{
skip = 0;
/* Ignore newlines. */
if (*p == '\n')
{
++p;
continue;
}
/* Get the initial path. */
this_path = p;
while (*p != ' ')
{
if (*p == '\0')
{
invalid_select:
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("multilib select '%s' is invalid", multilib_select);
}
++p;
}
/* When --disable-multilib was used but target defines
MULTILIB_OSDIRNAMES, entries starting with .: are there just
to find multilib_os_dir, so skip them from output. */
if (this_path[0] == '.' && this_path[1] == ':')
skip = 1;
/* Check for matches with the multilib_exclusions. We don't bother
with the '!' in either list. If any of the exclusion rules match
all of its options with the select rule, we skip it. */
{
const char *e = multilib_exclusions;
const char *this_arg;
while (*e != '\0')
{
int m = 1;
/* Ignore newlines. */
if (*e == '\n')
{
++e;
continue;
}
/* Check the arguments. */
while (*e != ';')
{
const char *q;
int mp = 0;
if (*e == '\0')
{
invalid_exclusion:
builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-09 11:13:30 +01:00
fatal ("multilib exclusion '%s' is invalid",
multilib_exclusions);
}
if (! m)
{
++e;
continue;
}
this_arg = e;
while (*e != ' ' && *e != ';')
{
if (*e == '\0')
goto invalid_exclusion;
++e;
}
q = p + 1;
while (*q != ';')
{
const char *arg;
int len = e - this_arg;
if (*q == '\0')
goto invalid_select;
arg = q;
while (*q != ' ' && *q != ';')
{
if (*q == '\0')
goto invalid_select;
++q;
}
if (! strncmp (arg, this_arg,
(len < q - arg) ? q - arg : len)
|| default_arg (this_arg, e - this_arg))
{
mp = 1;
break;
}
if (*q == ' ')
++q;
}
if (! mp)
m = 0;
if (*e == ' ')
++e;
}
if (m)
{
skip = 1;
break;
}
if (*e != '\0')
++e;
}
}
if (! skip)
{
/* If this is a duplicate, skip it. */
skip = (last_path != 0
&& (unsigned int) (p - this_path) == last_path_len
&& ! strncmp (last_path, this_path, last_path_len));
last_path = this_path;
last_path_len = p - this_path;
}
/* If this directory requires any default arguments, we can skip
it. We will already have printed a directory identical to
this one which does not require that default argument. */
if (! skip)
{
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *q;
q = p + 1;
while (*q != ';')
{
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *arg;
if (*q == '\0')
goto invalid_select;
if (*q == '!')
arg = NULL;
else
arg = q;
while (*q != ' ' && *q != ';')
{
if (*q == '\0')
goto invalid_select;
++q;
}
if (arg != NULL
&& default_arg (arg, q - arg))
{
skip = 1;
break;
}
if (*q == ' ')
++q;
}
}
if (! skip)
{
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *p1;
gcc.c (print_multi_os_directory): New variable. * gcc.c (print_multi_os_directory): New variable. (option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. From-SVN: r57786
2002-10-03 22:35:14 +02:00
for (p1 = last_path; p1 < p && *p1 != ':'; p1++)
putchar (*p1);
putchar (';');
}
++p;
while (*p != ';')
{
int use_arg;
if (*p == '\0')
goto invalid_select;
if (skip)
{
++p;
continue;
}
use_arg = *p != '!';
if (use_arg)
putchar ('@');
while (*p != ' ' && *p != ';')
{
if (*p == '\0')
goto invalid_select;
if (use_arg)
putchar (*p);
++p;
}
if (*p == ' ')
++p;
}
if (! skip)
{
/* If there are extra options, print them now. */
if (multilib_extra && *multilib_extra)
{
int print_at = TRUE;
top level: * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-09 21:56:01 +02:00
const char *q;
for (q = multilib_extra; *q != '\0'; q++)
{
if (*q == ' ')
print_at = TRUE;
else
{
if (print_at)
putchar ('@');
putchar (*q);
print_at = FALSE;
}
}
}
putchar ('\n');
}
++p;
}
}
/* getenv built-in spec function.
Returns the value of the environment variable given by its first
argument, concatenated with the second argument. If the
environment variable is not defined, a fatal error is issued. */
static const char *
getenv_spec_function (int argc, const char **argv)
{
char *value;
if (argc != 2)
return NULL;
value = getenv (argv[0]);
if (!value)
fatal ("environment variable \"%s\" not defined", argv[0]);
return concat (value, argv[1], NULL);
}
/* if-exists built-in spec function.
Checks to see if the file specified by the absolute pathname in
ARGS exists. Returns that pathname if found.
The usual use for this function is to check for a library file
(whose name has been expanded with %s). */
static const char *
if_exists_spec_function (int argc, const char **argv)
{
/* Must have only one argument. */
if (argc == 1 && IS_ABSOLUTE_PATH (argv[0]) && ! access (argv[0], R_OK))
return argv[0];
return NULL;
}
/* if-exists-else built-in spec function.
This is like if-exists, but takes an additional argument which
is returned if the first argument does not exist. */
static const char *
if_exists_else_spec_function (int argc, const char **argv)
{
/* Must have exactly two arguments. */
if (argc != 2)
return NULL;
if (IS_ABSOLUTE_PATH (argv[0]) && ! access (argv[0], R_OK))
return argv[0];
return argv[1];
}
re PR libobjc/11572 (GNU libobjc no longer compiled on Darwin) 2004-09-15 Andrew Pinski <pinskia@physics.uc.edu> PR target/11572 * c-incpath.h (target_c_incpath_s): Add extra_pre_includes. Add two parameters to extra_includes. (C_INCPATH_INIT): Remove. * c-incpath.c (register_include_chains): Call extra_pre_includes before adding the standard include directory. Update call to extra_includes. (!defined TARGET_EXTRA_INCLUDES): Update hook_void_charptr_charptr_int and add !define TARGET_EXTRA_PRE_INCLUDES. (!define TARGET_EXTRA_INCLUDES): Define as hook_void_charptr_charptr_int. (!define TARGET_EXTRA_PRE_INCLUDES): Likewise. (target_c_incpath): Always declare. * fixinclude.c (defined TARGET_EXTRA_INCLUDES): Declare a empty function. (define TARGET_EXTRA_PRE_INCLUDES): Likewise. * config/darwin.h: (darwin_register_frameworks): Update for the two new parameters. (darwin_register_objc_includes): Add prototype. (TARGET_EXTRA_PRE_INCLUDES): Define. * config/darwin-c.c (darwin_register_objc_includes): New function. (darwin_register_frameworks): Update for the two new parameters. (target_c_incpath): Remove. * config/t-darwin (darwin-c.o): Add $(PREPROCESSOR_DEFINES) to the compile line. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Document the two new parameters. (TARGET_EXTRA_PRE_INCLUDES): Document. * gcc.c (spec_function): Add replace-outfile. (replace_outfile_spec_function): New function. * config/darwin.h (LINK_SPEC): Add replace -lobjc with -lobjc-gnu if -fgnu-runtime is supplied. * invoke.texi (replace-outfile): Document. From-SVN: r87588
2004-09-16 08:49:59 +02:00
/* replace-outfile built-in spec function.
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
This looks for the first argument in the outfiles array's name and
replaces it with the second argument. */
re PR libobjc/11572 (GNU libobjc no longer compiled on Darwin) 2004-09-15 Andrew Pinski <pinskia@physics.uc.edu> PR target/11572 * c-incpath.h (target_c_incpath_s): Add extra_pre_includes. Add two parameters to extra_includes. (C_INCPATH_INIT): Remove. * c-incpath.c (register_include_chains): Call extra_pre_includes before adding the standard include directory. Update call to extra_includes. (!defined TARGET_EXTRA_INCLUDES): Update hook_void_charptr_charptr_int and add !define TARGET_EXTRA_PRE_INCLUDES. (!define TARGET_EXTRA_INCLUDES): Define as hook_void_charptr_charptr_int. (!define TARGET_EXTRA_PRE_INCLUDES): Likewise. (target_c_incpath): Always declare. * fixinclude.c (defined TARGET_EXTRA_INCLUDES): Declare a empty function. (define TARGET_EXTRA_PRE_INCLUDES): Likewise. * config/darwin.h: (darwin_register_frameworks): Update for the two new parameters. (darwin_register_objc_includes): Add prototype. (TARGET_EXTRA_PRE_INCLUDES): Define. * config/darwin-c.c (darwin_register_objc_includes): New function. (darwin_register_frameworks): Update for the two new parameters. (target_c_incpath): Remove. * config/t-darwin (darwin-c.o): Add $(PREPROCESSOR_DEFINES) to the compile line. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Document the two new parameters. (TARGET_EXTRA_PRE_INCLUDES): Document. * gcc.c (spec_function): Add replace-outfile. (replace_outfile_spec_function): New function. * config/darwin.h (LINK_SPEC): Add replace -lobjc with -lobjc-gnu if -fgnu-runtime is supplied. * invoke.texi (replace-outfile): Document. From-SVN: r87588
2004-09-16 08:49:59 +02:00
static const char *
replace_outfile_spec_function (int argc, const char **argv)
{
int i;
/* Must have exactly two arguments. */
if (argc != 2)
abort ();
re PR libobjc/11572 (GNU libobjc no longer compiled on Darwin) 2004-09-15 Andrew Pinski <pinskia@physics.uc.edu> PR target/11572 * c-incpath.h (target_c_incpath_s): Add extra_pre_includes. Add two parameters to extra_includes. (C_INCPATH_INIT): Remove. * c-incpath.c (register_include_chains): Call extra_pre_includes before adding the standard include directory. Update call to extra_includes. (!defined TARGET_EXTRA_INCLUDES): Update hook_void_charptr_charptr_int and add !define TARGET_EXTRA_PRE_INCLUDES. (!define TARGET_EXTRA_INCLUDES): Define as hook_void_charptr_charptr_int. (!define TARGET_EXTRA_PRE_INCLUDES): Likewise. (target_c_incpath): Always declare. * fixinclude.c (defined TARGET_EXTRA_INCLUDES): Declare a empty function. (define TARGET_EXTRA_PRE_INCLUDES): Likewise. * config/darwin.h: (darwin_register_frameworks): Update for the two new parameters. (darwin_register_objc_includes): Add prototype. (TARGET_EXTRA_PRE_INCLUDES): Define. * config/darwin-c.c (darwin_register_objc_includes): New function. (darwin_register_frameworks): Update for the two new parameters. (target_c_incpath): Remove. * config/t-darwin (darwin-c.o): Add $(PREPROCESSOR_DEFINES) to the compile line. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Document the two new parameters. (TARGET_EXTRA_PRE_INCLUDES): Document. * gcc.c (spec_function): Add replace-outfile. (replace_outfile_spec_function): New function. * config/darwin.h (LINK_SPEC): Add replace -lobjc with -lobjc-gnu if -fgnu-runtime is supplied. * invoke.texi (replace-outfile): Document. From-SVN: r87588
2004-09-16 08:49:59 +02:00
for (i = 0; i < n_infiles; i++)
{
if (outfiles[i] && !strcmp (outfiles[i], argv[0]))
outfiles[i] = xstrdup (argv[1]);
}
return NULL;
}
/* Given two version numbers, compares the two numbers.
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
A version number must match the regular expression
([1-9][0-9]*|0)(\.([1-9][0-9]*|0))*
*/
static int
compare_version_strings (const char *v1, const char *v2)
{
int rresult;
regex_t r;
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
if (regcomp (&r, "^([1-9][0-9]*|0)(\\.([1-9][0-9]*|0))*$",
REG_EXTENDED | REG_NOSUB) != 0)
abort ();
rresult = regexec (&r, v1, 0, NULL, 0);
if (rresult == REG_NOMATCH)
fatal ("invalid version number `%s'", v1);
else if (rresult != 0)
abort ();
rresult = regexec (&r, v2, 0, NULL, 0);
if (rresult == REG_NOMATCH)
fatal ("invalid version number `%s'", v2);
else if (rresult != 0)
abort ();
return strverscmp (v1, v2);
}
/* version_compare built-in spec function.
This takes an argument of the following form:
<comparison-op> <arg1> [<arg2>] <switch> <result>
and produces "result" if the comparison evaluates to true,
and nothing if it doesn't.
The supported <comparison-op> values are:
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
>= true if switch is a later (or same) version than arg1
!> opposite of >=
< true if switch is an earlier version than arg1
!< opposite of <
>< true if switch is arg1 or later, and earlier than arg2
<> true if switch is earlier than arg1 or is arg2 or later
If the switch is not present, the condition is false unless
the first character of the <comparison-op> is '!'.
For example,
%:version-compare(>= 10.3 mmacosx-version-min= -lmx)
adds -lmx if -mmacosx-version-min=10.3.9 was passed. */
static const char *
version_compare_spec_function (int argc, const char **argv)
{
int comp1, comp2;
size_t switch_len;
const char *switch_value = NULL;
int nargs = 1, i;
bool result;
if (argc < 3)
fatal ("too few arguments to %%:version-compare");
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
if (argv[0][0] == '\0')
abort ();
if ((argv[0][1] == '<' || argv[0][1] == '>') && argv[0][0] != '!')
nargs = 2;
if (argc != nargs + 3)
fatal ("too many arguments to %%:version-compare");
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
switch_len = strlen (argv[nargs + 1]);
for (i = 0; i < n_switches; i++)
if (!strncmp (switches[i].part1, argv[nargs + 1], switch_len)
&& check_live_switch (i, switch_len))
switch_value = switches[i].part1 + switch_len;
if (switch_value == NULL)
comp1 = comp2 = -1;
else
{
comp1 = compare_version_strings (switch_value, argv[1]);
if (nargs == 2)
comp2 = compare_version_strings (switch_value, argv[2]);
else
comp2 = -1; /* This value unused. */
}
switch (argv[0][0] << 8 | argv[0][1])
{
case '>' << 8 | '=':
result = comp1 >= 0;
break;
case '!' << 8 | '<':
result = comp1 >= 0 || switch_value == NULL;
break;
case '<' << 8:
result = comp1 < 0;
break;
case '!' << 8 | '>':
result = comp1 < 0 || switch_value == NULL;
break;
case '>' << 8 | '<':
result = comp1 >= 0 && comp2 < 0;
break;
case '<' << 8 | '>':
result = comp1 < 0 || comp2 >= 0;
break;
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
default:
fatal ("unknown operator '%s' in %%:version-compare", argv[0]);
Index: ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * config.gcc (*-*-darwin*): Only one target-specific header file for generic darwin. (powerpc-*-darwin*): Add version-specific header files. * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. * config.in: Regenerate. * configure: Regenerate. * gcc.c: Include xregex.h. (version_compare_spec_function): New. (spec_function): Add version-compare. (replace_outfile_spec_function): Reformat comment. (compare_version_strings): New. * config/darwin-c.c (version_as_macro): New. (builtin_define): New. (darwin_cpp_builtins): New. * config/darwin-protos.h (darwin_cpp_builtins): New. * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. (LIB_SPEC): Make unconditional, update comment. (TARGET_C99_FUNCTIONS): Define. * config/darwin.opt: Sort. (mmacosx-version-min=): New. * config/darwin7.h: Delete. * config/darwin8.h: Delete. * config/i386/darwin.h (): Call darwin_cpp_builtins. * config/rs6000/darwin.h (): Call darwin_cpp_builtins. (TARGET_C99_FUNCTIONS): Define. * config/rs6000/darwin7.h: New. * config/rs6000/darwin8.h: New. * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= (-mmacosx-version-min): Document. Index: testsuite/ChangeLog 2005-07-07 Geoffrey Keating <geoffk@apple.com> * gcc.dg/darwin-version-1.c: New. * gcc.dg/builtins-18.c: On Darwin, needs -mmacosx-version-min=10.3. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/torture/builtins-convert-1.c: Likewise. * gcc.dg/torture/builtins-convert-2.c: Likewise. * gcc.dg/torture/builtins-convert-3.c: Likewise. * gcc.dg/torture/builtins-power-1.c: Likewise. * gcc.dg/builtins-config.h: Complain if macosx-version-min not set on Darwin. From-SVN: r101753
2005-07-08 07:51:06 +02:00
}
if (! result)
return NULL;
return argv[nargs + 2];
}
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
/* %:include builtin spec function. This differs from %include in that it
can be nested inside a spec, and thus be conditionalized. It takes
one argument, the filename, and looks for it in the startfile path.
The result is always NULL, i.e. an empty expansion. */
static const char *
include_spec_function (int argc, const char **argv)
{
char *file;
if (argc != 1)
abort ();
file = find_a_file (&startfile_prefixes, argv[0], R_OK, 0);
read_specs (file ? file : argv[0], FALSE);
return NULL;
}
/* %:print-asm-header spec function. Print a banner to say that the
following output is from the assembler. */
static const char *
print_asm_header_spec_function (int arg ATTRIBUTE_UNUSED,
const char **argv ATTRIBUTE_UNUSED)
{
printf (_("Assembler options\n=================\n\n"));
printf (_("Use \"-Wa,OPTION\" to pass \"OPTION\" to the assembler.\n\n"));
fflush (stdout);
return NULL;
}