Commit Graph

1063 Commits

Author SHA1 Message Date
Jason Merrill 00eaaa5056 mangle.c (is_std_substitution): Check for abi_tag.
gcc/cp/
	* mangle.c (is_std_substitution): Check for abi_tag.
libiberty/
	* cp-demangle.c (d_substitution): Handle abi tags on abbreviation.

From-SVN: r215647
2014-09-26 15:57:37 -04:00
Max Ostapenko 29ce50b031 pex-common.h (struct pex_funcs): Add new parameter for open_write field.
libiberty/

2014-09-26  Max Ostapenko  <m.ostapenko@partner.samsung.com>

	* pex-common.h (struct pex_funcs): Add new parameter for open_write field.
	* pex-unix.c (pex_unix_open_write): Add support for new parameter.
	* pex-djgpp.c (pex_djgpp_open_write): Likewise.
	* pex-win32.c (pex_win32_open_write): Likewise.
	* pex-common.c (pex_run_in_environment): Likewise.


include/

2014-09-26  Max Ostapenko  <m.ostapenko@partner.samsung.com>

	* libiberty.h (PEX_STDOUT_APPEND): New flag.
	(PEX_STDERR_APPEND): Likewise.

From-SVN: r215632
2014-09-26 10:58:04 +03:00
Iain Buclaw 43b1b9edfc demangle.h (DMGL_DLANG): New macro.
include/:
	* demangle.h (DMGL_DLANG): New macro.
	(DMGL_STYLE_MASK): Add DMGL_DLANG.
	(demangling_styles): Add dlang_demangling.
	(DLANG_DEMANGLING_STYLE_STRING): New macro.
	(DLANG_DEMANGLING): New macro.
	(dlang_demangle): New prototype.
libiberty/:
	* Makefile.in (CFILES): Add d-demangle.c.
	(REQUIRED_OFILES): Add d-demangle.o.
	* cplus-dem.c (libiberty_demanglers): Add dlang_demangling case.
	(cplus_demangle): Likewise.
	* d-demangle.c: New file.
	* testsuite/Makefile.in (really-check): Add check-d-demangle.
	* testsuite/d-demangle-expected: New file.

From-SVN: r215530
2014-09-23 18:36:14 +00:00
Ian Lance Taylor 0f1fbc836e simple-object-elf.c (simple_object_elf_write_ehdr): Correctly handle objects with more than SHN_LORESERVE sections.
* simple-object-elf.c (simple_object_elf_write_ehdr): Correctly
	handle objects with more than SHN_LORESERVE sections.
	(simple_object_elf_write_shdr): Add sh_link parameter.
	(simple_object_elf_write_to_file): Correctly handle objects with
	more than SHN_LORESERVE sections.

From-SVN: r215394
2014-09-19 15:24:56 +00:00
Andrew Burgess 606f9e78c6 cp-demangle.c (d_dump): Only access field from s_fixed part of the union for DEMANGLE_COMPONENT_FIXED_TYPE.
* cp-demangle.c (d_dump): Only access field from s_fixed part of
	the union for DEMANGLE_COMPONENT_FIXED_TYPE.
	(d_count_templates_scopes): Likewise.

From-SVN: r214740
2014-08-29 15:30:10 -04:00
Gary Benson 635f48009c demangler-fuzzer.c: New file.
libiberty/
	* testsuite/demangler-fuzzer.c: New file.
	* testsuite/Makefile.in (fuzz-demangler): New rule.
	(demangler-fuzzer): Likewise.
	(mostlyclean): Clean up demangler fuzzer.

From-SVN: r213912
2014-08-13 15:56:38 +00:00
Andrew Burgess ac8345a525 Delete temporary string within demangler even in failure cases.
A call to demangle_template might allocate storage within a temporary
string even if the call to demangle_template eventually returns
failure.

This will never cause the demangler to crash, but does leak memory, as
a result I've not added any tests for this.

Calling string_delete is safe, even if nothing is allocated into the
string, the string is initialised with string_init, so we know the
internal pointers are NULL.

libiberty/ChangeLog

	* cplus-dem.c (do_type): Call string_delete even if the call to
	demangle_template fails.

From-SVN: r211449
2014-06-11 10:57:27 +00:00
Ray Donnelly ad484eca9f pex-win32.c (argv_to_cmdline): Don't quote args unnecessarily
2014-06-01  Ray Donnelly  <mingw.android@gmail.com>

        * pex-win32.c (argv_to_cmdline): Don't quote
        args unnecessarily

From-SVN: r211116
2014-06-01 21:09:59 +02:00
Pedro Alves bc2eed9a8e Fix demangler testsuite crashes with CP_DEMANGLE_DEBUG defined
Running the demangler's testsuite with CP_DEMANGLE_DEBUG defined
crashes, with:

 Program received signal SIGSEGV, Segmentation fault.
 0x000000000040a8c3 in d_dump (dc=0x1, indent=12) at ../../src/libiberty/cp-demangle.c:567
 567       switch (dc->type)

 (gdb) bt 3
 #0  0x000000000040a8c3 in d_dump (dc=0x1, indent=12) at ../../src/libiberty/cp-demangle.c:567
 #1  0x000000000040ae47 in d_dump (dc=0x7fffffffd098, indent=10) at ../../src/libiberty/cp-demangle.c:787
 #2  0x000000000040ae47 in d_dump (dc=0x7fffffffd0c8, indent=8) at ../../src/libiberty/cp-demangle.c:787

Note dc=0x1, which is obviously a bogus pointer.  This is the end of
d_dump recursing for a component type that that doesn't actually have
subtrees:

 787       d_dump (d_left (dc), indent + 2);
 788       d_dump (d_right (dc), indent + 2);

This fixes the two cases the testsuite currently trips on.

libiberty/
2014-05-28  Pedro Alves  <palves@redhat.com>

	* cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_FUNCTION_PARAM
	and DEMANGLE_COMPONENT_NUMBER.

From-SVN: r211035
2014-05-28 21:55:41 +00:00
Thomas Schwinge 6aa9ea7f4c Fix test in libiberty/testsuite/demangle-expected.
libiberty/
	* testsuite/demangle-expected: Fix last commit.

From-SVN: r210803
2014-05-22 13:56:45 +02:00
Andrew Burgess 70c8c2b932 cplus-dmem.c (internal_cplus_demangle): Free any resources allocated by possible previous call to gnu_special.
libiberty/
2014-05-14  Andrew Burgess  <aburgess@broadcom.com>

	* cplus-dmem.c (internal_cplus_demangle): Free any resources
	allocated by possible previous call to gnu_special.
	(squangle_mop_up): Reset pointers to NULL after calling free.
	* testsuite/demangle-expected: New test case.

From-SVN: r210425
2014-05-14 14:18:49 +00:00
Gary Benson 861c349582 cp-demangle.c (struct d_component_stack): New structure.
libiberty/
2014-05-08  Gary Benson  <gbenson@redhat.com>

	* cp-demangle.c (struct d_component_stack): New structure.
	(struct d_print_info): New field component_stack.
	(d_print_init): Initialize the above.
	(d_print_comp_inner): Renamed from d_print_comp.
	Do not restore template stack if it would cause a loop.
	(d_print_comp): New function.
	* testsuite/demangle-expected: New test cases.

From-SVN: r210205
2014-05-08 09:13:44 +00:00
Jakub Jelinek 4f148bbc73 re PR sanitizer/56781 (boostrap-asan failure: fixincl fails to link (missing -lasan))
PR sanitizer/56781
lto-plugin/
	* Makefile.am (CFLAGS, LDFLAGS): Filter out -fsanitize=address.
	(liblto_plugin_la_LIBADD, liblto_plugin_la_LDFLAGS,
	liblto_plugin_la_DEPENDENCIES): Prefer ../libiberty/noasan/libiberty.a
	over ../libiberty/pic/libiberty.a if the former exists.
	* Makefile.in: Regenerated.
libiberty/
	* maint-tool: Also emit rule for noasan/ subdirectory.
	* configure.ac (NOASANFLAG): Set and substitute.
	* Makefile.in: Regenerated.
	(NOASANFLAG): Set.
	(all, $(TARGETLIB), mostlyclean): Handle noasan subdir like pic
	subdir.
	(stamp-noasandir): New goal.
	* configure: Regenerated.

From-SVN: r209476
2014-04-17 14:25:25 +02:00
Richard Biener 25336bb650 simple-object.c (simple_object_internal_write): Handle EINTR and short writes.
2014-04-01  Richard Biener  <rguenther@suse.de>

	libiberty/
	* simple-object.c (simple_object_internal_write): Handle
	EINTR and short writes.

From-SVN: r208972
2014-04-01 07:45:48 +00:00
Richard Biener 2486c24a8c simple-object.c (simple_object_internal_read): Handle EINTR and short reads.
2014-03-28  Richard Biener  <rguenther@suse.de>

	libiberty/
	* simple-object.c (simple_object_internal_read): Handle
	EINTR and short reads.

	lto-plugin/
	* lto-plugin.c (process_symtab): Handle EINTR and short reads.

From-SVN: r208898
2014-03-28 14:05:49 +00:00
Uros Bizjak dd19cdda76 * regex.c (bzero) [!_LIBC]: Cast the call to memcpy to (void).
From-SVN: r208558
2014-03-13 23:04:07 +01:00
Uros Bizjak 52684bb3c8 regex.c (bzero): Define without coma expression.
* regex.c (bzero) [!_LIBC]: Define without coma expression.
	(regerror): Cast the call to memcpy to (void) to avoid unused
	value warnings.

From-SVN: r208553
2014-03-13 19:34:47 +01:00
Thomas Schwinge e191f50260 Avoid "'dc' may be uninitialized" warning.
libiberty/
	* cp-demangle.c (d_demangle_callback): Put an abort call in place,
	to help the compiler.

From-SVN: r207200
2014-01-28 20:06:44 +01:00
Tom Tromey d2d21de9dc include
* ansidecl.h (ANSI_PROTOTYPES, PTRCONST, LONG_DOUBLE, PARAMS)
	(VPARAMS, VA_START, VA_OPEN, VA_CLOSE, VA_FIXEDARG, CONST)
	(VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID, AND, DOTS)
	(NOARGS): Don't define.
	* libiberty.h (expandargv, writeargv): Don't use PARAMS.
libiberty
	* _doprint.c (checkit): Use stdarg, not VA_* macros.
	* asprintf.c (asprintf): Use stdarg, not VA_* macros.
	* concat.c (concat_length, concat_copy, concat_copy2, concat)
	(reconcat): Use stdarg, not VA_* macros.
	* snprintf.c (snprintf): Use stdarg, not VA_* macros.
	* vasprintf.c (checkit): Use stdarg, not VA_* macros.
	* vsnprintf.c (checkit): Use stdarg, not VA_* macros.

From-SVN: r206881
2014-01-21 15:09:10 +00:00
Mike Frysinger 0225cc0f1f libiberty: fix --enable-install-libiberty flag [PR 56780]
Commit 199570 fixed the --disable-install-libiberty behavior, but it also
added a bug where the enable path never works because the initial clear
of target_header_dir wasn't deleted.  So we end up initializing properly
at the top only to reset it at the end all the time.

From-SVN: r206367
2014-01-06 18:15:31 +00:00
Gary Benson 0a15a50e83 cp-demangle.c (struct d_print_info): New fields next_saved_scope...
libiberty/
2014-01-06  Gary Benson  <gbenson@redhat.com>

	* cp-demangle.c (struct d_print_info): New fields
	next_saved_scope, copy_templates, next_copy_template and
	num_copy_templates.
	(d_count_templates): New function.
	(d_print_init): New parameter "dc".
	Estimate numbers of templates and scopes required.
	(d_print_free): Removed function.
	(cplus_demangle_print_callback): Allocate stack for
	templates and scopes.  Removed call to d_print_free.
	(d_copy_templates): Removed function.
	(d_save_scope): New function.
	(d_get_saved_scope): Likewise.
	(d_print_comp): Replace state saving/restoring code with
	calls to d_save_scope and d_get_saved_scope.

From-SVN: r206362
2014-01-06 14:14:21 +00:00
Jason Merrill 1f26ac8748 re PR c++/41090 (Using static label reference in c++ class constructor produces wrong code)
PR c++/41090
	Add -fdeclone-ctor-dtor.
gcc/cp/
	* optimize.c (can_alias_cdtor, populate_clone_array): Split out
	from maybe_clone_body.
	(maybe_thunk_body): New function.
	(maybe_clone_body): Call it.
	* mangle.c (write_mangled_name): Remove code to suppress
	writing of mangled name for cloned constructor or destructor.
	(write_special_name_constructor): Handle decloned constructor.
	(write_special_name_destructor): Handle decloned destructor.
	* method.c (trivial_fn_p): Handle decloning.
	* semantics.c (expand_or_defer_fn_1): Clone after setting linkage.
gcc/c-family/
	* c.opt: Add -fdeclone-ctor-dtor.
	* c-opts.c (c_common_post_options): Default to on iff -Os.
gcc/
	* cgraph.h (struct cgraph_node): Add calls_comdat_local.
	(symtab_comdat_local_p, symtab_in_same_comdat_p): New.
	* cif-code.def: Add USES_COMDAT_LOCAL.
	* symtab.c (verify_symtab_base): Make sure we don't refer to a
	comdat-local symbol from outside its comdat.
	* cgraph.c (verify_cgraph_node): Likewise.
	* cgraphunit.c (mark_functions_to_output): Don't mark comdat-locals.
	* ipa.c (symtab_remove_unreachable_nodes): Likewise.
	(function_and_variable_visibility): Handle comdat-local fns.
	* ipa-cp.c (determine_versionability): Don't clone comdat-locals.
	* ipa-inline-analysis.c (compute_inline_parameters): Update
	calls_comdat_local.
	* ipa-inline-transform.c (inline_call): Likewise.
	(save_inline_function_body): Don't clear DECL_COMDAT_GROUP.
	* ipa-inline.c (can_inline_edge_p): Check calls_comdat_local.
	* lto-cgraph.c (input_overwrite_node): Read calls_comdat_local.
	(lto_output_node): Write it.
	* symtab.c (symtab_dissolve_same_comdat_group_list): Clear
	DECL_COMDAT_GROUP for comdat-locals.
