aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
AgeCommit message (Collapse)AuthorFilesLines
2012-02-13gcc.c (LINK_COMMAND_SPEC): Deal with -fgnu-tm.Eric Botcazou1-1/+7
gcc/ * gcc.c (LINK_COMMAND_SPEC): Deal with -fgnu-tm. (GTM_SELF_SPECS): Define if not already defined. (driver_self_specs): Add GTM_SELF_SPECS. * config/darwin.h (LINK_COMMAND_SPEC_A): Deal with -fgnu-tm. (GTM_SELF_SPECS): Define. * config/i386/cygwin.h (GTM_SELF_SPECS): Likewise. * config/i386/mingw32.h (GTM_SELF_SPECS): Likewise. libitm/ * configure.ac (link_itm): Fix comment. * configure: Regenerate. * testsuite/lib/libitm.exp: Do not pass -litm for the link. From-SVN: r184174
2012-02-08re PR driver/48524 (spec language does not cover switches with separated form)Magnus Granberg1-0/+15
2012-02-08 Magnus Granberg <zorry@gentoo.org> PR driver/48524 * gcc.c (switch_matches) Support switches with separated form, -D and -U. testsuite: * gcc.dg/pr48524.c: New test. * gcc.dg/pr48524.spec: New spec file for test. From-SVN: r184022
2012-02-07gcc.c (main): Don't look for lto-wrapper or lto-wrapper or LTOPLUGINSONAME ↵Jakub Jelinek1-22/+33
if have_c. * gcc.c (main): Don't look for lto-wrapper or lto-wrapper or LTOPLUGINSONAME if have_c. From-SVN: r183971
2012-01-26gcc.c (add_sysrooted_prefix): Remove trailing dir separator from system root.Matthias Klose1-1/+9
2012-01-27 Matthias Klose <doko@ubuntu.com> * gcc.c (add_sysrooted_prefix): Remove trailing dir separator from system root. * incpath.c (add_standard_paths): Likewise. From-SVN: r183591
2012-01-24re PR driver/47249 (ICE in common_handle_option, at opts.c:1695 with unknown ↵Jakub Jelinek1-0/+2
option passed to cc1) PR driver/47249 * common.opt (-pie, -shared, pie, shared): Change from Common to Driver. * gcc.c (display_help): Display help for -pie and -shared. From-SVN: r183474
2012-01-01gcc.c (process_command): Update copyright notice dates.Jakub Jelinek1-2/+2
gcc/ * gcc.c (process_command): Update copyright notice dates. * gcov.c (print_version): Likewise. * gcov-dump.c (print_version): Likewise. * mips-tfile.c (main): Likewise. * mips-tdump.c (main): Likewise. gcc/fortran/ * gfortranspec.c (lang_specific_driver): Update copyright notice dates. gcc/java/ * jcf-dump.c (version): Update copyright notice dates. libmudflap/ * mf-runtime.c (__mf_usage): Update copyright notice dates. libjava/ * gnu/gcj/convert/Convert.java (version): Update copyright notice dates. * gnu/gcj/tools/gcj_dbtool/Main.java (main): Likewise. libjava/classpath/ * gnu/java/rmi/registry/RegistryImpl.java (version): Update copyright notice dates. * tools/gnu/classpath/tools/orbd/Main.java (run): Likewise. From-SVN: r182773
2011-11-03re PR lto/44965 (lto option code breaks file format with each added option)Richard Guenther1-11/+0
2011-11-03 Richard Guenther <rguenther@suse.de> PR lto/44965 * lto-opts.c: Re-implement. * lto-streamer.h (lto_register_user_option): Remove. (lto_read_file_options): Likewise. (lto_reissue_options): Likewise. (lto_clear_user_options): Likewise. (lto_clear_file_options): Likewise. * opts-global.c (post_handling_callback): Remove. (set_default_handlers): Do not set post_handling_callback. (decode_options): Remove LTO specific code. * lto-wrapper.c (merge_and_complain): New function. (run_gcc): Read all input file options and prepend a merged set before the linker driver options. * gcc.c (driver_post_handling_callback): Remove. (set_option_handlers): Do not set post_handling_callback. * opts-common.c (handle_option): Do not call post_handling_callback. * opts.h (struct cl_option_handlers): Remove post_handling_callback. lto/ * lto-lang.c (lto_post_options): Do not read file options. * lto.c (lto_read_all_file_options): Remove. (lto_init): Call lto_set_in_hooks here. From-SVN: r180827
2011-10-26re PR driver/46617 (String concatenation fools extraction for translation.)Paolo Carlini1-1/+1
2011-10-25 Paolo Carlini <paolo.carlini@oracle.com> PR translation/46617 * gcc.c (main): Fix fatal_error string for translation. From-SVN: r180466
2011-09-29Use urandom in gcc.c tooAndi Kleen1-6/+16
gcc also takes generates a random number in some special circumstances, so teach it about /dev/urandom too. gcc/: 2011-09-27 Andi Kleen <ak@linux.intel.com> * gcc.c (get_local_tick). Rename to get_random_number. Read from /dev/urandom. Add getpid call. (compare_debug_dump_opt_spec_function): Drop getpid call. From-SVN: r179349
2011-08-04gcc.c (self_spec): New variable.Jakub Jelinek1-42/+54
* gcc.c (self_spec): New variable. (static_specs): Add self_spec. (main): Call do_self_spec on "self_spec" specs after reading user specs files. Move compare_debug handling right after that. From-SVN: r177394
2011-07-22re PR c++/49756 (g++ ICE)Jakub Jelinek1-0/+4
PR c++/49756 * libiberty.h (stack_limit_increase): New prototype. * stack-limit.c: New file. * Makefile.in: Regenerate deps. (CFILES): Add stack-limit.c. (REQUIRED_OFILES): Add ./stack-limit.$(objext). * configure.ac (checkfuncs): Add getrlimit and setrlimit. (AC_CHECK_FUNCS): Likewise. * configure: Regenerated. * config.in: Regenerated. * gcc.c (main): Call stack_limit_increase (64MB). * toplev.c (toplev_main): Likewise. From-SVN: r176617
2011-07-07gcc.c (%[Spec]): Don't document.Joseph Myers1-58/+10
* gcc.c (%[Spec]): Don't document. (struct spec_list): Update comment. (do_spec_1): Don't handle %[Spec]. * doc/invoke.texi (%[@var{name}]): Remove documentation of spec. From-SVN: r175970
2011-07-07re PR libmudflap/49550 (Many libmudflap tests fail on Solaris 11/x86)Rainer Orth1-1/+1
gcc: PR libmudflap/49550 * gcc.c (MFWRAP_SPEC): Also wrap mmap64. libmudflap: PR libmudflap/49550 * mf-runtime.c (__wrap_main) [__sun__ && __svr4__]: Don't register stdin, stdout, stderr. Register __ctype, __ctype_mask. * configure.ac: Check for mmap64. Check for rawmemchr, stpcpy, mempcpy. * configure: Regenerate. * config.h.in: Regenerate. * mf-hooks1.c [HAVE_MMAP64] (__mf_0fn_mmap64): New function. (mmap64): New wrapper function. * mf-impl.h (__mf_dynamic_index) [HAVE_MMAP64]: Add dyn_mmap64. * mf-runtime.c (__mf_dynamic) [HAVE_MMAP64]: Handle mmap64. * mf-hooks2.c [HAVE_GETMNTENT && HAVE_SYS_MNTTAB_H]: Implement getmntent wrapper. * mf-hooks3.c (_REENTRANT): Define. * testsuite/libmudflap.c/heap-scalestress.c (SCALE): Reduce to 10000. * testsuite/libmudflap.c/pass-stratcliff.c: Include ../config.h. (MIN): Define. Use HAVE_RAWMEMCHR, HAVE_STPCPY, HAVE_MEMPCPY as guards. * testsuite/libmudflap.c/pass47-frag.c: Expect __ctype warning on *-*-solaris2.*. From-SVN: r175961
2011-06-28common.opt (in_lto_p): New Variable entry.Joseph Myers1-2/+11
* common.opt (in_lto_p): New Variable entry. * flags.h (in_lto_p): Move to common.opt. * gcc.c: Include params.h. (set_option_handlers): Also use common_handle_option and target_handle_option. (main): Call global_init_params, finish_params and init_options_struct. * opts.c (debug_type_names): Move from toplev.c. (print_filtered_help): Access quiet_flag through opts pointer. (common_handle_option): Return early in the driver for some options. Access in_lto_p, dwarf_version and warn_maybe_uninitialized through opts pointer. * toplev.c (in_lto_p): Move to common.opt. (debug_type_names): Move to opts.c. * Makefile.in (OBJS): Remove opts.o. (OBJS-libcommon-target): Add opts.o. (gcc.o): Update dependencies. From-SVN: r175591
2011-05-31* gcc.c (driver_handle_option): Fix disabling of -fcompare-debug.Alexandre Oliva1-1/+1
From-SVN: r174492
2011-05-11install.texi (Configuration): Document --with-linker-hash-style.Satoru Takabayashi1-1/+12
2011-05-11 Satoru Takabayashi <satorux@google.com> Paul Pluzhnikov <ppluzhnikov@google.com> * gcc/doc/install.texi (Configuration): Document --with-linker-hash-style. * gcc/gcc.c (init_spec): Handle LINKER_HASH_STYLE. * gcc/config.in: Add LINKER_HASH_STYLE. * gcc/configure.ac: Add --with-linker-hash-style. * gcc/configure: Regenerate. Co-Authored-By: Paul Pluzhnikov <ppluzhnikov@google.com> From-SVN: r173668
2011-04-20remove useless if-before-free testsJim Meyering1-10/+5
Change "if (E) free (E);" to "free (E);" everywhere except in the libgo/, intl/, zlib/ and classpath/ directories. Also transform equivalent variants like "if (E != NULL) free (E);" and allow an extra cast on the argument to free. Otherwise, the tested and freed "E" expressions must be identical, modulo white space. From-SVN: r172785
2011-03-31opts.h (cl_option): Add comments to fields.Joseph Myers1-1/+1
* opts.h (cl_option): Add comments to fields. Add bit-fields for various flags. (CL_SEPARATE_NARGS_SHIFT, CL_SEPARATE_NARGS_MASK, CL_SEPARATE_ALIAS, CL_NO_DRIVER_ARG, CL_REJECT_DRIVER, CL_SAVE, CL_DISABLED, CL_REPOR, CL_REJECT_NEGATIVE, CL_MISSING_OK, CL_UINTEGER, CL_NEGATIVE_ALIAS): Remove. (CL_JOINED, CL_SEPARATE, CL_UNDOCUMENTED): Update bit positions. * opt-functions.awk (flag_init, switch_bit_fields): New. (switch_flags): Don't handle flags moved to bit-fields. Don't generate CL_MISSING_OK or CL_SAVE. * optc-gen.awk: Update to generate bit-field output as well as flags field. * gcc.c (driver_wrong_lang_callback): Use cl_reject_driver bit-field instead of CL_REJECT_DRIVER flag. * opts-common.c (generate_canonical_option, decode_cmdline_option): Use bit-fields instead of CL_* flags. * opts.c (maybe_default_option): Use cl_reject_negative bit-field instead of CL_REJECT_NEGATIVE flag. * toplev.c (print_switch_values): Use cl_report bit-field instead of CL_REPORT flag. From-SVN: r171804
2011-03-25Changelog c-family/Kai Tietz1-14/+15
2011-03-25 Kai Tietz <ktietz@redhat.com> * c-ada-spec.c (compare_comment): Use filename_cmp instead of strcmp for filename. Changelog fortran/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * scanner.c (preprocessor_line): Use filename_cmp instead of strcmp. Changelog gcc/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * collect2.c (write_c_file_stat): Handle backslash as right-hand directory separator. (resolve_lib_name): Use IS_DIR_SEPARATOR instead of checking just for slash. * coverage.c (coverage_init): Use IS_ABSOLUTE_PATH instead of checking for trailing slash. * gcc.c (record_temp_file): Use filename_cmp instead of strcmp. (do_spec_1): Likewise. (replace_outfile_spec_function): Likewise. (is_directory): Use filename_ncmp instead of strncmp. (print_multilib_info): Likewise. * gcov.c (find_source): Use filename_cmp instead instead of strcmp. (make_gcov_file_name): Fix order of slash/backslash checks. * incpath.c (DIRS_EQ): Use filename_cmp instead of strcmp. (add_standard_paths): Likewise. * mips-tfile.c (saber_stop): Handle backslash. * prefix.c (update_path): Use filename_ncmp instead of strncmp. * profile.c (output_location): Use filename_cmp instead of strcmp. * read-md.c (handle_toplevel_file): Handle backslash. * tlink.c (frob_extension): Likewise. * tree-cfg.c (same_line_p): Use filename_cmp instead of strcmp. * tree-dump.c (dequeue_and_dump): Handle backslash. * tree.c (get_file_function_name): Likewise. * gengtype.c (read_input_list): Likewise. (get_file_realbasename): Likewise. (get_output_file_with_visibility): Use filename_cmp instead of strcmp. ChangeLog java/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * jcf-parse.c (java_read_sourcefilenames): Use filename_cmp instead of strcmp. (set_source_filename): Likewise. * win32-host.c (jcf_open_exact_case): Likewise. ChangeLog lto/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * lto.c (lto_resolution_read): Use filename_cmp instead of strcmp. (lto_read_section_data): Likewise. ChangeLog cp/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * lex.c (interface_strcmp): Handle dos-paths. (handle_pragma_implementation): Use filename_cmp instead of strcmp. (in_main_input_context): Likewise. From-SVN: r171522
2011-03-22gcc.c (driver_unknown_option_callback): Only permit and save unknown -Wno- ↵Joseph Myers1-7/+17
options. * gcc.c (driver_unknown_option_callback): Only permit and save unknown -Wno- options. (driver_wrong_lang_callback): Save options directly instead of via driver_unknown_option_callback. From-SVN: r171307
2011-03-16re PR driver/46944 (gcc should accept -fuse-linker-plugin only if linker ↵Rainer Orth1-13/+30
handles -plugin) PR lto/46944 * configure.ac (gcc_cv_gld_major_version, gcc_cv_gld_minor): Handle in-tree gold. (ld_vers): Extract binutils version for gold. (gcc_cv_ld_hidden): Handle gold here. (gcc_cv_lto_plugin): Determine level of linker plugin support. * configure: Regenerate. * config.in: Regenerate. * gcc.c: Only use LTO plugin if HAVE_LTO_PLUGIN > 0, reject -fuse-linker-plugin otherwise. (LINK_PLUGIN_SPEC): Define. Extract from LINK_COMMAND_SPEC. (LINK_COMMAND_SPEC): Use it. (main): Only look for LTOPLUGINSONAME if HAVE_LTO_PLUGIN > 0. From-SVN: r171039
2011-02-23opts-common.c (decode_cmdline_option): Print empty string argument as "" in ↵Jie Zhang1-2/+14
decoded->orig_option_with_args_text. * opts-common.c (decode_cmdline_option): Print empty string argument as "" in decoded->orig_option_with_args_text. * gcc.c (execute): Print empty string argument as "" in the verbose output. (do_spec_1): Keep empty string argument. testsuite/ * gcc.dg/cpp/include7.c: New test. From-SVN: r170426
2011-02-18re PR driver/47787 (GCC with -flto combines preprocessed C sources)Jakub Jelinek1-1/+1
PR driver/47787 * gcc.c (default_compilers): Clear combinable field for "@cpp-output". From-SVN: r170286
2011-02-17re PR driver/47390 (Linking with -export-dynamic broken)Joseph Myers1-0/+1
PR driver/47390 * common.opt (export-dynamic): New Driver option. * gcc.c (LINK_COMMAND_SPEC): Add comment about %{e*}. From-SVN: r170253
2011-02-12re PR driver/45731 (Header missing for assembler option help.)Joseph Myers1-1/+1
PR driver/45731 * gcc.c (asm_options): Correct spec matching --target-help. From-SVN: r170091
2011-02-12gcc.c (driver_handle_option): Concatenate the argument to -F with the switch.Iain Sandoe1-0/+5
gcc: * gcc.c (driver_handle_option): Concatenate the argument to -F with the switch. From-SVN: r170068
2011-02-11re PR driver/47678 (missing error message for -I)Joseph Myers1-0/+4
PR driver/47678 * gcc.c (main): Do not compile inputs if there were errors in option handling. * opts-common.c (read_cmdline_option): Check for wrong language after other error checks. testsuite: * gcc.dg/opts-6.c: New test. From-SVN: r170056
2011-01-31configure.ac (gcc_cv_ld_static_option): Define.Rainer Orth1-1/+2
gcc: * configure.ac (gcc_cv_ld_static_option): Define. (gcc_cv_ld_dynamic_option): Define. (gcc_cv_ld_static_dynamic): Tru64 UNIX support -noso/-so_archive instead. (HAVE_LD_STATIC_DYNAMIC): Update message. (LD_STATIC_OPTION): Define. (LD_DYNAMIC_OPTION): Define. * configure: Regenerate. * config.in: Regenerate. * gcc.c (init_spec) [USE_LIBUNWIND_EXCEPTIONS && HAVE_LD_STATIC_DYNAMIC]: Use them. gcc/cp: * g++spec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use LD_STATIC_OPTION, LD_DYNAMIC_OPTION. gcc/fortran: * gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use LD_STATIC_OPTION, LD_DYNAMIC_OPTION. gcc/go: * gospec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use LD_STATIC_OPTION, LD_DYNAMIC_OPTION. From-SVN: r169435
2011-01-12re PR driver/47244 (plugin linker is used unconditionally)Jan Hubicka1-5/+12
PR driver/47244 * gcc.c (PLUGIN_COND): Update to disable plugin unless -flto is used. (PLUGIN_COND_CLOSE): New macro. (LINK_COMMAND_SPEC): Update to use PLUGIN_COND_CLOSE. From-SVN: r168717
2011-01-08Makefile.in: Regenerate.Jan Hubicka1-1/+17
* Makefile.in: Regenerate. * Makefile.def (gcc host module) and soft dependency on lto-plugin and configure dependency on lto-plugin configure. (lto-plugin module): Remove dependency on GCC; add dependency on liniberty. * doc/invoke.texi: (-flto, -fuse-linker-plugin): Update defaults and no longer claim that gold is required for linker plugin. * configure: Regenerate. * gcc.c (PLUGIN_COND): New macro. (LINK_COMMAND_SPEC): Use it. (main): Default to plugin enabled with HAVE_LTO_PLUGIN is set. * config.in (HAVE_LTO_PLUGIN): New. * configure.ac (--with-lto-plugin): New parameter; autodetect HAVE_LTO_PLUGIN. From-SVN: r168593
2011-01-07Keep -m[arch|tune]=native in COLLECT_GCC_OPTIONS.H.J. Lu1-6/+17
2011-01-07 H.J. Lu <hongjiu.lu@intel.com> PR driver/42445 * gcc.c (%>S): New. (SWITCH_KEEP_FOR_GCC): Likewise. (set_collect_gcc_options): Check SWITCH_KEEP_FOR_GCC. (do_spec_1): Handle "%>". * config/i386/i386.h (CC1_CPU_SPEC): Replace "%<" with "%>". From-SVN: r168583
2011-01-04re PR driver/47137 (gcc incorrectly combines assembly inputs)Jie Zhang1-5/+5
PR driver/47137 * gcc.c (default_compilers[]): Set combinable field to 0 for all assembly languages. From-SVN: r168459
2011-01-03gcc.c (process_command): Update copyright notice dates.Jakub Jelinek1-2/+2
gcc/ * gcc.c (process_command): Update copyright notice dates. * gcov.c (print_version): Likewise. * gcov-dump.c (print_version): Likewise. * mips-tfile.c (main): Likewise. * mips-tdump.c (main): Likewise. gcc/fortran/ * gfortranspec.c (lang_specific_driver): Update copyright notice dates. gcc/java/ * jcf-dump.c (version): Update copyright notice dates. libmudflap/ * mf-runtime.c (__mf_usage): Update copyright notice dates. libjava/ * gnu/gcj/convert/Convert.java (version): Update copyright notice dates. * gnu/gcj/tools/gcj_dbtool/Main.java (main): Likewise. libjava/classpath/ * gnu/java/rmi/registry/RegistryImpl.java (version): Update copyright notice dates. * tools/gnu/classpath/tools/orbd/Main.java (run): Likewise. From-SVN: r168432
2011-01-03Revert revision 168407.H.J. Lu1-1/+1
2011-01-03 H.J. Lu <hongjiu.lu@intel.com> PR driver/47137 * gcc.c (main): Revert revision 168407. From-SVN: r168429
2011-01-02Don't check have_o when settting combine_inputs.H.J. Lu1-1/+1
2011-01-02 H.J. Lu <hongjiu.lu@intel.com> PR driver/47137 * gcc.c (main): Don't check have_o when settting combine_inputs. From-SVN: r168407
2010-12-03common.opt (N, [...]): New options.Joseph Myers1-1/+1
* common.opt (N, Q, Qn, Qy, Z, n, r, s, t): New options. * gcc.c (cc1_options): Add %{Qy:}. ada: * gcc-interface/lang.opt (k8): New option. java: * lang.opt (static-libgcj): New option. From-SVN: r167429
2010-12-03gcc.c (LINK_COMMAND_SPEC): Don't handle -A, -d or -m.Joseph Myers1-3/+3
* gcc.c (LINK_COMMAND_SPEC): Don't handle -A, -d or -m. * config/darwin.h (LINK_COMMAND_SPEC_A): Likewise. * config/i386/djgpp.h (LINK_COMMAND_SPEC): Likewise. From-SVN: r167428
2010-12-03Add Go frontend, libgo library, and Go testsuite.Ian Lance Taylor1-0/+1
gcc/: * gcc.c (default_compilers): Add entry for ".go". * common.opt: Add -static-libgo as a driver option. * doc/install.texi (Configuration): Mention libgo as an option for --enable-shared. Mention go as an option for --enable-languages. * doc/invoke.texi (Overall Options): Mention .go as a file name suffix. Mention go as a -x option. * doc/frontends.texi (G++ and GCC): Mention Go as a supported language. * doc/sourcebuild.texi (Top Level): Mention libgo. * doc/standards.texi (Standards): Add section on Go language. Move references for other languages into their own section. * doc/contrib.texi (Contributors): Mention that I contributed the Go frontend. gcc/testsuite/: * lib/go.exp: New file. * lib/go-dg.exp: New file. * lib/go-torture.exp: New file. * lib/target-supports.exp (check_compile): Match // Go. From-SVN: r167407
2010-12-02gcc.c (trad_capable_cpp, [...]): Don't handle -ftraditional.Joseph Myers1-2/+2
* gcc.c (trad_capable_cpp, default_compilers): Don't handle -ftraditional. objc: * lang-specs.h: Don't handle -ftraditional. From-SVN: r167385
2010-11-30re PR driver/44986 (-fuse-linker-plugin -save-temps gives resolution file ↵Richard Guenther1-1/+2
base name of last argument) 2010-11-30 Richard Guenther <rguenther@suse.de> PR lto/44986 * gcc.c (main): Use the first input with a compiler as infile for link spec processing. From-SVN: r167292
2010-11-29system.h: Include "safe-ctype.h" instead of <safe-ctype.h>.Joseph Myers1-24/+4
* system.h: Include "safe-ctype.h" instead of <safe-ctype.h>. Include <signal.h>, <sys/mman.h>, <sys/resource.h> and <sys/times.h>. (O_BINARY, SIGCHLD, MAP_FAILED, MAP_ANONYMOUS, kill): Conditionally define. (GET_ENVIRONMENT): Poison. * configure.ac: Don't test for mincore. * configure: Regenerate. * config.in: Regenerate. * collect2-aix.c: Don't include <sys/mman.h>. * collect2.c: Don't include <signal.h>. (SIGCHLD): Don't define. (prefix_from_env): Use getenv instead of GET_ENVIRONMENT. * config/alpha/alpha.c: Include "splay-tree.h" instead of <splay-tree.h>. * config/arm/arm.c (arm_target_help): Use getenv instead of GET_ENVIRONMENT. * config/avr/driver-avr.c: Don't include <stdlib.h>. * config/frv/frv.c: Don't include <ctype.h>. * config/host-darwin.c: Don't include <sys/mman.h>. * config/host-hpux.c: Don't include <sys/mman.h> or <unistd.h>. (MAP_FAILED): Don't define. * config/host-linux.c: Don't include <sys/mman.h> or <limits.h>. * config/host-solaris.c: Don't include <sys/mman.h>. * config/i386/cygming.h: Don't include <stdio.h>. * config/i386/driver-i386.c: Don't include <stdlib.h>. * config/i386/host-cygwin.c: Don't include <sys/mman.h>. * config/iq2000/iq2000.c: Don't include <signal.h>. * config/m32c/m32c-pragma.c: Don't include <stdio.h>. * config/m68hc11/m68hc11.c: Don't include <stdio.h>. * config/mep/mep-pragma.c: Don't include <stdio.h>. * config/microblaze/microblaze.c: Don't include <signal.h>. * config/mips/mips.c: Don't include <signal.h>. * config/rs6000/host-darwin.c: Don't include <signal.h>. * cppdefault.c (cpp_relocated): Use getenv instead of GET_ENVIRONMENT. * defaults.h (GET_ENVIRONMENT): Don't define. * et-forest.h: Don't include <ansidecl.h> or <stddef.h>. * gcc.c: Don't include <signal.h>, <sys/mman.h> or <sys/types.h>. (SIGCHLD, MAP_FAILED, kill): Don't define. (process_command): Use getenv instead of GET_ENVIRONMENT. * genhooks.c: Don't include <string.h>. * ggc-common.c: Don't include <sys/resource.h>, <sys/mman.h> or <sys/types.h>. (MAP_FAILED): Don't define. * ggc-page.c Don't include <sys/mman.h>. (MAP_ANONYMOUS, MAP_FAILED): Don't define. * ggc-zone.c: Don't include <sys/mman.h>. (MAP_ANONYMOUS, MAP_FAILED): Don't define. * graph.c: Include "config.h" instead of <config.h>. * incpath.c (add_env_var_paths): Use getenv instead of GET_ENVIRONMENT. * lto-wrapper.c: Don't include <errno.h>, <signal.h> or "libiberty.h". (SIGCHLD, kill): Don't define. * mips-tfile.c: Don't include <signal.h>. * opts.c: Don't include <signal.h> or <sys/resource.h>. (print_specific_help): Use getenv instead of GET_ENVIRONMENT. * passes.c: Don't include <signal.h>, <sys/resource.h> or <sys/times.h>. * sparseset.h: Don't include <assert.h>. * timevar.c: Don't include <sys/times.h> or <sys/resource.h>. * tlink.c: Don't include "libiberty.h". * toplev.c: Don't include <signal.h> or <sys/times.h>. * tree-mudflap.c: Include "demangle.h" instead of <demangle.h>. * tree-switch-conversion.c: Don't include <signal.h>. * vmsdbgout.c: Don't include <errno.h> or <string.h>. c-family: * c-opts.c (check_deps_environment_vars): Use getenv instead of GET_ENVIRONMENT. * c-pch.c (O_BINARY): Don't define here. * c-pragma.h: Include "cpplib.h" instead of <cpplib.h>. fortran: * gfortran.h (alloca): Don't include definitions. (NULL): Don't define. java: * boehm.c: Include "config.h" instead of <config.h>. * builtins.c: Don't include <stdarg.h>. * class.c: Don't include "stdio.h". (O_BINARY): Don't define here. * jcf-depend.c: Don't include <assert.h>. (jcf_dependency_set_dep_file, jcf_dependency_init, jcf_dependency_write): Use gcc_assert. * jcf-io.c (O_BINARY): Don't define here. * jcf-path.c: Don't include "tm.h". (jcf_path_init): Use getenv instead of GET_ENVIRONMENT. * resource.c: Don't include "stdio.h". (O_BINARY): Don't define here. * verify-impl.c: Don't include <stdio.h>. lto: * lto-endian.h: Delete. * lto-object.c: Don't include "libiberty.h". (O_BINARY): Don't define. * lto.c: Don't include "libiberty.h" or <sys/mman.h>. (O_BINARY): Don't define. From-SVN: r167241
2010-11-23re PR driver/42690 (Undefined reference errors with -flto -fuse-linker-plugin)Dave Korn1-9/+46
PR driver/42690 * gcc.c (LINK_COMMAND_SPEC): Remove hard-coded pass-through plugin options, replace by call of pass-through-libs spec function to process link_gcc_c_sequence spec. (lto_libgcc_spec): Delete variable. (static_specs[]): Remove related entry. (static_spec_functions[]): Add new entry for pass-through-libs. (main): Don't generate deleted lto_libgcc_spec. (pass_through_libs_spec_func): New function to implement the new pass-through-libs spec function. * doc/invoke.texi (pass-through-libs): Document new spec function. From-SVN: r167091
2010-11-22re PR driver/43335 (Driver crashes dereferencing a null pointer if it can't ↵Dmitry Gorbachev1-2/+4
find lto-wrapper) 2010-11-22 Dmitry Gorbachev <d.g.gorbachev@gmail.com> PR driver/43335 * gcc.c (main): Don't crash when lto-wrapper program is not found. From-SVN: r167052
2010-11-16gcc.c (char_p): Define.Nathan Froyd1-53/+34
* gcc.c (char_p): Define. Define a VEC of it. (n_linker_options, n_assembler_options, n_preprocessor_options): Delete. (linker_options, assembler_options, preprocessor_options): Convert to a VEC. (add_preprocessor_option): Adjust. (add_assembler_option): Adjust. (add_linker_option): Adjust. (do_specs_vec): New function. (do_spec_1): Call it. Adjust for new types. From-SVN: r166801
2010-11-16gcc.c: Include "vec.h".Joseph Myers1-80/+75
* gcc.c: Include "vec.h". (argbuf): Make into a VEC. (argbuf_length, argbuf_index): Remove. (alloc_args, clear_args, store_arg, execute, insert_wrapper, do_spec, do_self_spec, do_spec_1, eval_spec_function, main, compare_debug_dump_opt_spec_function: Use VEC interfaces on argbuf. * Makefile.in (GCC_OBJS): Add vec.o and ggc-none.o. (gcc.o): Depend on $(VEC_H). From-SVN: r166788
2010-11-12Makefile.in (OPTS_H): Define.Joseph Myers1-4/+6
* Makefile.in (OPTS_H): Define. (c-decl.o, c-family/c-common.o, c-family/c-opts.o, c-family/c-pch.o, c-family/c-pragma.o, gcc.o, gccspec.o, cppspec.o, options.o, gcc-options.o, lto-opts.o, opts.o, opts-common.o, toplev.o, passes.o, matrix-reorg.o, ipa-struct-reorg.o, PLUGIN_HEADERS): Use $(OPTS_H). * gcc.c (driver_handle_option): Take location_t parameter. (process_command, do_self_spec): Update calls to read_cmdline_option. * langhooks-def.h (lhd_handle_option): Take location_t parameter. * langhooks.c (lhd_handle_option): Take location_t parameter. * langhooks.h (handle_option): Take location_t parameter. * lto-opts.c (lto_reissue_options): Update call to set_option. * opts-common.c (handle_option): Make static. Take location_t parameter and pass it to other functions. (handle_generated_option): Take location_t parameter and pass it to other functions. (read_cmdline_option): Take location_t parameter and pass it to other functions. Use warning_at and error_at. (set_option): Take location_t parameter and pass it to other functions. * opts.c (common_handle_option): Take location_t parameter and pass it to other functions. (enable_warning_as_error): Make static. Take location_t parameter and pass it to other functions. (lang_handle_option): Take location_t parameter and pass it to other functions. (target_handle_option): Take location_t parameter. (read_cmdline_options, maybe_default_option, maybe_default_options, default_options_optimization, decode_options): Take location_t parameter and pass it to other functions. * opts.h: Include input.h. (struct cl_option_handler_func, decode_options, set_option, handle_generated_option, read_cmdline_option): Take location_t parameters. (handle_option, enable_warning_as_error): Remove. * toplev.c (toplev_main): Update call to decode_options. ada: * gcc-interface/Make-lang.in (ada/misc.o): Use $(OPTS_H). * gcc-interface/misc.c (gnat_handle_option): Take location_t parameter. c-family: * c-common.c (parse_optimize_options): Update call to decode_options. * c-common.h (c_common_handle_option): Update prototype. * c-opts.c (c_common_handle_option): Take location_t parameter and pass it to other functions. cp: * Make-lang.in (g++spec.o): Use $(OPTS_H). fortran: * Make-lang.in (gfortranspec.o): Use $(OPTS_H). * gfortran.h (gfc_handle_option): Take location_t parameter. * options.c (gfc_handle_option): Take location_t parameter. java: * Make-lang.in (jvspec.o, java/lang.o): Use $(OPTS_H). * lang.c (java_handle_option): Take location_t parameter. lto: * Make-lang.in (lto/lto.o): Use $(OPTS_H). * lto-lang.c (lto_handle_option): Take location_t parameter. From-SVN: r166688
2010-11-11invoke.texi (-fwhopr): Merge into -flto section.Jan Hubicka1-3/+3
* doc/invoke.texi (-fwhopr): Merge into -flto section. (-flto-partition): Document none. * gcc.c (LINK_COMMAND_SPEC): Remove -fwhopr. * lto-wrapper.c: Update comment. (run_gcc): Update LTO option parsing. * opts.c (finish_options): add support -flto-partition=none (common_handle_option): Remove fwhopr. * common.opt: Turn fwhopr into flto. * collect2.c (main): Update option handling. * cgraphunit.c (cgraph_decide_is_function_needed): Remove flag_whopr. * ipa-split.c (execute_split_functions): Remove flag_whopr. * ipa.c (function_and_variable_visibility): Remove flag_whopr. * ipa-prop.c (ipa_compute_jump_functions): Remove flag_whopr. * varpool.c (decide_is_variable_needed): Remove flag_whopr. * gcc.dg/20081223-1.c: Update LTO options. * gcc.dg/lto/20090206-1_0.c: Update LTO options. * gcc.dg/lto/20081118_0.c: Update LTO options. * gcc.dg/lto/ipareference_0.c: Update LTO options. * gcc.dg/lto/20100423-2_0.c: Update LTO options. * gcc.dg/lto/20081201-1_0.c: Update LTO options. * gcc.dg/lto/ipacp_0.c: Update LTO options. * gcc.dg/lto/20090116_0.c: Update LTO options. * gcc.dg/lto/20091015-1_0.c: Update LTO options. * gcc.dg/lto/20090126-2_0.c: Update LTO options. * gcc.dg/lto/20081202-2_0.c: Update LTO options. * gcc.dg/lto/20081204-1_0.c: Update LTO options. * gcc.dg/lto/const-uniq_0.c: Update LTO options. * gcc.dg/lto/20081224_0.c: Update LTO options. * gcc.dg/lto/20090219_0.c: Update LTO options. * gcc.dg/lto/ipareference2_0.c: Update LTO options. * gcc.dg/lto/20090206-2_0.c: Update LTO options. * gcc.dg/lto/20081115_0.c: Update LTO options. * gcc.dg/lto/20081201-2_0.c: Update LTO options. * gcc.dg/lto/20081120-2_0.c: Update LTO options. * gcc.dg/lto/materialize-1_0.c: Update LTO options. * gcc.dg/lto/20090126-1_0.c: Update LTO options. * gcc.dg/lto/20081202-1_0.c: Update LTO options. * gcc.dg/lto/noreturn-1_0.c: Update LTO options. * g++.dg/20090107-1.C: Update LTO options. * g++.dg/lto/pr45679-2_0.C: Update LTO options. * g++.dg/lto/20081123_0.C: Update LTO options. * g++.dg/lto/20090313_0.C: Update LTO options. * g++.dg/lto/20081125_0.C: Update LTO options. * g++.dg/lto/20081109-1_0.C: Update LTO options. * g++.dg/lto/20081219_0.C: Update LTO options. * g++.dg/lto/20100724-1_0.C: Update LTO options. * g++.dg/lto/20081204-1_0.C: Update LTO options. * g++.dg/lto/20090303_0.C: Update LTO options. * g++.dg/lto/20100723-1_0.C: Update LTO options. * g++.dg/lto/pr45679-1_0.C: Update LTO options. * g++.dg/lto/20090128_0.C: Update LTO options. * g++.dg/lto/20081204-2_0.C: Update LTO options. * g++.dg/lto/20090302_0.C: Update LTO options. * g++.dg/lto/20081119-1_0.C: Update LTO options. * g++.dg/lto/20081118_0.C: Update LTO options. * g++.dg/20090121-1.C: Update LTO options. * objc.dg/lto/lto.exp: Update LTO options. * lib/lto.exp: Update LTO options. * lib/gcc-dg.exp: Update LTO options. * lib/c-torture.exp: Update LTO options. * obj-c++.dg/lto/lto.exp: Update LTO options. From-SVN: r166625
2010-11-10common.opt (flag_excess_precision_cmdline, [...]): New Variable declarations.Joseph Myers1-10/+4
* common.opt (flag_excess_precision_cmdline, flag_generate_lto, warn_larger_than, larger_than_size, warn_frame_larger_than, frame_larger_than_size, flag_gen_aux_info, flag_shlib, default_visibility, flag_tls_default): New Variable declarations. (aux-info, auxbase, dumpbase, dumpdir, falign-functions=, falign-jumps=, falign-labels=, falign-loops=, o, v): Use Var. (v): Declare as Common and document here. * flags.h (default_visibility, flag_generate_lto, warn_larger_than, larger_than_size, warn_frame_larger_than, frame_larger_than_size, flag_gen_aux_info, flag_pedantic_errors, flag_shlib, flag_excess_precision_cmdline): Remove. (set_Wstrict_aliasing): Update prototype. * gcc.c (verbose_flag): Remove. (driver_handle_option): Add diagnostic_context parameter. Don't handle OPT_v explicitly here. Set verbose_flag to 1 rather than incrementing it. * opts-common.c (handle_option): Pass dc to handler. * opts.c (warn_larger_than, larger_than_size, warn_frame_larger_than, frame_larger_than_size, default_visibility): Remove. (common_handle_option): Add diagnostic_context parameter. (set_fast_math_flags, set_unsafe_math_optimizations_flags): Add gcc_options parameters. (lang_handle_option, target_handle_option, read_cmdline_options, decode_options): Add diagnostic_context parameters. (finish_options): Access option state through opts pointer where possible. (common_handle_option): Access option state through opts pointer where possible. Do not set local static variable verbose. Do not explicitly handle OPT_v, OPT_Wstrict_aliasing_, OPT_Wstrict_overflow_, OPT_Wunused, OPT_auxbase, OPT_dumpbase, OPT_dumpdir, OPT_falign_functions_, OPT_falign_jumps_, OPT_falign_labels_, OPT_falign_loops_, OPT_fira_verbose_, OPT_o or OPT_fwhopr_. Do not explicitly set .opt file variables for OPT_aux_info or OPT_pedantic_errors. Use dc for diagnostic context. (set_Wstrict_aliasing): Add gcc_options parameter. * opts.h (struct cl_option_handler_func): Add diagnostic_context parameter to handler. (decode_options): Add diagnostic_context parameter. * toplev.c (dump_base_name, dump_dir_name, aux_base_name, asm_file_name, flag_generate_lto, flag_gen_aux_info, aux_info_file_name, flag_shlib, flag_tls_default, flag_excess_precision_cmdline, flag_pedantic_errors): Remove. (toplev_main): Pass global_dc to decode_options. * toplev.h (dump_base_name, dump_dir_name, aux_base_name, aux_info_file_name, asm_file_name): Remove. * tree.h (flag_tls_default): Remove. c-family: * c-common.c (parse_optimize_options): Pass global_dc to decode_options. * c-opts.c (c_common_handle_option): Pass &global_options to set_Wstrict_aliasing. * c.opt (v): Don't mark Common or document here. fortran: * cpp.c (asm_file_name): Don't declare here. objc: * objc-act.c (dump_base_name): Don't declare here. From-SVN: r166565
2010-11-01common.opt (R, [...]): New.Joseph Myers1-1/+1
* common.opt (R, T, Tbss, Tdata, Ttext, h, z): New. * defaults.h (DEFAULT_SWITCH_TAKES_ARG, SWITCH_TAKES_ARG): Remove. (DEFAULT_WORD_SWITCH_TAKES_ARG): Define to 0. * doc/tm.texi.in (SWITCH_TAKES_ARG): Remove. (WORD_SWITCH_TAKES_ARG): Don't refer to SWITCH_TAKES_ARG. Document that options in .opt files do not need to be included. * doc/tm.texi: Regenerate. * gcc.c (LINK_COMMAND_SPEC): Don't include %{x}. * opts-common.c: Update comment on tm.h include. (decode_cmdline_option): Don't use SWITCH_TAKES_ARG. * system.h (SWITCH_TAKES_ARG): Poison. * config/alpha/alpha.h (SWITCH_TAKES_ARG): Remove. * config/darwin.h (WORD_SWITCH_TAKES_ARG): Remove options included in darwin.opt. (LINK_COMMAND_SPEC_A): Don't include %{x}. * config/fr30/fr30.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove. * config/freebsd-spec.h (FBSD_SWITCH_TAKES_ARG): Remove. * config/freebsd.h (SWITCH_TAKES_ARG): Remove. * config/frv/frv.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove. * config/i386/djgpp.h (LINK_COMMAND_SPEC): Don't include %{x}. * config/ia64/ia64.h (SWITCH_TAKES_ARG): Remove. * config/interix.h (WORD_SWITCH_TAKES_ARG): Don't handle -T options. * config/lm32/lm32.h (SWITCH_TAKES_ARG): Remove. * config/m32r/m32r.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove. * config/microblaze/microblaze.h (SWITCH_TAKES_ARG): Remove. * config/mips/mips.h (SWITCH_TAKES_ARG): Remove. * config/mips/netbsd.h (SWITCH_TAKES_ARG): Remove. * config/mips/vxworks.h (SWITCH_TAKES_ARG): Remove. * config/netbsd-aout.h (SWITCH_TAKES_ARG): Remove. * config/netbsd-elf.h (SWITCH_TAKES_ARG): Remove. * config/openbsd.h (SWITCH_TAKES_ARG): Remove. * config/rs6000/sysv4.h (SWITCH_TAKES_ARG): Remove. * config/score/score.h (SWITCH_TAKES_ARG): Remove. * config/sol2.h (SWITCH_TAKES_ARG): Remove. * config/sparc/sp-elf.h (SWITCH_TAKES_ARG): Remove. * config/sparc/sp64-elf.h (SWITCH_TAKES_ARG): Remove. * config/sparc/sparc.h (ASM_SPEC): Don't include %{R}. * config/svr4.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove. From-SVN: r166155
2010-10-23gcc.c (n_switches_alloc_debug_check): New.Joseph Myers1-58/+68
* gcc.c (n_switches_alloc_debug_check): New. (set_option_handlers): New. (process_command): Use set_option_handlers. (do_self_spec): Pass spec-generated options through option handlers. (main): Also save and restore n_switches_alloc when swapping switch arrays. From-SVN: r165891