include/
	* demangle.h (enum gnu_v3_ctor_kinds):
	Added literal gnu_v3_unified_ctor.
	(enum gnu_v3_ctor_kinds):
	Added literal gnu_v3_unified_dtor.
libiberty/
	* cp-demangle.c (cplus_demangle_fill_ctor,cplus_demangle_fill_dtor):
	Handle unified ctor/dtor.
	(d_ctor_dtor_name): Handle unified ctor/dtor.

From-SVN: r206182
2013-12-23 12:49:47 -05:00
Cary Coutant 85d09f6173 Fix demangler to handle conversion operators correctly.
libiberty/
	PR other/59195
	* cp-demangle.c (struct d_info_checkpoint): New struct.
	(struct d_print_info): Add current_template field.
	(d_operator_name): Set flag when processing a conversion
	operator.
	(cplus_demangle_type): When processing <template-args> for
	a conversion operator, backtrack if necessary.
	(d_expression_1): Renamed from d_expression.
	(d_expression): New wrapper around d_expression_1.
	(d_checkpoint): New function.
	(d_backtrack): New function.
	(d_print_init): Initialize current_template.
	(d_print_comp): Set current_template.
	(d_print_cast): Put current_template in scope for
	printing conversion operator name.
	(cplus_demangle_init_info): Initialize is_expression and
	is_conversion.
	* cp-demangle.h (struct d_info): Add is_expression and
	is_conversion fields.
	* testsuite/demangle-expected: New test cases.

From-SVN: r205292
2013-11-22 14:25:49 -08:00
Andreas Schwab 66204992cb picflag.m4 (m68k-*-*): Use default PIC flag.
config/
* picflag.m4 (m68k-*-*): Use default PIC flag.

gcc/
* configure: Regenerate.

libada/
* configure: Regenerate.

libgcc/
* configure: Regenerate.

libiberty/
* configure: Regenerate.

From-SVN: r204854
2013-11-15 17:49:36 +00:00
Uros Bizjak 27297d2d1b cp-demangle.c (d_copy_templates): Cast result of malloc to (struct d_print_template *).
* cp-demangle.c (d_copy_templates): Cast result of malloc
	to (struct d_print_template *).
	(d_print_comp): Cast result of realloc to (struct d_saved scope *).

From-SVN: r204713
2013-11-12 21:02:21 +01:00
Marc Glisse eda14d6a85 re PR tree-optimization/58689 ([meta-bug] __attribute__((returns_nonnull)) enhancements)
2013-10-29  Marc Glisse  <marc.glisse@inria.fr>

	PR tree-optimization/58689
include/
	* ansidecl.h (ATTRIBUTE_RETURNS_NONNULL): New macro.
	* libiberty.h (basename, lbasename, dos_lbasename, unix_lbasename,
	concat_copy): Mark with attributes nonnull(1) and returns_nonnull.
	(concat, reconcat, concat_copy2, choose_temp_base, xstrerror,
	xmalloc, xrealloc, xcalloc, xstrdup, xstrndup, xmemdup, pex_init):
	Mark with attribute returns_nonnull.

libiberty/
	* concat.c: Remove note about xmalloc.

From-SVN: r204159
2013-10-29 13:15:48 +00:00
Gerald Pfeifer 4962e51350 * testsuite/test-demangle.c: Include unistd.h.
From-SVN: r204107
2013-10-27 18:35:20 +00:00
Gary Benson c24d86bcb2 cp-demangle.c (struct d_saved_scope): New structure.
libiberty/
2013-10-25  Gary Benson  <gbenson@redhat.com>

	* cp-demangle.c (struct d_saved_scope): New structure.
	(struct d_print_info): New fields saved_scopes and
	num_saved_scopes.
	(d_print_init): Initialize the above.
	(d_print_free): New function.
	(cplus_demangle_print_callback): Call the above.
	(d_copy_templates): New function.
	(d_print_comp): New variables saved_templates and
	need_template_restore.
	[DEMANGLE_COMPONENT_REFERENCE,
	DEMANGLE_COMPONENT_RVALUE_REFERENCE]: Capture scope the first
	time the component is traversed, and use the captured scope for
	subsequent traversals.
	* testsuite/demangle-expected: Add regression test.

From-SVN: r204068
2013-10-25 13:56:51 +00:00
Gerald Pfeifer 89ac07979f * testsuite/test-expandargv.c: Include unistd.h.
From-SVN: r203993
2013-10-23 21:31:45 +00:00
Gerald Pfeifer ecdbd01aa1 Fix up ChangeLog entries (name, e-mail, formatting, otherwise).
From-SVN: r203992
2013-10-23 21:30:54 +00:00
David Malcolm 459260ecf8 Add --enable-host-shared configuration option
/
	* configure.ac: Add --enable-host-shared
	* configure: Regenerate.

gcc/
	* Makefile.in (PICFLAG): New.
	(enable_host_shared): New.
	(INTERNAL_CFLAGS): Use PICFLAG.
	(LIBIBERTY): Use pic build of libiberty.a if configured with
	--enable-host-shared.
	* configure.ac: Add --enable-host-shared, setting up new
	PICFLAG variable.
	* configure: Regenerate.
	* doc/install.texi (--enable-shared): Add note contrasting it
	with...
	(--enable-host-shared): New option.

libbacktrace/
	* configure.ac: Add --enable-host-shared, setting up
	pre-existing PIC_FLAG variable within Makefile.am et al.
	* configure: Regenerate.

libcpp/
	* Makefile.in (PICFLAG): New.
	(ALL_CFLAGS): Add PICFLAG.
	(ALL_CXXFLAGS): Likewise.
	* configure.ac: Add --enable-host-shared, setting up new
	PICFLAG variable.
	* configure: Regenerate.

libdecnumber/
	* Makefile.in (PICFLAG): New.
	(ALL_CFLAGS): Add PICFLAG.
	* configure.ac: Add --enable-host-shared, setting up new
	PICFLAG variable.
	* configure: Regenerate.

libiberty/
	* configure.ac: If --enable-host-shared, use -fPIC.
	* configure: Regenerate.

zlib/
	* configure.ac: Add --enable-host-shared, setting up new
	PICFLAG variable.
	* Makefile.am: Add PICFLAG to libz_a_CFLAGS.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

From-SVN: r203632
2013-10-15 20:33:55 +00:00
Paul Pluzhnikov ea0882a0ab cp-demangle.c (d_name): Demangle local-source-names.
2013-10-11  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* cp-demangle.c (d_name): Demangle local-source-names.
	* testsuite/demangle-expected: New test.

From-SVN: r203476
2013-10-11 17:31:18 -07:00
Gary Benson 0e2cd22d3d ChangeLog: Add missing file to two entries.
* libiberty/ChangeLog: Add missing file to two entries.

From-SVN: r202526
2013-09-12 13:27:46 +00:00
Paolo Carlini 8b415b271e re PR bootstrap/58386 (libstdc++.so.6: undefined symbol: htab_hash_pointer)
2013-09-10  Paolo Carlini  <paolo.carlini@oracle.com>

	PR bootstrap/58386
	Revert:

	2013-09-10  Gary Benson  <gbenson@redhat.com>

	* cp-demangle.c: Include hashtab.h.
	(struct d_print_info): New field saved_scopes.
	(d_print_init): Initialize the above.
	(d_print_free): New function.
	(cplus_demangle_print_callback): Call the above.
	(struct d_saved_scope): New structure.
	(d_store_scope): New function.
	(d_free_scope) Likewise.
	(d_restore_scope) Likewise.
	(d_hash_saved_scope) Likewise.
	(d_equal_saved_scope) Likewise.
	(d_print_comp): New variable saved_scope.
	[DEMANGLE_COMPONENT_REFERENCE,
	DEMANGLE_COMPONENT_RVALUE_REFERENCE]: Capture scope the first
	time the component is traversed, and use the captured scope for
	subsequent traversals.

From-SVN: r202480
2013-09-10 18:45:29 +00:00
Gary Benson 669ea36c4a cp-demangle.c: Include hashtab.h.
2013-09-10  Gary Benson  <gbenson@redhat.com>

	* cp-demangle.c: Include hashtab.h.
	(struct d_print_info): New field saved_scopes.
	(d_print_init): Initialize the above.
	(d_print_free): New function.
	(cplus_demangle_print_callback): Call the above.
	(struct d_saved_scope): New structure.
	(d_store_scope): New function.
	(d_free_scope) Likewise.
	(d_restore_scope) Likewise.
	(d_hash_saved_scope) Likewise.
	(d_equal_saved_scope) Likewise.
	(d_print_comp): New variable saved_scope.
	[DEMANGLE_COMPONENT_REFERENCE,
	DEMANGLE_COMPONENT_RVALUE_REFERENCE]: Capture scope the first
	time the component is traversed, and use the captured scope for
	subsequent traversals.

From-SVN: r202442
2013-09-10 12:33:50 +00:00
Alan Modra a98cbc3694 floatformat.h (floatformat_ibm_long_double): Delete.
include/
	* floatformat.h (floatformat_ibm_long_double): Delete.
	(floatformat_ibm_long_double_big): Declare.
	(floatformat_ibm_long_double_little): Declare.
libiberty/
	* floatformat.c (floatformat_ibm_long_double): Rename to..
	(floatformat_ibm_long_double_big): ..this.
	(floatformat_ibm_long_double_little): New.

From-SVN: r201869
2013-08-20 15:01:41 +09:30
Mike Stump 9ffaa03201 Fix typo.
From-SVN: r201139
2013-07-22 17:23:17 +00:00
Mike Stump b39e7f07ef Fix.
From-SVN: r201102
2013-07-21 16:48:23 +00:00
Tristan Gingold 3830d98a8b makefile.vms (OBJS): Add dwarfnames.obj
2013-07-09  Tristan Gingold  <gingold@adacore.com>

	* makefile.vms (OBJS): Add dwarfnames.obj

From-SVN: r200812
2013-07-09 07:43:35 +00:00
Matt Burgess 8c9fddf41d re PR other/56780 (--disable-install-libiberty still installs libiberty.a)
PR other/56780
	* libiberty/configure.ac: Move test for --enable-install-libiberty
	outside of the 'with_target_subdir' test so that it actually gets
	run.  Add output messages to show the test result.
	* libiberty/configure: Regenerate.
	* libiberty/Makefile.in (install_to_libdir): Place the
	installation of the libiberty library in the same guard as that
	used for the headers to prevent it being installed unless
	requested via --enable-install-libiberty.

From-SVN: r199570
2013-06-01 00:20:49 +00:00
David Edelsohn b768e8cf27 hashtab.c (hash_pointer): Remove conditional and avoid unexecuted shift equal to wordsize.
2013-05-06  David Edelsohn  <dje.gcc@gmail.com>
            Peter Bergner  <bergner@vnet.ibm.com>
            Segher Boessenkool  <segher@kernel.crashing.org>
            Jakub Jelinek  <jakub@redhat.com>

        * hashtab.c (hash_pointer): Remove conditional and avoid
        unexecuted shift equal to wordsize.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
Co-Authored-By: Peter Bergner <bergner@vnet.ibm.com>
Co-Authored-By: Segher Boessenkool <segher@kernel.crashing.org>

From-SVN: r198633
2013-05-06 11:40:54 -04:00
Andi Kleen 86210f13cd Improve pointer hash function to include all bits
The hashtab pointer hash function is not very good. It throws most of the
bits in the pointer away.

This changes pointer_hash to use the mix code from jhash function that mixes
all the bits on the pointer and makes them dependent on each other, before doing
the modulo.

libiberty/:

2013-04-22  Andi Kleen <ak@linux.intel.com>

	* hashtab.c (hash_pointer): Move to end of file and reimplement.

From-SVN: r198171
2013-04-23 03:09:47 +00:00
Jason Merrill 0861bec80a cp-demangle.c (cplus_demangle_type): Fix function quals.
libiberty/
	* cp-demangle.c (cplus_demangle_type): Fix function quals.
	(d_pointer_to_member_type): Simplify.
gcc/cp/
	* mangle.c (write_type): When writing a function type with
	function-cv-quals, don't add the unqualified type as a
	substitution candidate.

From-SVN: r197460
2013-04-03 20:14:00 -04:00
Jason Merrill 9eb85f2724 Demangle C++11 ref-qualifier.
include/
	* demangle.h (enum demangle_component_type): Add
	DEMANGLE_COMPONENT_REFERENCE_THIS,
	DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS.
libiberty/
	* cp-demangle.c (d_ref_qualifier): New.
	(d_nested_name, d_function_type): Use it.
	(d_parmlist): Don't get confused by a ref-qualifier.
	(cplus_demangle_type): Reorder ref-qualifier.
	(d_pointer_to_member_type): Likewise.
	(d_dump): Handle DEMANGLE_COMPONENT_REFERENCE_THIS and
	DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS.
	(d_make_comp, has_return_type, d_encoding): Likewise.
	(d_print_comp, d_print_mod_list, d_print_mod): Likewise.
	(d_print_function_type, is_ctor_or_dtor): Likewise.

From-SVN: r197436
2013-04-03 13:24:12 -04:00
Kai Tietz 071928d9dc configure: Regenerated.
* configure: Regenerated.

From-SVN: r197177
2013-03-27 23:00:03 +01:00
Tobias Burnus 34d3a672a8 make-obstacks-texi.pl: New.
contrib/
2013-03-06  Tobias Burnus  <burnus@net-b.de>

        * make-obstacks-texi.pl: New.

libiberty/
2013-03-06  Tobias Burnus  <burnus@net-b.de>

        * libiberty.texi: Update comment, remove lowersections.
        * obstacks.texi: Regenerate.

From-SVN: r196486
2013-03-06 09:38:22 +01:00
Jakub Jelinek 233fa36063 re PR middle-end/56526 (false positive for maybe-uninitialized)
PR middle-end/56526
	* simple-object-mach-o.c (simple_object_mach_o_segment): Initialize
	wrapper_sect_offset to avoid a warning.

From-SVN: r196466
2013-03-05 16:16:49 +01:00
Tobias Burnus 40bf31ed08 extended.texi (C Extensions): Change order in @menu to match @node.
gcc/
2013-03-01  Tobias Burnus  <burnus@net-b.de>

        * doc/extended.texi (C Extensions): Change order in @menu
        to match @node.
        (Other MIPS Built-in Functions): Move last MIPS entry before
        "picoChip Built-in Functions".
        (SH Built-in Functions): Move after RX Built-in Functions.
        * doc/gcc.texi (Introduction): Change order in @menu
        to match @node.
        * doc/md.texi (Constraints): Ditto.
        * gty.texi (Type Information): Ditto.
        (User-provided marking routines for template types): Make
        subsection.
        * doc/invoke.texi (AArch64 Options): Move before
        "Adapteva Epiphany Options".

libiberty/
2013-03-01  Andreas Schwab  <schwab@linux-m68k.org>

        * obstacks.texi (Obstacks): Trim @node to only contain the
        node name.
        * libiberty.texi (Obstacks): Lower section.

From-SVN: r196388
2013-03-01 20:01:57 +01:00
Jason Merrill 622aac0b88 re PR c++/55223 ([C++11] Default lambda expression of a templated class member)
PR c++/55223
gcc/cp/
	* pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
	default argument scope.
	* mangle.c (write_name): Likewise.
libiberty/
	* cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_DEFAULT_ARG.
	(d_print_comp): Likewise.

From-SVN: r196065
2013-02-14 20:26:44 -05:00
Jakub Jelinek 4ab7747c26 re PR other/56245 (-fsanitize=address miscompiles GCC)
PR other/56245
	* regex.c (PTR_INT_TYPE): Define.
	(EXTEND_BUFFER): Change incr type from int to PTR_INT_TYPE.

From-SVN: r195918
2013-02-09 19:41:00 +01:00
Kai Tietz b713829735 Correct ChangeLog's mentioned PR-number.
From-SVN: r195607
2013-01-31 09:31:16 +01:00
Kai Tietz 1d77deec05 re PR other/54620 (sha1.c has incorrect math if sizeof(size_t) is 8)
PR other/54620
	* sha1.c (sha1_process_block):  Handle case that size_t is
	a wider-integer-scalar as a 32-bit unsigned integer.

From-SVN: r195604
2013-01-31 09:17:58 +01:00
Kai Tietz 4cfc6e54ba re PR other/54620 (sha1.c has incorrect math if sizeof(size_t) is 8)
PR other/54620
	* sha1.c (sha1_process_block):  Handle case that size_t is
	a wider-integer-scalar as a 32-bit unsigned integer.

From-SVN: r195603
2013-01-31 09:17:37 +01:00
Kai Tietz b1a2e8c606 2013-01-31 Kai Tietz <ktietz@redhat.com>
PR other/543413
	* md5.c (md5_process_block):  Handle case that size_t is
	a wider-integer-scalar a 32-bit unsigned integer.

From-SVN: r195600
2013-01-31 09:11:43 +01:00
Ian Lance Taylor ad8c59a1b9 re PR other/54800 (libiberty/simple-object-mach-o.c:704: possible optimisation ?)
PR other/54800
	* simple-object-mach-o.c (simple_object_mach_o_segment): Don't
	bother to zero out a buffer we are about to set anyhow.

From-SVN: r194914
2013-01-04 19:00:06 +00:00
David Edelsohn a9b01f002f simple-object-xcoff.c: New file.
* simple-object-xcoff.c: New file.
        * Makefile.in: Add it to build machinery.
        * simple-object-common.h (simple_object_xcoff_functions): Declare.
        * simple-object.c (format_functions): Add
        simple_object_xcoff_functions.

From-SVN: r194774
2013-01-01 21:04:42 -05:00
Jason Merrill c61e8502c1 cp-demangle.c (d_unqualified_name): Handle abi tags here.
* cp-demangle.c (d_unqualified_name): Handle abi tags here.
	(d_name): Not here.

From-SVN: r193401
2012-11-10 21:11:15 -05:00
Jason Merrill 7dbb85a793 Add C++ attribute abi_tag and -Wabi-tag option.
gcc/
	* attribs.c (lookup_attribute_spec): Handle getting a TREE_LIST.
gcc/c-family/
	* c.opt (Wabi-tag): New.
gcc/cp/
	* tree.c (cxx_attribute_table): Add abi_tag attribute.
	(check_abi_tag_redeclaration, handle_abi_tag_attribute): New.
	* class.c (find_abi_tags_r, check_abi_tags): New.
	(check_bases, check_field_decl): Call check_abi_tags.
	* decl.c (redeclaration_error_message): Call
	check_abi_tag_redeclaration.
	* mangle.c (tree_string_cmp, write_abi_tags): New.
	(write_unqualified_name): Call write_abi_tags.
include/
	* demangle.h (enum demangle_component_type): Add
	DEMANGLE_COMPONENT_TAGGED_NAME.
libiberty/
	* cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_TAGGED_NAME.
	(d_make_comp, d_find_pack, d_print_comp): Likewise.
	(d_abi_tags): New.
	(d_name): Call it.

From-SVN: r193367
2012-11-09 11:14:37 -05:00
Jason Merrill 7c424acd9a Allow dynamic initialization of thread_locals.
gcc/cp/
	* decl.c: Define tls_aggregates.
	(expand_static_init): Remove sorry.  Add to tls_aggregates.
	* cp-tree.h: Declare tls_aggregates.
	* call.c (set_up_extended_ref_temp): Add to tls_aggregates.
	* decl2.c (var_needs_tls_wrapper): New.
	(var_defined_without_dynamic_init): New.
	(get_tls_init_fn, get_tls_wrapper_fn): New.
	(generate_tls_wrapper, handle_tls_init): New.
	(cp_write_global_declarations): Call handle_tls_init and
	enerate_tls_wrapper.
	* mangle.c (write_guarded_var_name): Split out from..
	(mangle_guard_variable): ...here.
	(mangle_tls_init_fn, mangle_tls_wrapper_fn): Use it.
	(decl_tls_wrapper_p): New.
	* semantics.c (finish_id_expression): Replace use of thread_local
	variable with a call to its wrapper.
libiberty/
	* cp-demangle.c (d_special_name, d_dump): Handle TH and TW.
	(d_make_comp, d_print_comp): Likewise.
include/
	* demangle.h (enum demangle_component_type): Add
	DEMANGLE_COMPONENT_TLS_INIT and DEMANGLE_COMPONENT_TLS_WRAPPER.

From-SVN: r192211
2012-10-08 10:45:37 -04:00
Ian Lance Taylor 9a9baa5254 strnlen.c: New file.
* strnlen.c: New file.
	* configure.ac: Check for strnlen, add it to AC_LIBOBJ if it's not
	present.
	* Makefile.in: Rebuild dependencies.
	(CFILES): Add strnlen.c.
	(CONFIGURED_OFILES): Add ./strnlen.$(objext).
	* configure, config.in, functions.texi: Rebuild.

	* maint-tool: Accept .def files in the include directory.

From-SVN: r191432
2012-09-18 16:03:01 +00:00
Florian Weimer ed770de906 PR other/54411: integer overflow in objalloc_alloc
2012-09-18  Florian Weimer  <fweimer@redhat.com>

	PR other/54411
	* objalloc.h (objalloc_alloc): Do not use fast path on wraparound.

2012-09-18  Florian Weimer  <fweimer@redhat.com>

	PR other/54411
	* objalloc.c (_objalloc_alloc): Add overflow check covering
	alignment and CHUNK_HEADER_SIZE addition.

From-SVN: r191413
2012-09-18 10:34:05 +02:00
H.J. Lu fabfa16b37 Replace malloc with xmalloc
* argv.c (dupargv): Replace malloc with xmalloc.  Don't check
	xmalloc return.
	(buildargv): Likewise.  Also replace strdup with xstrdup.
	(expandargv): Don't check dupargv return.

From-SVN: r190767
2012-08-28 18:03:21 -07:00
H.J. Lu 55529d369c Replace alloca with xmalloc/free
PR binutils/14526
	* argv.c (buildargv): Replace alloca with xmalloc/free.

From-SVN: r190766
2012-08-28 17:46:36 -07:00
Andreas Schwab c9ac76ae53 floatformat.c (floatformat_to_double): Correctly handle numbers between 1 and 2.
* floatformat.c (floatformat_to_double): Correctly handle numbers
between 1 and 2.  Simplify handling of denormal number.
(main): Test with 1.1.

From-SVN: r190493
2012-08-17 21:56:48 +00:00
Mike Frysinger d555a90ebe md5.c (md5_finish_ctx): Declare swap_bytes.
2012-07-27  Mike Frysinger  <vapier@gentoo.org>

	* md5.c (md5_finish_ctx): Declare swap_bytes.  Assign SWAP() output
	to swap_bytes, and then call memcpy to move it to ctx->buffer.

From-SVN: r189996
2012-07-31 08:38:27 +02:00
Kazu Hirata 9cd6dd8239 pex-win32.c (pex_win32_exec_child): Only close original file descriptors if child is launched successfully.
2012-07-26  Kazu Hirata  <kazu@codesourcery.com>
	    Sandra Loosemore  <sandra@codesourcery.com>

	libiberty/
	* pex-win32.c (pex_win32_exec_child): Only close original file
	descriptors if child is launched successfully.

Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com>

From-SVN: r189901
2012-07-26 19:18:47 -04:00
Jason Merrill aefa74bd2b cp-demangle.c (cplus_demangle_operators): Add *_cast.
* cp-demangle.c (cplus_demangle_operators): Add *_cast.
	(op_is_new_cast): New.
	(d_expression, d_print_comp): Check it.

From-SVN: r189630
2012-07-18 15:51:36 -04:00
Doug Evans 69488641ac filenames.h: #include "hashtab.h".
include/
	* filenames.h: #include "hashtab.h".
	(filename_hash, filename_eq): Declare.
	libiberty/
	* filename_cmp.c (filename_hash, filename_eq): New functions.

From-SVN: r189472
2012-07-13 22:12:28 +00:00
Andreas Schwab 8a8b3779de copying-lib.texi (Library Copying): Don't use @heading inside @enumerate.
* copying-lib.texi (Library Copying): Don't use @heading inside
@enumerate.

From-SVN: r189072
2012-06-29 10:59:48 +00:00
Tom Tromey d931f693ce demangle-expected: Add regression test.
http://sourceware.org/bugzilla/show_bug.cgi?id=14065
	* testsuite/demangle-expected: Add regression test.
	* cp-demangle.c (d_find_pack): Return NULL for
	DEMANGLE_COMPONENT_UNNAMED_TYPE.

From-SVN: r187773
2012-05-22 13:55:02 +00:00
Tom Tromey 11ec770e46 dwarf2out.c (dwarf_stack_op_name): Use get_DW_OP_name.
gcc
	* dwarf2out.c (dwarf_stack_op_name): Use get_DW_OP_name.
	(dwarf_tag_name): Use get_DW_TAG_name.
	(dwarf_attr_name): Use get_DW_AT_name.
	(dwarf_form_name): Use get_DW_FORM_name.
	* dwarf2cfi.c (dwarf_cfi_name): Use get_DW_CFA_name.
include
	* dwarf2.h (enum dwarf_tag, enum dwarf_form, enum dwarf_attribute)
	(enum dwarf_location_atom, enum dwarf_type, enum
	dwarf_call_frame_info): Remove.
	(DW_TAG, DW_TAG_DUP, DW_FORM, DW_AT, DW_AT_DUP, DW_OP)
	(DW_OP_DUP, DW_ATE, DW_ATE_DUP, DW_CFA): New macros.
	Include dwarf2.def.
	(get_DW_TAG_name, get_DW_AT_name, get_DW_FORM_name)
	(get_DW_OP_name, get_DW_ATE_name): Declare.
	* dwarf2.def: New file, from dwarf2.h.
libiberty
	* dwarfnames.c: New file.
	* Makefile.in (CFILES): Add dwarfnames.
	(REQUIRED_OFILES): Add dwarfnames.
	(./dwarfnames.$(objext)): New target.

From-SVN: r186908
2012-04-27 14:14:14 +00:00
Tristan Gingold c1a969777f pex-unix.c (to_ptr32): Fix style.
2012-04-04  Tristan Gingold  <gingold@adacore.com>

	* pex-unix.c (to_ptr32): Fix style.

From-SVN: r186134
2012-04-04 08:44:30 +00:00
Tristan Gingold 63e1e57a9a stack-limit.c: Includes ansidecl.h.
2012-04-02  Tristan Gingold  <gingold@adacore.com>

        * stack-limit.c: Includes ansidecl.h.
        (stack_limit_increase): Add ATTRIBUTE_UNUSED

From-SVN: r186064
2012-04-02 07:51:26 +00:00
Jason Merrill c19267cbaf mangle.c (write_type): Handle 'auto'.
gcc/cp/
	* mangle.c (write_type): Handle 'auto'.
	* init.c (build_new): Don't do auto deduction where it might
	affect template mangling.
libiberty/
	* cp-demangle.c (cplus_demangle_type): Handle 'auto'.

From-SVN: r185595
2012-03-21 00:04:39 -04:00
Jason Merrill c93ea196be cp-demangle.c (cplus_demangle_operators): Add li.
* cp-demangle.c (cplus_demangle_operators): Add li.
	(d_unqualified_name): Handle it specially.

From-SVN: r185082
2012-03-07 18:19:06 -05:00
Jakub Jelinek bfb676c121 make-relative-prefix.c (make_relative_prefix_1): Avoid warning about using preprocessor directives inside of macro arguments.
* make-relative-prefix.c (make_relative_prefix_1): Avoid warning
	about using preprocessor directives inside of macro arguments.

From-SVN: r183561
2012-01-26 15:26:25 +01:00
Douglas Rupp daecebc805 Interix resurrection
2012-01-22  Douglas B Rupp  <rupp@gnat.com>

	* <toplevel>/config/mh-interix: Remove as unneeded.
	* <toplevel>/config/picflag.m4 (i[[34567]]86-*-interix3*):
	Change triplet to i[[34567]]86-*-interix[[3-9]]*.

	* <toplevel>/configure.ac: Remove reference to mh-interix.
	* <toplevel>/configure: Regenerate.

	* <toplevel>/libada/configure: Regenerate.

	* <toplevel>libgcc/config.host (i[34567]86-*-interix3*):
	Change triplet to i[34567]86-*-interix[3-9]*.
	* <toplevel>/libgcc/configure: Regenerate.

	* <toplevel>/liberty/configure: Regenerate.

	* config.gcc: (i[34567]86-*-interix3*): Remove from obsolete
	configurations. Change triplet to i[34567]86-*-interix[3-9]*.
	(extra_options) interix.opt -> i386/interix.opt"
	(extra_objs):Add winnt-stubs.o
	* configure.ac: Add interix to target_os .comm on PE check.
	* configure: Regenerate.
	* config/interix3.h: Delete and move bits to..
	* config/interix.h: Delete and move bits to..
	* config/i386/i386-interix3.h: Delete and move bits to..
	* config/i386/i386-interix.h: ..here.
	(TARGET_CPU_DEFAULT): Remove redefinition.
	(TARGET_ASM_CONSTRUCTOR): Undefine.
	(SUBTARGET_SWITCHES): Define for ms-bitfields.
	(TARGET_OS_CPP_BUILTINS): Remove __OPENNT. Add __declspec.
	(PTRDIFF_TYPE): Define.
	(LONG_DOUBLE_TYPE_SIZE): Define.
	(LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define.
	(SUBTARGET_OVERRIDE_OPTIONS): Remove.
	(TARGET_SECTION_TYPE_FLAGS): Define.
	(ASM_DECLARE_FUNCTION_NAME): Define.
	(ASM_OUTPUT_EXTERNAL): Define.
	(ASM_OUTPUT_EXTERNAL_LIBCALL): Define.
	(ASM_OUTPUT_ALIGNED_BSS): Define.
	(PCC_BITFIELD_TYPE_MATTERS): Define.
	(USE_CONST_SECTION): Define.
	(SUBTARGET_ENCODE_SECTION_INFO): Remove.
	(TARGET_ASM_FUNCTION_RODATA_SECTION): Remove.
	(SUPPORTS_ONE_ONLY): Remove.
	(I386_PE_STRIP_ENCODING): Define.
	* config/interix.opt: Delete and move bits to..
	* config/i386/interix.opt: ..here. New.
	(mpe-aligned-commons): Add.
	* config/i386/t-interix: Add copyright header.
	(winnt-stubs.o): Add rule.

	* testsuite/gcc.dg/builtins-config.h: (HAVE_C99_RUNTIME):
	Do not define for Interix.

From-SVN: r183406
2012-01-23 06:25:28 +00:00
Jason Merrill 3abbe4587d cp-demangle.c (d_print_comp): Omit a trailing space in the operator name.
* cp-demangle.c (d_print_comp) [DEMANGLE_COMPONENT_OPERATOR]:
	Omit a trailing space in the operator name.

From-SVN: r183072
2012-01-10 12:02:52 -05:00
Jason Merrill 4b6aaa996e re PR c++/6057 (expression mangling doesn't work for operator new)
PR c++/6057
	PR c++/48051
	PR c++/50855
	PR c++/51322
gcc/cp/
	* mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
	THROW_EXPR, CONSTRUCTOR, OVERLOAD.  Fix PREINCREMENT_EXPR and
	PREDECREMENT_EXPR.
	(write_template_arg): Fix mangling of class-scope functions and
	argument packs.
	(mangle_decl): Update suggested -fabi-version argument.
	* operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
	DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
	* tree.c (dependent_name): No longer static.
	* cp-tree.h: Declare it.
	* pt.c (unify): Defer handling of unconverted functions.
include/
	* demangle.h (enum demangle_component_type): Add
	DEMANGLE_COMPONENT_INITIALIZER_LIST, DEMANGLE_COMPONENT_NULLARY.
libiberty/
	* cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_NULLARY and
	DEMANGLE_COMPONENT_INITIALIZER_LIST.
	(d_make_comp): Likewise.  Allow null right arg for
	DEMANGLE_COMPONENT_TRINARY_ARG2.
	(cplus_demangle_operators): Adjust new/delete; add .*, :: and throw.
	(d_template_args, d_template_arg): Handle 'J' for argument packs.
	(d_exprlist): Add terminator parm.
	(d_expression, d_print_comp): Handle initializer lists, nullary
	expressions, prefix/suffix operators, and new.
	(d_print_subexpr): Avoid parens around DEMANGLE_COMPONENT_QUAL_NAME
	and DEMANGLE_COMPONENT_INITIALIZER_LIST.
	* testsuite/demangle-expected: Add tests.

From-SVN: r182970
2012-01-06 16:39:43 -05:00
Jason Merrill 49f2da1a16 cp-demangle.c (cplus_demangle_type): decltype, pack expansion and vector are substitutable.
* cp-demangle.c (cplus_demangle_type): decltype, pack expansion
	and vector are substitutable.
	(cplus_demangle_operators): Sort.

From-SVN: r182969
2012-01-06 16:39:34 -05:00
Andreas Krebbel 925b0ed821 re PR bootstrap/51734 (Bootstrap fails in libada)
config/
2012-01-04  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	PR bootstrap/51734
	* picflag.m4: Remove s390 case statement.

gcc/
2012-01-04  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* configure: Regenerate.

libada/
2012-01-04  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* configure: Regenerate.

libgcc/
2012-01-04  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* configure: Regenerate.
	* config/s390/t-crtstuff: Remove -fPIC.

libiberty/
2012-01-04  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* configure: Regenerate.

From-SVN: r182868
2012-01-04 11:41:06 +00:00
Jakub Jelinek 341d3f6e9c re PR driver/48306 (presence of gcc subdir with . in PATH causes breakdown)
* make-relative-prefix.c (make_relative_prefix_1): Avoid
	stack overflow if PATH contains just a single entry and
	HOST_EXECUTABLE_SUFFIX needs to be used.

	PR driver/48306
	* make-relative-prefix.c: Include sys/stat.h.
	(make_relative_prefix_1): If access succeeds, check also stat
	if nstore is a regular file.

From-SVN: r182820
2012-01-02 23:18:21 +01:00
Andreas Schwab 4a5e00ca50 warnings.m4 (ACX_PROG_CC_WARNING_OPTS): Avoid leading dash in expr call.
config/:
	* warnings.m4 (ACX_PROG_CC_WARNING_OPTS): Avoid leading dash in
	expr call.
fixincludes/:
	* configure: Regenerate.
gcc/:
	* configure: Regenerate.
libcpp/:
	* configure: Regenerate.
libdecnumber/:
	* configure: Regenerate.
libiberty/:
	* configure: Regenerate.
lto-plugin/:
	* configure: Regenerate.

From-SVN: r182546
2011-12-20 16:54:12 +00:00
Tristan Gingold 8c3db96e64 aclocal.m4: Assume strncmp works in cross case.
2011-12-20  Tristan Gingold  <gingold@adacore.com>

	* aclocal.m4: Assume strncmp works in cross case.
	* configure: Regenerate

From-SVN: r182520
2011-12-20 08:08:30 +00:00
Andreas Schwab 095af58f2c Check for warning flags without no- prefix
config/:
	PR bootstrap/51388
	* warnings.m4 (ACX_PROG_CC_WARNING_OPTS)
	(ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Run the test without the
	no- prefix.
fixincludes/:
	* configure: Regenerate.
gcc/:
	* configure: Regenerate.
libcpp/:
	* configure: Regenerate.
libdecnumber/:
	* configure: Regenerate.
libiberty/:
	* configure: Regenerate.
lto-plugin/:
	* configure: Regenerate.

From-SVN: r182478
2011-12-19 13:12:26 +00:00
Aldy Hernandez 0a35513e4e Merge from transactional-memory branch.
From-SVN: r181154
2011-11-08 11:13:41 +00:00
Jason Merrill b25dd954c4 re PR c++/48370 (G++ fails to extend reference temporary lifetime in some situations)
PR c++/48370
	* call.c (extend_ref_init_temps, extend_ref_init_temps_1): New.
	(set_up_extended_ref_temp): Use it.  Change cleanup parm to VEC.
	(initialize_reference): Just call convert_like.
	* decl.c (grok_reference_init): Just call initialize_reference.
	(build_init_list_var_init): Remove.
	(check_initializer): Change cleanup parm to VEC.  Handle references
	like other types.  Call perform_implicit_conversion instead
	of build_init_list_var_init.  Don't use build_aggr_init for
	aggregate initialization of arrays.
	(cp_finish_decl): Change cleanup to VEC.
	* typeck2.c (store_init_value): Call extend_ref_init_temps.
	Use build_vec_init for non-constant arrays.
	* init.c (expand_aggr_init_1): Adjust.
	(build_vec_init): Avoid re-converting an initializer
	that's already digested.
	* mangle.c (mangle_ref_init_variable): Add a discriminator.
	* cp-tree.h: Adjust.
	* typeck.c (convert_for_initialization): Adjust.
	* decl2.c (maybe_emit_vtables): Adjust.

From-SVN: r180944
2011-11-04 08:54:08 -04:00
Doug Evans 9f2f6d5e84 Fix thinko in previous checkin.
From-SVN: r180805
2011-11-02 22:00:20 +00:00
Doug Evans 4092fb6e8d Forgotten in previous checkin that added timeval-utils.[ch].
* Makefile.in (CFILES): Add it.
	(REQUIRED_OFILES): Add timeval-utils.$(objext).
	(INSTALLED_HEADERS): Add timeval-utils.h.
	(timeval-utils.$(objext)): Add rule.

From-SVN: r180803
2011-11-02 21:45:19 +00:00
Ian Lance Taylor d6b0f0f14f * setproctitle.c (setproctitle): Use "GNU/Linux" in comment.
From-SVN: r180641
2011-10-29 00:09:39 +00:00
Iain Sandoe b20577eae4 re PR target/48108 (lto should be containerized in a single mach-o section on darwin)
gcc:

	PR target/48108
	* config/darwin.c (top level): Amend comments concerning LTO output.
	(lto_section_num): New variable.  (darwin_lto_section_e): New GTY.
	(LTO_SECTS_SECTION, LTO_INDEX_SECTION): New.
	(LTO_NAMES_SECTION): Rename.
	(darwin_asm_named_section): Record LTO section counts and switches
	in a vec of darwin_lto_section_e.
	(darwin_file_start): Remove unused code.
	(darwin_file_end): Put an LTO section termination label.  Handle
	output of the wrapped LTO sections, index and names table.

libiberty:

	PR target/48108
	* simple-object-mach-o.c  (GNU_WRAPPER_SECTS, GNU_WRAPPER_INDEX,
	GNU_WRAPPER_NAMES): New macros.
	(simple_object_mach_o_segment): Handle wrapper scheme.
	(simple_object_mach_o_write_section_header): Allow the segment name
	to be supplied.
	(simple_object_mach_o_write_segment): Handle wrapper scheme.  Ensure
	that the top-level segment name in the load command is empty.
	(simple_object_mach_o_write_to_file): Determine the number of
	sections during segment output, use that in writing the header.

From-SVN: r180523
2011-10-26 12:37:59 +00:00
Ian Lance Taylor d58818f7ba re PR c++/48665 (type of const member function)
PR c++/48665
	* cp-demangle.c (d_cv_qualifiers): If qualifiers are applied to a
	function type, change them to apply to the "this" parameter.
	* testsuite/demangle-expected: Add test case.

From-SVN: r179772
2011-10-10 20:34:20 +00:00
Doug Evans 8c850a5a7f timeval-utils.h: New file.
include/
	* timeval-utils.h: New file.

	libiberty/
	* timeval-utils.c: New file.
	* Makefile.in (CFILES): Add it.
	(REQUIRED_OFILES): Add timeval-utils.$(objext).
	(INSTALLED_HEADERS): Add timeval-utils.h.
	(timeval-utils.$(objext)): Add rule.

From-SVN: r179319
2011-09-28 19:09:50 +00:00
Doug Evans be50fcea4e libiberty.h (countargv): Declare.
include/
	* libiberty.h (countargv): Declare.

	libiberty/
	* argv.c (countargv): New function.

From-SVN: r179318
2011-09-28 19:04:30 +00:00
Basile Starynkevitch ae0d176cbc trivial libiberty/ChangeLog update
From-SVN: r179147
2011-09-24 19:56:10 +00:00
Cary Coutant 2d2b02c4da re PR c++/40831 (g++ generated symbols for cloned function that be demangled.)
include/ChangeLog:

	PR 40831
	* demangle.h (enum demangle_component_type): Add
	DEMANGLE_COMPONENT_CLONE.

libiberty/ChangeLog:

	PR 40831
	* cp-demangle.c (d_make_comp): Add new component type.
	(cplus_demangle_mangled_name): Check for clone suffixes.
	(d_parmlist): Don't error out if we see '.'.
	(d_clone_suffix): New function.
	(d_print_comp): Print info for clone suffixes.
	* testsuite/demangle-expected: Add new testcases.

From-SVN: r179132
2011-09-23 14:39:10 -07:00
Ian Lance Taylor d303ec8e17 md5.c (md5_process_bytes): Correct handling of unaligned buffer.
* md5.c (md5_process_bytes): Correct handling of unaligned
	buffer.

From-SVN: r179128
2011-09-23 19:19:52 +00:00
Rainer Orth e3aa9ebaf7 Centralize PICFLAG configuration
config:
	* picflag.m4: New file.

	gcc:
	* configure.ac (GCC_PICFLAG_FOR_TARGET): Call it.
	(PICFLAG_FOR_TARGET): Substitute.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

	gcc/ada:
	* gcc-interface/Makefile.in (PICFLAG_FOR_TARGET): New.
	(GNATLIBCFLAGS_FOR_C): Replace
	TARGET_LIBGCC2_CFLAGS by PICFLAG_FOR_TARGET.
	(gnatlib-shared-default, gnatlib-shared-dual-win32)
	(gnatlib-shared-win32, gnatlib-shared-darwin, gnatlib-shared)
	(gnatlib-sjlj, gnatlib-zcx): Likewise.

	libada:
	* configure.ac: Include ../config/picflag.m4.
	(GCC_PICFLAG): Call it.
	Substitute.
	* configure: Regenerate.
	* Makefile.in (TARGET_LIBGCC2_CFLAGS): Replace by PICFLAG.
	(GNATLIBCFLAGS_FOR_C): Replace TARGET_LIBGCC2_CFLAGS by PICFLAG.
	(LIBADA_FLAGS_TO_PASS): Pass PICFLAG as PICFLAG_FOR_TARGET.
	Don't include $(GCC_DIR)/libgcc.mvars.

	libiberty:
	* aclocal.m4: Include ../config/picflag.m4.
	* configure.ac (GCC_PICFLAG): Call it.
	(enable_shared): Clear PICFLAG unless shared.
	* configure: Regenerate.

From-SVN: r177967
2011-08-22 16:54:02 +00:00
Steve Ellcey c49b1a299e md5.c (md5_read_ctx): Handle mis-aligned resbuf pointer.
2011-08-12  Steve Ellcey  <sje@cup.hp.com>

	* md5.c (md5_read_ctx): Handle mis-aligned resbuf pointer.

From-SVN: r177700
2011-08-12 16:06:57 +00:00
Uros Bizjak bd82021880 test-expandargv.c (writeout_test): Check result of fwrite.
* testsuite/test-expandargv.c (writeout_test): Check result of fwrite.

From-SVN: r177529
2011-08-06 19:38:04 +02:00
Jason Merrill 4bbff96e36 re PR c++/49932 ([C++0x] ICE on instantiating decltype(expr)::type with template)
PR c++/49932
gcc/cp/
	* mangle.c (write_prefix): Handle decltype.
libiberty/
	* cp-demangle.c (d_prefix): Handle decltype.

From-SVN: r177074
2011-08-01 17:02:07 -04:00
H.J. Lu 52bed4d7ee Remove an extra line.
2011-07-26  H.J. Lu  <hongjiu.lu@intel.com>

	* testsuite/demangle-expected: Remove an extra line.

From-SVN: r176796
2011-07-26 10:07:51 -07:00
Ian Lance Taylor f2e6f32e60 cp-demangle.c (d_print_init): Initialize pack_index field.
* cp-demangle.c (d_print_init): Initialize pack_index field.
	(d_print_comp): Check for NULL template argument.
	* testsuite/demangle-expected: Add test case.

From-SVN: r176791
2011-07-26 14:28:23 +00:00
Gerald Pfeifer a0a22423b0 re PR target/49817 (libiberty/stack-limit.c causes a bootstrap failure on all FreeBSD targets)
PR target/49817
	* stack-limit.c: Include <stdint.h>.

From-SVN: r176662
2011-07-22 22:52:55 +00:00
Jakub Jelinek 679debeea3 re PR c++/49756 (g++ ICE)
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: r176622
2011-07-22 11:21:49 +02:00
Jakub Jelinek d423df4823 re PR c++/49756 (g++ ICE)
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-22 10:33:37 +02:00
Jason Merrill a517066db8 cp-demangle.c (d_expression): Handle 'this'.
* cp-demangle.c (d_expression): Handle 'this'.
	(d_print_comp) [DEMANGLE_COMPONENT_FUNCTION_PARAM]: Likewise.

From-SVN: r175836
2011-07-04 17:44:11 -04:00
Joel Brobecker 985b34c77a Darwin has case-insensitive filesystems
HFS+, the FS on Darwin, is case insensitive. So this patch adjusts
filename_cmp.c to ignore the casing when comparing filenames on Darwin.

include/ChangeLog:

        * filenames.h (HAVE_CASE_INSENSITIVE_FILE_SYSTEM): Define
        on Darwin, as well as on the systems that use a DOS-like
        filesystem.

libiberty/ChangeLog:

        * filename_cmp.c (filename_cmp, filename_ncmp): Add handling of
        HAVE_CASE_INSENSITIVE_FILE_SYSTEM.

From-SVN: r175762
2011-07-01 17:51:05 +00:00
Jan Kratochvil cb0ad10428 re PR debug/49408 (member function template id not matching linkage name)
libiberty/
	PR debug/49408
	* cp-demangle.c (d_print_comp): Suppress argument list for function
	references by the '&' unary operator.  Keep also already processed
	variant without the argument list.  Suppress argument list types for
	function call used in an expression.
	* testsuite/demangle-expected: Fix excessive argument list types in
	`test for typed function in decltype'.  New testcase for no argument
	list types printed.  3 new testcases for function references by the
	'&' unary operator..

From-SVN: r175761
2011-07-01 17:16:44 +00:00
Jason Merrill dd70e080ff re PR c++/37089 ([C++0x] rvalue/lvalue reference collapsing not performed in error ouput thus printing "&&&")
PR c++/37089
	* cp-demangle.c (d_print_comp): Handle reference smashing.

From-SVN: r175213
2011-06-20 10:40:01 -04:00
Jan Kratochvil 5fe8e1e9ab cp-demangle.c (d_print_comp): Suppress d_print_mod for DMGL_RET_POSTFIX.
libiberty/
	* cp-demangle.c (d_print_comp) <DEMANGLE_COMPONENT_FUNCTION_TYPE>:
	Suppress d_print_mod for DMGL_RET_POSTFIX.
	* testsuite/demangle-expected: New testcases for --ret-postfix.

From-SVN: r175001
2011-06-13 22:34:19 +00:00
Jan Kratochvil f019462c62 demangle.h (DMGL_RET_POSTFIX): Extend the comment.
include/
	* demangle.h (DMGL_RET_POSTFIX): Extend the comment.
	(DMGL_RET_DROP): New.

libiberty/
	* cp-demangle.c (d_print_comp) <DEMANGLE_COMPONENT_FUNCTION_TYPE>: Do
	not pass DMGL_RET_POSTFIX or DMGL_RET_DROP.  Support DMGL_RET_DROP.
	* testsuite/demangle-expected: New testcases for --ret-drop.
	* testsuite/test-demangle.c: Document --ret-drop in a comment.
	(main): New variable ret_drop, fill it, call cplus_demangle with it.

From-SVN: r175000
2011-06-13 22:32:40 +00:00
Jan Kratochvil 743a99db07 cp-demangle.c (struct d_print_info): Remove field options.
libiberty/
	* cp-demangle.c (struct d_print_info): Remove field options.
	(d_print_init): Remove parameter options.
	(cplus_demangle_print_callback): Update all the callers.
	(d_print_comp, d_print_mod_list, d_print_mod, d_print_function_type)
	(d_print_array_type, d_print_expr_op, d_print_cast, d_print_subexpr):
	Add parameter options, update all the callers.

From-SVN: r174999
2011-06-13 22:30:02 +00:00
Jim Meyering 046957830e remove useless if-before-free tests
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-04-20 18:19:03 +00:00
Jim Meyering 4b9726d48c Avoid memory overrun in a test leading to potential double-free.
2011-04-10  Jim Meyering  <meyering@redhat.com>

	    Avoid memory overrun in a test leading to potential double-free.
	    * testsuite/test-expandargv.c (writeout_test): Fix off-by-one error:
	    i.e., do copy the trailing NUL byte.

From-SVN: r172246
2011-04-10 18:13:23 +00:00
Tristan Gingold 178aa0f648 makefile.vms (OBJS): Add filename_cmp.obj
2011-03-31  Tristan Gingold  <gingold@adacore.com>

	* makefile.vms (OBJS): Add filename_cmp.obj

From-SVN: r171776
2011-03-31 11:09:09 +00:00
Kai Tietz 9436925165 re PR debug/28047 (DWARF output_file_names should really understand DOS pathnames)
2011-02-28  Kai Tietz  <kai.tietz@onevision.com>

	PR debug/28047
	* dwarf2out.c (file_table_eq): Use filename_cmp instead of strcmp.
	(lookup_filename): Likewise.
	* final.c (remap_debug_filename): Use filename_ncmp instead of
	strncmp.

2011-02-28  Kai Tietz  <kai.tietz@onevision.com>

	* filename_cmp.c (filename_ncmp): New function.
	* functions.texi: Regenerated.

2011-02-28  Kai Tietz  <kai.tietz@onevision.com>

	* filenames.h (filename_ncmp): New prototype.

From-SVN: r170570
2011-02-28 19:23:25 +01:00
Ralf Wildenhues 996c0cb05f libiberty: documentation markup and order fixes.
libiberty/:
	* splay-tree.c: Escape wrapping newlines in texinfo markup
	with '@', to fix function declaration output rendering.
	* gather-docs: Relax and improve macro name matching to actually
	match all current names and to allow input line wrapping.
	* bsearch.c, concat.c, crc32.c, fnmatch.txh, fopen_unlocked.c,
	hashtab.c, insque.c, make-relative-prefix.c, memchr.c, memcmp.c,
	memcpy.c, memmem.c, memmove.c, mempcpy.c, memset.c,
	pexecute.txh, random.c, setenv.c, setproctitle.c,
	simple-object.txh, snprintf.c, stpncpy.c, strncmp.c, strtod.c,
	strtol.c, vasprintf.c, vprintf.c, vsnprintf.c, xmemdup.c:
	Wrap long texinfo input lines.
	* functions.texi: Regenerate.

From-SVN: r169783
2011-02-03 07:23:20 +00:00
Mike Frysinger 9e7955b2d3 libiberty: add .gitignore
Signed-off-by: Mike Frysinger <vapier@gentoo.org>

From-SVN: r168942
2011-01-18 05:06:50 +00:00
Jakub Jelinek d652f226fc Update Copyright years for files modified in 2010.
From-SVN: r168438
2011-01-03 21:52:22 +01:00
Doug Evans 23346f368b splay-tree.c (splay_tree_foreach_helper): Remove arg `sp', all callers updated.
* splay-tree.c (splay_tree_foreach_helper): Remove arg `sp',
	all callers updated.  Rewrite to be non-recursive.

From-SVN: r167589
2010-12-08 15:48:50 +00:00
Rainer Orth 4c7d97e641 * setproctitle.c [HAVE_SYS_PRCTL_H]: Include <sys/types.h>.
From-SVN: r167236
2010-11-29 10:18:05 +00:00
Anthony Green 52ae149de0 Fix build regression
From-SVN: r166996
2010-11-21 03:29:27 +00:00
Ralf Wildenhues 455c8f4873 PR other/46202: implement install-strip.
/:
	PR other/46202
	* configure.ac: Fix just-built in-tree STRIP name to be
	binutils/strip-new.
	* configure: Regenerate.
	* Makefile.def (install-strip-gcc, install-strip-binutils)
	(install-strip-opcodes, install-strip-ld, install-strip-itcl)
	(install-strip-sid): Mirror dependencies on non-strip variants
	of these targets on the respective -strip prerequisites.
	* Makefile.tpl (install-strip, install-strip-host)
	(install-strip-target): New targets.
	(install-strip-[+module+], install-strip-target-[+module+]):
	New targets.
	* Makefile.in: Regenerate.

gcc/:
	PR other/46202
	* Makefile.in (install_sh, INSTALL_STRIP_PROGRAM): New
	variables.
	(AR_FOR_TARGET, RANLIB_FOR_TARGET, STRIP_FOR_TARGET): Fix
	shell quoting.
	(STRIP_FOR_TARGET): Look for in-tree strip under name strip-new.
	(install-strip): New target.
	(STRIPPROG): New variable, exported if STRIP is set.
	* doc/install.texi (Final install): Minor markup and code style
	fixes.  Document install-strip target.

fixincludes/:
	PR other/46202
	* Makefile.in (install-strip): New phony target.
	(all, check, install): Also mark as phony.

libgcc/:
	PR other/46202
	* Makefile.in (install-strip): New phony target.

libiberty/:
	PR other/46202
	* Makefile.in (install-strip): New phony target.
	(install): Also mark as phony.

gnattools/:
	PR other/46202
	* Makefile.in (install-strip): New phony target.
	(check, installcheck, info, dvi, pdf, html, install)
	(install-info, install-pdf, install-html, mostlyclean)
	(clean, distclean, maintainer-clean): Mark phony.

libada/:
	PR other/46202
	* Makefile.in (install-strip): New phony target.
	(check, installcheck, info, dvi, pdf, html, install)
	(install-info, install-pdf, install-html, mostlyclean)
	(clean, distclean, maintainer-clean): Mark phony.

From-SVN: r166980
2010-11-20 19:37:08 +00:00
Ian Lance Taylor d82f74d3ab simple-object.h (simple_object_attributes_merge): Declare, replacing simple_object_attributes_compare.
include/:
	* simple-object.h (simple_object_attributes_merge): Declare,
	replacing simple_object_attributes_compare.
libiberty/:
	* simple-object.c (simple_object_attributes_merge): Rename from
	simple_object_attributes_compare.  Call merge field.
	* simple-object-common.h (struct simple_object_functions): Rename
	attributes_compare field to attribute_merge.
	* simple-object-elf.c (EM_SPARC): Define.
	(EM_SPARC32PLUS): Define.
	(simple_object_elf_attributes_merge): Renamed from
	simple_object_elf_attributes_compare.  Permit EM_SPARC and
	EM_SPARC32PLUS objects to be merged.
	(simple_object_elf_functions): Update function name.
	* simple-object-coff.c (simple_object_coff_attributes_merge):
	Rename from simple_object_coff_attributes_compare.
	(simple_object_coff_functions): Update function name.
	* simple-object-mach-o.c (simple_object_mach_o_attributes_merge):
	Renamed from simple_object_mach_o_attributes_compare.
	(simple_object_mach_o_functions): Update function name.
gcc/lto/:
	* lto-object.c (lto_obj_file_open): Call
	simple_object_attributes_merge rather than
	simple_object_attributes_compare.

From-SVN: r166848
2010-11-17 01:03:06 +00:00
H.J. Lu 431f321fbd Properly demangle a global constructor symbol.
2010-11-16  H.J. Lu  <hongjiu.lu@intel.com>

	PR other/42670
	PR binutils/11137
	* cp-demangle.c (d_make_demangle_mangled_name): New.
	(d_demangle_callback): Use it on DCT_GLOBAL_XTORS.

	* testsuite/demangle-expected: Updated.

From-SVN: r166810
2010-11-16 09:56:50 -08:00
Kai Tietz 28d1e73f5c simple-object-coff.c (simple_object_coff_read_strtab): Fix reading offset.
2010-11-14  Kai Tietz  <kai.tietz@onevision.com>

        * simple-object-coff.c (simple_object_coff_read_strtab): Fix reading
        offset.

From-SVN: r166735
2010-11-14 19:50:23 +01:00
Ian Lance Taylor 759fe2404d re PR other/46332 (__cxa_demangle yields excess parentheses for function types)
libiberty/:
	PR other/46332
	* cp-demangle.c (d_print_function_type): Don't print parentheses
	if there are no modifiers to print.
	* testsuite/demangle-expected: Tweak one test case, add another.
libstdc++/:
	* testsuite/abi/demangle/abi_examples/14.cc (main): Change
	expected demangling.

From-SVN: r166695
2010-11-13 01:21:12 +00:00
Richard Henderson 3b63ca7ea2 Use spawnve on cygwin.
* configure.ac (AC_CHECK_HEADERS): Add process.h.
	(checkfuncs): Add dup3, spawnve, spawnvpe; sort the list.
	(AC_CHECK_FUNCS): Add dup3, spawnve, spawnvpe.
	* configure, config.in: Rebuild.
	* pex-unix.c [HAVE_SPAWNVE] (pex_unix_exec_child): New function.
	[HAVE_SPAWNVE] (save_and_install_fd, restore_fd): New functions.

From-SVN: r166339
2010-11-04 16:37:04 -07:00
Ian Lance Taylor 1cfabf34d8 simple-object.h: New file.
include/:
	* simple-object.h: New file.
libiberty/:
	* simple-object.c: New file.
	* simple-object-common.h: New file.
	* simple-object-elf.c: New file.
	* simple-object-mach-o.c: New file.
	* simple-object-coff.c: New file.
	* simple-object.txh: New file.
	* configure.ac: Add AC_TYPE_SSIZE_T.
	* Makefile.in: Rebuild dependencies.
	(CFILES): Add simple-object.c, simple-object-coff,
	simple-object-elf.c, and simple-object-mach-o.c.
	(REQUIRED_OFILES): Add corresponding object files.
	* configure: Rebuild.
	* config.in: Rebuild.
	* functions.texi: Rebuild.

Co-Authored-By: Dave Korn <dave.korn.cygwin@gmail.com>
Co-Authored-By: Iain Sandoe <iains@gcc.gnu.org>

From-SVN: r166185
2010-11-02 14:40:44 +00:00
Ian Lance Taylor c3735614a9 setproctitle.c: Add space after function name in @deftypefn comment.
* setproctitle.c: Add space after function name in @deftypefn
	comment.
	* functions.texi: Rebuild.

From-SVN: r166079
2010-10-29 23:09:50 +00:00
Ralf Wildenhues 0e0f02ff92 Patch by Ralf Wildenhues.
* aclocal.m4 (AC_LANG_FUNC_LINK_TRY(C)): Delete.
	* configure: Regenerate.

From-SVN: r165977
2010-10-26 18:29:29 +00:00
Andi Kleen 4e00fad27e Turn PR_SET_NAME check into link check
Fixes cross compilation for libiberty after my change

libiberty/

2010-10-07  Andi Kleen <ak@linux.intel.com>

	* configure: Regenerate.
	* configure.ac: Turn PR_SET_NAME check into link check.

From-SVN: r165086
2010-10-07 09:34:50 +00:00
Andi Kleen 6e9bd0f898 [PATCH] Report LTO phase in lto1 process name v2
On larger parallel WHOPR builds I find it useful to see in top which
phase a given lto1 is in.

Set the process name to lto1-wpa, lto1-ltrans, lto1-lto depending
on the current mode.

This is currently only implemented for Linux and only
using the "comm" process name, which is reported in top.

v2: Moved function to libiberty, renamed setproctitle to match
BSD. In theory it should pick up BSD's libc function for this
on a BSD system, but I haven't tested this.

gcc/lto/

2010-10-06  Andi Kleen <ak@linux.intel.com>

	* lto.c (lto_process_name): Add.
	(lto_main): Call lto_process_name.

include/

2010-10-06  Andi Kleen <ak@linux.intel.com>

	* libiberty.h (setproctitle): Add prototype.

libiberty/

2010-10-06  Andi Kleen <ak@linux.intel.com>

	* Makefile.in (CFILES): Add setproctitle.
	(CONFIGURED_OFILES): Add setproctitle.
	(setproctitle): Add rule.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Add checks for prctl PR_SET_NAME and setproctitle.
	* setproctitle.c: Add file.
	* functions.texi: Regenerate.

From-SVN: r165066
2010-10-06 22:02:58 +00:00
Tristan Gingold a69d9775fc cplus-dem.c (ada_demangle): Add comments.
2010-09-22 Tristan Gingold  <gingold@adacore.com>

	* cplus-dem.c (ada_demangle): Add comments.
	Handle stream and controlled type operations.
	Decoding of some uppercase letters moved before separators.
	* testsuite/demangle-expected: Add tests.

From-SVN: r164518
2010-09-22 09:26:03 +00:00
James Lyon 4825561606 cp-demangle.c (d_find_pack): Add case for DEMANGLE_COMPONENT_LAMBDA.
2010-09-10  James Lyon  <jameslyon0@googlemail.com>

	http://sourceware.org/bugzilla/show_bug.cgi?id=11572
	* cp-demangle.c (d_find_pack): Add case for
	DEMANGLE_COMPONENT_LAMBDA.
	* testsuite/demangle-expected: Add regression test.

From-SVN: r164203
2010-09-10 22:41:28 +00:00
Tristan Gingold 16f60fcbe4 re PR bootstrap/44001 (.o vs. obj => @OBJEXT@ and $ac_objext)
2010-09-08  Tristan Gingold  <gingold@adacore.com>

	PR 44001
	* maint-tool (missing): Fix pattern for object file.
	(deps): Use $(objext) for object extension.
	* Makefile.in (objext): New variable.
	Replace all occurences of .o with .$(objext)
	Regenerate with maint-deps
	* configure.ac (pexecute): Set to the basename.
	* configure: Regenerate.

From-SVN: r163989
2010-09-08 07:27:11 +00:00
Maciej W. Rozycki 93f36faad1 pex-common.c (pex_read_err): Set stderr_pipe to -1 if a corresponding stream has been opened.
* pex-common.c (pex_read_err): Set stderr_pipe to -1 if a
	corresponding stream has been opened.
	(pex_free): Close pipe file descriptors corresponding to child's
	stdout and stderr before waiting.

From-SVN: r163426
2010-08-20 22:39:58 +00:00
Nick Clifton ec760bea7f argv.c (expandargv): Limit the number of times that response files are opened in order to prevent...
* argv.c (expandargv): Limit the number of times that response
        files are opened in order to prevent infinite recursion.

From-SVN: r163222
2010-08-13 11:36:38 +00:00
Pascal Obry 79cf762806 * make-temp-file.c (choose_tmpdir): Append a dot to P_tmpdir if needed.
From-SVN: r162379
2010-07-21 15:02:09 +00:00
Ken Werner d414dde979 floatformat.h (floatformat_ieee_half_big): Add declaration.
include/ChangeLog:

2010-07-06  Ken Werner  <ken.werner@de.ibm.com>

	* floatformat.h (floatformat_ieee_half_big): Add declaration.
	(floatformat_ieee_half_little): Likewise.

libiberty/ChangeLog:

2010-07-06  Ken Werner  <ken.werner@de.ibm.com>

	* floatformat.c (floatformat_ieee_half_big): New variable.
	(floatformat_ieee_half_little): Likewise.

From-SVN: r161867
2010-07-06 13:00:59 +00:00
Gerald Pfeifer 1e913734b4 libiberty.texi: Remove reference to GCC 3 and 2001 (thrice).
* libiberty.texi: Remove reference to GCC 3 and 2001 (thrice).
	Update copyright years.
	Move to GFDL 1.3.

From-SVN: r160690
2010-06-13 23:14:45 +00:00
Jakub Jelinek 9c4d7e5294 re PR other/43838 (Incorrect output from abi::__cxa_demangle)
PR other/43838
	* cp-demangle.c (struct d_print_info): Add flush_count field.
	(d_print_init): Initialize it to 0.
	(d_print_flush): Increment it.
	(d_print_comp): If needed flush before appending ", ".  Only
	decrement dpi->len if no flushes happened during the recursive
	call.
	* testsuite/demangle-expected: Add a test for this.

From-SVN: r160554
2010-06-10 17:15:18 +02:00
Laurynas Biveinis a9429e29f5 utils.c (init_gnat_to_gnu): Use typed GC allocation.
gcc/ada:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC
	allocation.
	(init_dummy_type): Likewise.
	(gnat_pushlevel): Likewise.

	* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
	(Subprogram_Body_to_gnu): Likewise.
	(Compilation_Unit_to_gnu): Likewise.
	(start_stmt_group): Likewise.
	(extract_encoding): Likewise.
	(decode_name): Likewise.

	* gcc-interface/misc.c (gnat_printable_name): Likewise.

	* gcc-interface/decl.c (annotate_value): Likewise.

	* gcc-interface/ada-tree.h (struct lang_type): Add variable_size
	GTY option.
	(struct lang_decl): Likewise.
	(SET_TYPE_LANG_SPECIFIC): Use typed GC allocation.
	(SET_DECL_LANG_SPECIFIC): Likewise.

gcc/c-family:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* c-pragma.c (push_alignment): Use typed GC allocation.
	(handle_pragma_push_options): Likewise.

	* c-common.c (parse_optimize_options): Likewise.

	* c-common.h (struct sorted_fields_type): Add variable_size GTY
	option.

gcc/cp:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* typeck2.c (abstract_virtuals_error): Likewise.

	* pt.c (maybe_process_partial_specialization): Likewise.
	(register_specialization): Likewise.
	(add_pending_template): Likewise.
	(lookup_template_class): Likewise.
	(push_tinst_level): Likewise.

	* parser.c (cp_lexer_new_main): Likewise.
	(cp_lexer_new_from_tokens): Likewise.
	(cp_token_cache_new): Likewise.
	(cp_parser_context_new): Likewise.
	(cp_parser_new): Likewise.
	(cp_parser_nested_name_specifier_opt): Likewise.
	(cp_parser_template_id): Likewise.

	* name-lookup.c (binding_entry_make): Likewise.
	(binding_table_construct): Likewise.
	(binding_table_new): Likewise.
	(cxx_binding_make): Likewise.
	(pushdecl_maybe_friend): Likewise.
	(begin_scope): Likewise.
	(push_to_top_level): Likewise.

	* lex.c (init_reswords): Likewise.
	(retrofit_lang_decl): Likewise.
	(cxx_dup_lang_specific_decl): Likewise.
	(copy_lang_type): Likewise.
	(cxx_make_type): Likewise.

	* decl.c (make_label_decl): Likewise.
	(check_goto): Likewise.
	(start_preparsed_function): Likewise.
	(save_function_data): Likewise.

	* cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.

	* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.

	* class.c (finish_struct_1): Likewise.

	* cp-tree.h (struct lang_type): Add variable_size GTY option.
	(struct lang_decl): Likewise.

	* parser.c (cp_parser_new): Update comment to not reference
	ggc_alloc.

gcc/fortran:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* trans-types.c (gfc_get_nodesc_array_type): Use typed GC
	allocation.
	(gfc_get_array_type_bounds): Likewise.

	* trans-decl.c (gfc_allocate_lang_decl): Likewise.
	(gfc_find_module): Likewise.

	* f95-lang.c (pushlevel): Likewise.

	* trans.h (struct lang_type): Add variable_size GTY option.
	(struct lang_decl): Likewise.

gcc/java:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation.

	* jcf-parse.c (java_parse_file): Likewise.
	(process_zip_dir): Likewise.

	* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
	(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise.

	* expr.c (add_type_assertion): Likewise.

	* decl.c (make_binding_level): Likewise.
	(java_dup_lang_specific_decl): Likewise.

	* constants.c (set_constant_entry): Likewise.
	(cpool_for_class): Likewise.

	* class.c (add_method_1): Likewise.
	(java_treetreehash_new): Likewise.

	* java-tree.h (struct lang_type): Add variable_size GTY option.
	(struct lang_decl): Likewise.

	* jch.h (struct cpool_entry): Likewise.

	* java-tree.h (java_treetreehash_create): Remove parameter ggc.

	* except.c (prepare_eh_table_type): Update
	java_treetreehash_create call.

	* class.c (add_method_1): Update java_treetreehash_create call.
	(java_treetreehash_create): Remove parameter gc.  Use
	htab_create_ggc.

gcc/lto:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* lto.c (lto_read_in_decl_state): Use typed GC allocation.
	(lto_file_read): Likewise.
	(new_partition): Likewise.
	(read_cgraph_and_symbols): Likewise.

gcc/objc:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
	allocation.

	* objc-act.c (objc_volatilize_decl): Likewise.
	(objc_build_string_object): Likewise.
	(hash_init): Likewise.
	(hash_enter): Likewise.
	(hash_add_attr): Likewise.
	(add_class): Likewise.
	(start_class): Likewise.

gcc/objcp:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
	allocation.

gcc:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* doc/tm.texi (Per-Function Data): Do not reference ggc_alloc.

	* doc/gty.texi (GTY Options): Document typed GC allocation and
	variable_size GTY option.

	* ggc-internal.h: New.

	* ggc.h: Update copyright year.
	(digit_string): Move to stringpool.c.
	(ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots)
	(gt_pch_save_stringpool, gt_pch_fixup_stringpool)
	(gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object)
	(init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size)
	(ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write)
	(ggc_pch_write_object, ggc_pch_finish, ggc_pch_read)
	(ggc_force_collect, ggc_get_size, ggc_statistics)
	(ggc_print_common_statistics): Move to ggc-internal.h.
	(digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat)
	(ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW)
	(GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec)
	(ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic)
	(ggc_min_heapsize_heuristic, ggc_alloc_zone)
	(ggc_alloc_zone_pass_stat): Remove.
	(ggc_internal_alloc_stat, ggc_internal_alloc)
	(ggc_internal_cleared_alloc_stat): New.
	(GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine.
	(ggc_internal_vec_alloc_stat)
	(ggc_internal_cleared_vec_alloc_stat)
	(ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc)
	(ggc_alloc_atomic_stat, ggc_alloc_atomic)
	(ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args)
	(ggc_cleared_alloc_ptr_array_two_args): New.
	(htab_create_ggc, splay_tree_new_ggc): Redefine.
	(ggc_splay_alloc): Change the type of the first argument to
	enum gt_types_enum.
	(ggc_alloc_string): Make macro.
	(ggc_alloc_string_stat): New.
	(ggc_strdup): Redefine.
	(rtl_zone, tree_zone, tree_id_zone): Declare unconditionally.
	(ggc_alloc_rtvec_sized): New.
	(ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat.
	(ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat)
	(ggc_internal_cleared_alloc_zone_stat)
	(ggc_internal_zone_alloc_stat)
	(ggc_internal_zone_cleared_alloc_stat)
	(ggc_internal_zone_vec_alloc_stat)
	(ggc_alloc_zone_rtx_def_stat)
	(ggc_alloc_zone_tree_node_stat)
	(ggc_alloc_zone_cleared_tree_node_stat)
	(ggc_alloc_cleared_gimple_statement_d_stat): New.

	* ggc-common.c: Include ggc-internal.h.
	(ggc_internal_cleared_alloc_stat): Rename from
	ggc_alloc_cleared_stat.
	(ggc_realloc_stat): Use ggc_internal_alloc_stat.
	(ggc_calloc): Remove.
	(ggc_cleared_alloc_htab_ignore_args): New.
	(ggc_cleared_alloc_ptr_array_two_args): New.
	(ggc_splay_alloc): Add obj_type parameter.
	(init_ggc_heuristics): Formatting fixes.

	* ggc-none.c: Update copyright year.
	(ggc_alloc_stat): Rename to ggc_alloc_stat.
	(ggc_alloc_cleared_stat): Rename to
	ggc_internal_cleared_alloc_stat.
	(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.

	* ggc-page.c: Update copyright year.  Include ggc-internal.h.
	Remove references to ggc_alloc in comments.
	(ggc_alloc_typed_stat): Call ggc_internal_alloc_stat.
	(ggc_alloc_stat): Rename to ggc_internal_alloc_stat.
	(new_ggc_zone, destroy_ggc_zone): Remove.
	(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.

	* ggc-zone.c: Include ggc-internal.h.  Remove references to
	ggc_alloc in comments.
	(ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat.
	(ggc_internal_alloc_zone_pass_stat): New.
	(ggc_internal_cleared_alloc_zone_stat): New.
	(ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat.
	(ggc_alloc_stat): Rename ggc_internal_alloc_stat.
	(new_ggc_zone, destroy_ggc_zone): Remove.

	* stringpool.c: Update copyright year.  Include ggc-internal.h
	(digit_vector): Make static.
	(digit_string): Moved from ggc.h.
	(stringpool_ggc_alloc): Use ggc_alloc_atomic.
	(ggc_alloc_string): Rename to ggc_alloc_string_stat.

	* Makefile.in (GGC_INTERNAL_H): New.
	(ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add
	$(GGC_INTERNAL_H) to dependencies.

	* gentype.c: Update copyright year.
	(walk_type): Accept variable_size GTY option.
	(USED_BY_TYPED_GC_P): New macro.
	(write_enum_defn): Use USED_BY_TYPED_GC_P.  Do not output
	whitespace at the end of strings.
	(get_type_specifier, variable_size_p): New functions.
	(alloc_quantity, alloc_zone): New enums.
	(write_typed_alloc_def): New function.
	(write_typed_struct_alloc_def): Likewise.
	(write_typed_typed_typedef_alloc_def): Likewise.
	(write_typed_alloc_defns): Likewise.
	(output_typename, write_splay_tree_allocator_def): Likewise.
	(write_splay_tree_allocators): Likewise.
	(main): Call write_typed_alloc_defns and
	write_splay_tree_allocators.

	* lto-streamer.h (lto_file_decl_data_ptr): New.

	* passes.c (order): Define using cgraph_node_ptr.

	* strinpool.c (struct string_pool_data): Declare nested_ptr using
	ht_identifier_ptr.

	* gimple.h (union gimple_statement_d): Likewise.

	* rtl.h (struct rtx_def): Likewise.
	(struct rtvec_def): Likewise.

	* tree.h (union tree_node): Likewise.

	* tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise.

	* cfgloop.c (record_loop_exits): Use htab_create_ggc.

	* tree-scalar-evolution.c (scev_initialize): Likewise.

	* alias.c (record_alias_subset): Update splay_tree_new_ggc call.

	* dwarf2asm.c (dw2_force_const_mem): Likewise.

	* omp-low.c (lower_omp_critical): Likewise.

	* bitmap.h (struct bitmap_head_def): Update comment to not
	reference ggc_alloc.

	* config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC.

	* ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC.

	* ipa-prop.c (duplicate_ggc_array): Rename to
	duplicate_ipa_jump_func_array.  Use typed GC allocation.
	(ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array.

	* gimple.c (gimple_alloc_stat): Use
	ggc_alloc_cleared_gimple_statement_d_stat.

	* varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def.

	* tree.c (make_node_stat): Use
	ggc_alloc_zone_cleared_tree_node_stat.
	(make_tree_vec_stat): Likewise.
	(build_vl_exp_stat): Likewise.
	(copy_node_stat): Use ggc_alloc_zone_tree_node_stat.
	(make_tree_binfo_stat): Likewise.
	(tree_cons_stat): Likewise.

	* rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat.
	(shallow_copy_rtx_stat): Likewise.
	(make_node_stat): Likewise.

	* lto-symtab.c: Fix comment.

	* tree-cfg.c (create_bb): Update comment to not reference
	ggc_alloc_cleared.
	* tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is
	value.

	* varpool.c (varpool_node): Use typed GC allocation.
	(varpool_extra_name_alias): Likewise.

	* varasm.c (emutls_decl): Likewise.
	(get_unnamed_section): Likewise.
	(get_noswitch_section): Likewise.
	(get_section): Likewise.
	(get_block_for_section): Likewise.
	(build_constant_desc): Likewise.
	(create_constant_pool): Likewise.
	(force_const_mem): Likewise.

	* tree.c (build_vl_exp_stat): Likewise.
	(build_real): Likewise.
	(build_string): Likewise.
	(decl_debug_expr_insert): Likewise.
	(decl_value_expr_insert): Likewise.
	(type_hash_add): Likewise.
	(build_omp_clause): Likewise.

	* tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise.

	* tree-ssa.c (init_tree_ssa): Likewise.

	* tree-ssa-structalias.c (heapvar_insert): Likewise.

	* tree-ssa-operands.c (ssa_operand_alloc): Likewise.

	* tree-ssa-loop-niter.c (record_estimate): Likewise.

	* tree-ssa-alias.c (get_ptr_info): Likewise.

	* tree-scalar-evolution.c (new_scev_info_str): Likewise.

	* tree-phinodes.c (allocate_phi_node): Likewise.

	* tree-iterator.c (tsi_link_before): Likewise.
	(tsi_link_after): Likewise.

	* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.

	* tree-dfa.c (create_var_ann): Likewise.

	* tree-cfg.c (create_bb): Likewise.

	* toplev.c (alloc_for_identifier_to_locale): Likewise.
	(general_init): Likewise.

	* stringpool.c (stringpool_ggc_alloc): Likewise.
	(gt_pch_save_stringpool): Likewise.

	* sese.c (if_region_set_false_region): Likewise.

	* passes.c (do_per_function_toporder): Likewise.

	* optabs.c (set_optab_libfunc): Likewise.
	(set_conv_libfunc): Likewise.

	* lto-symtab.c (lto_symtab_register_decl): Likewise.

	* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
	(input_eh_region): Likewise.
	(input_eh_lp): Likewise.
	(make_new_block): Likewise.
	(unpack_ts_real_cst_value_fields): Likewise.

	* lto-section-in.c (lto_new_in_decl_state): Likewise.

	* lto-cgraph.c (input_node_opt_summary): Likewise.

	* loop-init.c (loop_optimizer_init): Likewise.

	* lambda.h (lambda_vector_new): Likewise.

	* lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise.

	* ira.c (update_equiv_regs): Likewise.

	* ipa.c (cgraph_node_set_new): Likewise.
	(cgraph_node_set_add): Likewise.
	(varpool_node_set_new): Likewise.
	(varpool_node_set_add): Likewise.

	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise.
	(duplicate_ipa_jump_func_array): Likewise.
	(ipa_read_node_info): Likewise.

	* ipa-cp.c (ipcp_create_replace_map): Likewise.

	* integrate.c (get_hard_reg_initial_val): Likewise.

	* gimple.c (gimple_alloc_stat): Likewise.
	(gimple_build_omp_for): Likewise.
	(gimple_seq_alloc): Likewise.
	(gimple_copy): Likewise.

	* gimple-iterator.c (gsi_insert_before_without_update): Likewise.
	(gsi_insert_after_without_update): Likewise.

	* function.c (add_frame_space): Likewise.
	(insert_temp_slot_address): Likewise.
	(assign_stack_temp_for_type): Likewise.
	(allocate_struct_function): Likewise.
	(types_used_by_var_decl_insert): Likewise.

	* except.c (init_eh_for_function): Likewise.
	(gen_eh_region): Likewise.
	(gen_eh_region_catch): Likewise.
	(gen_eh_landing_pad): Likewise.
	(add_call_site): Likewise.

	* emit-rtl.c (get_mem_attrs): Likewise.
	(get_reg_attrs): Likewise.
	(start_sequence): Likewise.
	(init_emit): Likewise.

	* dwarf2out.c (new_cfi): Likewise.
	(queue_reg_save): Likewise.
	(dwarf2out_frame_init): Likewise.
	(new_loc_descr): Likewise.
	(find_AT_string): Likewise.
	(new_die): Likewise.
	(add_var_loc_to_decl): Likewise.
	(clone_die): Likewise.
	(clone_as_declaration): Likewise.
	(break_out_comdat_types): Likewise.
	(new_loc_list): Likewise.
	(loc_descriptor): Likewise.
	(add_loc_descr_to_each): Likewise.
	(add_const_value_attribute): Likewise.
	(tree_add_const_value_attribute): Likewise.
	(add_comp_dir_attribute): Likewise.
	(add_name_and_src_coords_attributes): Likewise.
	(lookup_filename): Likewise.
	(store_vcall_insn): Likewise.
	(dwarf2out_init): Likewise.

	* dbxout.c (dbxout_init): Likewise.

	* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.

	* config/sparc/sparc.c (sparc_init_machine_status): Likewise.

	* config/score/score7.c (score7_output_external): Likewise.

	* config/score/score3.c (score3_output_external): Likewise.

	* config/s390/s390.c (s390_init_machine_status): Likewise.

	* config/rs6000/rs6000.c (builtin_function_type): Likewise.
	(rs6000_init_machine_status): Likewise.
	(output_toc): Likewise.

	* config/pa/pa.c (pa_init_machine_status): Likewise.
	(get_deferred_plabel): Likewise.

	* config/moxie/moxie.c (moxie_init_machine_status): Likewise.

	* config/mmix/mmix.c (mmix_init_machine_status): Likewise.

	* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.

	* config/mep/mep.c (mep_init_machine_status): Likewise.
	(mep_note_pragma_flag): Likewise.

	* config/m32c/m32c.c (m32c_init_machine_status): Likewise.

	* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.

	* config/ia64/ia64.c (ia64_init_machine_status): Likewise.

	* config/i386/winnt.c (i386_pe_record_external_function): Likewise.
	(i386_pe_maybe_record_exported_symbol): Likewise.

	* config/i386/i386.c (get_dllimport_decl): Likewise.
	(ix86_init_machine_status): Likewise.
	(assign_386_stack_local): Likewise.

	* config/frv/frv.c (frv_init_machine_status): Likewise.

	* config/darwin.c (machopic_indirection_name): Likewise.

	* config/cris/cris.c (cris_init_machine_status): Likewise.

	* config/bfin/bfin.c (bfin_init_machine_status): Likewise.

	* config/avr/avr.c (avr_init_machine_status): Likewise.

	* config/arm/arm.c (arm_init_machine_status): Likewise.

	* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
	(alpha_need_linkage): Likewise.
	(alpha_use_linkage): Likewise.

	* cgraph.c (cgraph_allocate_node): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_create_indirect_edge): Likewise.
	(cgraph_add_asm_node): Likewise.

	* cfgrtl.c (init_rtl_bb_info): Likewise.

	* cfgloop.c (alloc_loop): Likewise.
	(rescan_loop_exit): Likewise.

	* cfg.c (init_flow): Likewise.
	(alloc_block): Likewise.
	(unchecked_make_edge): Likewise.

	* c-parser.c (c_parse_init): Likewise.
	(c_parse_file): Likewise.

	* c-decl.c (bind): Likewise.
	(record_inline_static): Likewise.
	(push_scope): Likewise.
	(make_label): Likewise.
	(lookup_label_for_goto): Likewise.
	(finish_struct): Likewise.
	(finish_enum): Likewise.
	(c_push_function_context): Likewise.

	* bitmap.c (bitmap_element_allocate): Likewise.
	(bitmap_gc_alloc_stat): Likewise.

	* alias.c (record_alias_subset): Likewise.
	(init_alias_analysis): Likewise.

include:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* splay-tree.h: Update copyright years.
	(splay_tree_s): Document fields.
	(splay_tree_new_typed_alloc): New.

	* hashtab.h: Update copyright years.
	(htab_create_typed_alloc): New.

libcpp:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* include/symtab.h (ht_identifier_ptr): New.

libiberty:

2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* splay-tree.c: Update copyright years.
	(splay_tree_new_typed_alloc): New.
	(splay_tree_new_with_allocator): Use it.

	* hashtab.c: Update copyright years.
	(htab_create_typed_alloc): New.
	(htab_create_alloc): Use it.

	* functions.texi: Regenerate.

From-SVN: r160425
2010-06-08 07:25:24 +00:00
Ralf Wildenhues c3f247f4ed re PR bootstrap/42798 (--enable-build-with-cxx bootstrap fails on i686-pc-linux-gnu (Fedora12))
Fix PR bootstrap/42798.

libiberty/:
        PR bootstrap/42798
        * configure.ac: Check for declaration of 'basename(char *)'.
        * configure: Regenerate.

libcpp/:
        PR bootstrap/42798
        * configure.ac: Check for declaration of 'basename(char *)'.
        * configure: Regenerate.
        * config.in: Regenerate.

libjava/:
        * configure: Regenerate.

libjava/classpath/:
        * configure: Regenerate.

fixincludes/:
        PR bootstrap/42798
        * configure.ac: Check for declaration of 'basename(char *)'.
        * configure: Regenerate.

From-SVN: r160211
2010-06-03 06:45:02 +00:00
Kai Tietz a6766312d3 demangle-expected: Add tests for __int128 and unsigned __int128 types.
libiberty/

2010-05-26  Kai Tietz  <kai.tietz@onevision.com>

        * testsuite/demangle-expected: Add tests for __int128
        and unsigned __int128 types.

gcc/testsuite
2010-05-26  Kai Tietz  <kai.tietz@onevision.com>

	* lib/target-supports.exp (check_effective_target_int128): New
	function to check if __int128 types are available for target.
	* testsuite/c-c++-common/int128-types-1.c: New.
	* testsuite/c-c++-common/int128-1.c: New.
	* testsuite/c-c++-common/int128-2.c: New.
	* g++.dg/abi/mangle43.C: New.
	* g++.dg/init/enum1.C: Handle __int128 case and add -Wno-overflow.
	* g++.dg/cpp0x/nullptr04.C: Use __SIZE_TYPE__ for getting
	pointer-wide scalar.
	* g++.dg/other/pr25632.C: Likewise.
	* g++.dg/other/large-size-array.C (DIM): Use ULLONG_MAX for win64 case.
	* g++.dg/warn/pr13358-2.C: Add llp64 for check of special
	overflow warnings.
	* g++.dg/warn/pr13358-4.C: Likewise.
	* g++.dg/warn/Wconversion-null-2.C:  Add 'long long' case.
	* g++.dg/warn/Wconversion-null.C: Likewise.

gcc/
2010-05-26  Kai Tietz  <kai.tietz@onevision.com>

	* builtin-types.def (BT_INT128): New primitive type.
	(BT_UINT128): Likewise.
	* c-common.c (c_common_r): Add __int128 keyword.
	(c_common_type_for_size): Handle __int128.
	(c_common_type_for_mode): Likewise.
	(c_common_signed_or_unsigned_type): Likewise.
	(c_common_nodes_and_builtins): Add builtin type
	if target supports 128-bit integer scalar.
	* c-common.h (enum rid): Add RID_INT128.
	* c-cppbuiltin.c (c_cpp_builtins): Define __SIZEOF_INT128__
	if target supports 128-bit integer scalar.
	* c-decl.c (declspecs_add_type): Handle new keyword
	__int128.
	(finish_declspecs): Likewise.
	* c-parser.c (c_token_starts_typename): Handle RID_INT128.
	(c_token_starts_declspecs): Likewise.
	(c_parser_declspecs): Likewise.
	(c_parser_attributes): Likewise.
	(c_parser_objc_selector): Likewise.
	* c-pretty-print.c (pp_c_integer_constant): Handle __int128.
	* c-tree.h (enum c_typespec_keyword): Add cts_int128.
	* gimple.c (gimple_signed_or_unsigned_type): Handle int128 types.
	* tree.c (make_or_reuse_type): Likewise.
	(make_unsigned_type): Likewise.
	(build_common_tree_nodes_2): Likewise.
	* tree.h (enum integer_type_kind): Add itk_int128 and
	itk_unsigned_int128.
	(int128_integer_type_node): New define..
	(int128_unsigned_type_node): New define.
	* cp/cp-tree.h (cp_decl_specifier_seq): Add new bifield
	explicit_int128_p.
	* cp/decl.c (grokdeclarator): Handle __int128.
	* cp/parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
	(cp_parser_simple_type_specifier): Likewise.
	* cp/rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
	* cp/typeck.c (cp_common_type): Handle __int128.
	* cp/mangle.c (integer_type_codes): Add itk_int128 and
	itk_unsigned_int128.
	* doc/extend.texi: Add documentation about __int128 type.

From-SVN: r159879
2010-05-26 18:13:55 +02:00
Jason Merrill 14c2101daa Add support for C++0x nullptr.
gcc:
	* c-common.c (c_common_reswords): Add nullptr.
	* c-common.h: Add RID_NULLPTR.  Reorganize C++0x rids.
	* dwarf2out.c (is_base_type): Handle NULLPTR_TYPE.
	(gen_type_die_with_usage): Likewise.
	* dbxout.c (dbxout_type): Likewise.
	* sdbout.c (plain_type_1): Likewise.
gcc/cp:
	* cp-tree.def: Add NULLPTR_TYPE.
	* cp-tree.h: Add nullptr_node.
	(cp_tree_index): Add CPTI_NULLPTR.
	(SCALAR_TYPE_P): Add NULLPTR_TYPE.
	* call.c (null_ptr_cst_p): Handle nullptr.
	(standard_conversion): Likewise.
	(convert_arg_to_ellipsis): Likewise.
	* mangle.c (write_type): Likewise.
	* name-lookup.c (arg_assoc_type): Likewise.
	* parser.c (cp_parser_primary_expression): Likewise.
	* typeck.c (cp_build_binary_op): Likewise.
	(build_reinterpret_cast_1): Likewise.
	* error.c (dump_type): Likewise.
	(dump_type_prefix, dump_type_suffix): Likewise.
	* decl.c (cxx_init_decl_processing): Likewise.
	* cxx-pretty-print.c (pp_cxx_constant): Likewise.
	* cvt.c (ocp_convert): Likewise.
	* rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
	nullptr_t tinfo in libsupc++.
libstdc++-v3:
	* config/abi/pre/gnu.ver: Add typeinfo for decltype(nullptr).
libiberty:
	* cp-demangle.c (cplus_demangle_builtin_types): Add nullptr.
	(cplus_demangle_type): Handle nullptr.

From-SVN: r159131
2010-05-06 16:51:52 -04:00
Pedro Alves 3009276c37 filenames.h (IS_DIR_SEPARATOR_1): Rename from IS_DIR_SEPARATOR...
2010-04-23  Pedro Alves  <pedro@codesourcery.com>

include/
* filenames.h (IS_DIR_SEPARATOR_1): Rename from IS_DIR_SEPARATOR,
always define it independently of host, add `dos_based' parameter,
and handle it.
(HAS_DRIVE_SPEC_1): Rename from HAS_DRIVE_SPEC, always define it
independently of host, add `dos_based' parameter, and handle it.
(IS_ABSOLUTE_PATH_1): Rename from IS_ABSOLUTE_PATH, always define
it independently of host, add `dos_based' parameter, and handle
it.
(IS_DOS_DIR_SEPARATOR, IS_DOS_ABSOLUTE_PATH)
(IS_UNIX_DIR_SEPARATOR, IS_UNIX_ABSOLUTE_PATH)
(HAS_DOS_DRIVE_SPEC): New.
(HAS_DRIVE_SPEC): Reimplement on top of HAS_DRIVE_SPEC_1.
(IS_DIR_SEPARATOR): Reimplement on top of IS_DIR_SEPARATOR_1.
(IS_ABSOLUTE_PATH): Reimplement on top of IS_ABSOLUTE_PATH_1.
* libiberty.h (dos_lbasename, unix_lbasename): Declare.

libiberty/
* lbasename.c (lbasename): Split into ...
(unix_lbasename, dos_basename): ... these.
(lbasename): ... and reimplement on top of them.
* Makefile.in (lbasename.o): Add dependency on
$(INCDIR)/filenames.h.

From-SVN: r158681
2010-04-23 20:55:41 -04:00
Jakub Jelinek 0bb8c1342f tree-ssa-pre.c (my_rev_post_order_compute): Remove set but not used count variable.
* tree-ssa-pre.c (my_rev_post_order_compute): Remove set but not
	used count variable.
	* genemit.c (gen_expand, gen_split): Avoid set but not used warnings
	when operandN variables aren't used in the body of the expander
	or splitter.
	* tree-outof-ssa.c (FOR_EACH_ELIM_GRAPH_SUCC,
	FOR_EACH_ELIM_GRAPH_PRED): Avoid set but not used warnings.
	* tree-ssa-operands.h (FOR_EACH_SSA_TREE_OPERAND): Likewise.
	* tree-flow.h (FOR_EACH_IMM_USE_FAST, FOR_EACH_IMM_USE_STMT,
	FOR_EACH_IMM_USE_ON_STMT): Likewise.
	* tree.h (FOR_EACH_CONSTRUCTOR_ELT): Likewise.
	* tree.c (PROCESS_ARG): Likewise.
fortran/
	* parse.c (parse_derived, parse_enum): Avoid set but not used
	warning.
java/
	* expr.c (process_jvm_instruction): Avoid set but not used warning.
	* builtins.c (compareAndSwapInt_builtin, compareAndSwapLong_builtin,
	getVolatile_builtin): Likewise.
libjava/
	* exception.cc (_Jv_Throw): Avoid set but not used warning.
	* include/java-assert.h (JvAssertMessage, JvAssert): Use argument in
	sizeof to avoid set but not used warnings.
libjava/classpath/
	* native/jni/midi-alsa/gnu_javax_sound_midi_alsa_AlsaPortDevice.c
	(Java_gnu_javax_sound_midi_alsa_AlsaPortDevice_run_1receiver_1thread_1):
	Avoid set but not used warning.
libiberty/
	* regex.c (byte_re_match_2_internal): Avoid set but not used
	warning.
gcc/testsuite/
	* gcc.dg/builtin-choose-expr.c: Avoid set but not used warnings.
	* gcc.dg/trunc-1.c: Likewise.
	* gcc.dg/vla-9.c: Likewise.
	* gcc.dg/dfp/composite-type.c: Likewise.
libffi/
	* testsuite/libffi.call/err_bad_abi.c: Remove unused args variable.

From-SVN: r158085
2010-04-07 22:29:01 +02:00
Jakub Jelinek 60d3aec487 tree-ssa-pre.c (my_rev_post_order_compute): Remove set but not used count variable.
* tree-ssa-pre.c (my_rev_post_order_compute): Remove set but not
	used count variable.
	* genemit.c (gen_expand, gen_split): Avoid set but not used warnings
	when operandN variables aren't used in the body of the expander
	or splitter.
	* tree-outof-ssa.c (FOR_EACH_ELIM_GRAPH_SUCC,
	FOR_EACH_ELIM_GRAPH_PRED): Avoid set but not used warnings.
	* tree-ssa-operands.h (FOR_EACH_SSA_TREE_OPERAND): Likewise.
	* tree-flow.h (FOR_EACH_IMM_USE_FAST, FOR_EACH_IMM_USE_STMT,
	FOR_EACH_IMM_USE_ON_STMT): Likewise.
	* tree.h (FOR_EACH_CONSTRUCTOR_ELT): Likewise.
	* tree.c (PROCESS_ARG): Likewise.
fortran/
	* parse.c (parse_derived, parse_enum): Avoid set but not used
	warning.
java/
	* expr.c (process_jvm_instruction): Avoid set but not used warning.
	* builtins.c (compareAndSwapInt_builtin, compareAndSwapLong_builtin,
	getVolatile_builtin): Likewise.
libjava/
	* exception.cc (_Jv_Throw): Avoid set but not used warning.
	* include/java-assert.h (JvAssertMessage, JvAssert): Use argument in
	sizeof to avoid set but not used warnings.
libjava/classpath/
	* native/jni/midi-alsa/gnu_javax_sound_midi_alsa_AlsaPortDevice.c
	(Java_gnu_javax_sound_midi_alsa_AlsaPortDevice_run_1receiver_1thread_1):
	Avoid set but not used warning.
libiberty/
	* regex.c (byte_re_match_2_internal): Avoid set but not used
	warning.
gcc/testsuite/
	* gcc.dg/builtin-choose-expr.c: Avoid set but not used warnings.
	* gcc.dg/trunc-1.c: Likewise.
	* gcc.dg/vla-9.c: Likewise.
	* gcc.dg/dfp/composite-type.c: Likewise.
libffi/
	* testsuite/libffi.call/err_bad_abi.c: Remove unused args variable.

From-SVN: r158084
2010-04-07 22:27:37 +02:00