PR c++/70926
* cplus-dem.c: Handle large values and overflow when demangling
length variables.
(demangle_template_value_parm): Read only until end of mangled string.
(do_hpacc_template_literal): Likewise.
(do_type): Handle overflow when demangling array indices.
From-SVN: r238313
PR c++/70498
* cp-demangle.c: Parse numbers as integer instead of long to avoid
overflow after sanity checks. Include <limits.h> if available.
(INT_MAX): Define if necessary.
(d_make_template_param): Takes integer argument instead of long.
(d_make_function_param): Likewise.
(d_append_num): Likewise.
(d_identifier): Likewise.
(d_number): Parse as and return integer.
(d_compact_number): Handle overflow.
(d_source_name): Change variable type to integer for parsed number.
(d_java_resource): Likewise.
(d_special_name): Likewise.
(d_discriminator): Likewise.
(d_unnamed_type): Likewise.
* testsuite/demangle-expected: Add regression test cases.
From-SVN: r235767
PR c++/69687
* cplus-dem.c: Include <limits.h> if available.
(INT_MAX): Define if necessary.
(remember_type, remember_Ktype, register_Btype, string_need):
Abort if we detect cases where we the size of the allocation would
overflow.
From-SVN: r234829
libiberty/ChangeLog:
2016-01-26 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_function_args): Append ',' for variadic functions
only if parameters were seen before the elipsis symbol.
* testsuite/d-demangle-expected: Add coverage test for parameter-less
variadic functions.
From-SVN: r232863
libiberty/ChangeLog:
2016-01-27 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_type): Handle function types only in the context
of seeing a pointer type symbol.
* testsuite/d-demangle-expected: Update function pointer tests.
From-SVN: r232862
Would be more useful if we could use "const char * const *", but there's
a long standing bug where gcc warns about incompatible pointers when you
try to pass in "char **". We can at least constify the array itself as
gcc will not warn in that case.
From-SVN: r232089
libiberty/ChangeLog;
* crc32.c: In the documentation, don't refer to GDB's
now-nonexistent crc32 implementation. In the table-generation
program embedded within the documentation, change the type of
the induction variables i and j from int to unsigned int, to
avoid undefined behavior.
From-SVN: r231983
The fix for bug 59195:
[C++ demangler handles conversion operator incorrectly]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59195
unfortunately makes the demangler crash due to infinite recursion, in
case of casts in template parameters.
For example, with:
template<int> struct A {};
template <typename Y> void function_temp(A<sizeof ((Y)(999))>) {}
template void function_temp<int>(A<sizeof (int)>);
The 'function_temp<int>' instantiation above mangles to:
_Z13function_tempIiEv1AIXszcvT_Li999EEE
The demangler parses this as:
typed name
template
name 'function_temp'
template argument list
builtin type int
function type
builtin type void
argument list
template (*)
name 'A'
template argument list
unary operator
operator sizeof
unary operator
cast
template parameter 0 (**)
literal
builtin type int
name '999'
And after the fix for 59195, due to:
static void
d_print_cast (struct d_print_info *dpi, int options,
const struct demangle_component *dc)
{
...
/* For a cast operator, we need the template parameters from
the enclosing template in scope for processing the type. */
if (dpi->current_template != NULL)
{
dpt.next = dpi->templates;
dpi->templates = &dpt;
dpt.template_decl = dpi->current_template;
}
when printing the template argument list of A (what should be "<sizeof
(int)>"), the template parameter 0 (that is, "T_", the '**' above) now
refers to the first parameter of the the template argument list of the
'A' template (the '*' above), exactly what we were already trying to
print. This leads to infinite recursion, and stack exaustion. The
template parameter 0 should actually refer to the first parameter of
the 'function_temp' template.
Where it reads "for the cast operator" in the comment in d_print_cast
(above), it's really talking about a conversion operator, like:
struct A { template <typename U> explicit operator U(); };
We don't want to inject the template parameters from the enclosing
template in scope when processing a cast _expression_, only when
handling a conversion operator.
The problem is that DEMANGLE_COMPONENT_CAST is currently ambiguous,
and means _both_ 'conversion operator' and 'cast expression'.
Fix this by adding a new DEMANGLE_COMPONENT_CONVERSION component type,
which does what DEMANGLE_COMPONENT_CAST does today, and making
DEMANGLE_COMPONENT_CAST just simply print its component subtree.
I think we could instead reuse DEMANGLE_COMPONENT_CAST and in
d_print_comp_inner still do:
@@ -5001,9 +5013,9 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
d_print_comp (dpi, options, dc->u.s_extended_operator.name);
return;
case DEMANGLE_COMPONENT_CAST:
d_append_string (dpi, "operator ");
- d_print_cast (dpi, options, dc);
+ d_print_conversion (dpi, options, dc);
return;
leaving the unary cast case below calling d_print_cast, but seems to
me that spliting the component types makes it easier to reason about
the code.
g++'s testsuite actually generates three symbols that crash the
demangler in the same way. I've added those as tests in the demangler
testsuite as well.
And then this fixes PR other/61233 too, which happens to be a
demangler crash originally reported to GDB, at:
https://sourceware.org/bugzilla/show_bug.cgi?id=16957
Bootstrapped and regtested on x86_64 Fedora 20.
Also ran this through GDB's testsuite. GDB will require a small
update to use DEMANGLE_COMPONENT_CONVERSION in one place it's using
DEMANGLE_COMPONENT_CAST in its sources.
libiberty/
2015-11-27 Pedro Alves <palves@redhat.com>
PR other/61321
PR other/61233
* demangle.h (enum demangle_component_type)
<DEMANGLE_COMPONENT_CONVERSION>: New value.
* cp-demangle.c (d_demangle_callback, d_make_comp): Handle
DEMANGLE_COMPONENT_CONVERSION.
(is_ctor_dtor_or_conversion): Handle DEMANGLE_COMPONENT_CONVERSION
instead of DEMANGLE_COMPONENT_CAST.
(d_operator_name): Return a DEMANGLE_COMPONENT_CONVERSION
component if handling a conversion.
(d_count_templates_scopes, d_print_comp_inner): Handle
DEMANGLE_COMPONENT_CONVERSION.
(d_print_comp_inner): Handle DEMANGLE_COMPONENT_CONVERSION instead
of DEMANGLE_COMPONENT_CAST.
(d_print_cast): Rename as ...
(d_print_conversion): ... this. Adjust comments.
(d_print_cast): Rewrite - simply print the left subcomponent.
* cp-demint.c (cplus_demangle_fill_component): Handle
DEMANGLE_COMPONENT_CONVERSION.
* testsuite/demangle-expected: Add tests.
From-SVN: r231020
Using the standard gnulib obstack source requires importing quite a
lot of other files from gnulib, and requires build changes.
include/
* obstack.h (__attribute_pure__): Expand _GL_ATTRIBUTE_PURE.
libiberty/
* obstack.c (__alignof__): Expand alignof_type from alignof.h.
(obstack_exit_failure): Don't use exitfail.h.
(_): Include libintl.h when HAVE_LIBINTL_H and nls enabled.
Provide default. Don't include gettext.h.
(_Noreturn): Define.
* obstacks.texi: Adjust node references to external libc info files.
From-SVN: r229988
This copies obstack.[ch] from gnulib, and updates the docs. The next
patch should be applied if someone repeats the import at a later date.
include/
* obstack.h: Import current gnulib file.
libiberty/
* obstack.c: Import current gnulib file.
* obstacks.texi: Updated doc, from glibc's manual/memory.texi.
From-SVN: r229987
libiberty/
* cp-demangle.c (d_dump): Fix syntax error.
(d_identifier): Adjust type of len to match d_source_name.
(d_expression_1): Fix out-of-bounds access. Check code variable for
NULL before dereferencing it.
(d_find_pack): Do not recurse for FIXED_TYPE, DEFAULT_ARG and NUMBER.
(d_print_comp_inner): Add NULL pointer check.
* cp-demangle.h (d_peek_next_char): Define as inline function when
CHECK_DEMANGLER is defined.
(d_advance): Likewise.
* testsuite/demangle-expected: Add new testcases.
From-SVN: r225727
PR c++/44282
gcc/cp/
* mangle.c (attr_strcmp): New.
(write_CV_qualifiers_for_type): Also write out attributes that
affect type identity.
(write_type): Strip all attributes after writing qualifiers.
libiberty/
* cp-demangle.c (cplus_demangle_type): Handle arguments to vendor
extended qualifier.
From-SVN: r224007
libiberty/ChangeLog:
2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_symbol_kinds): New enum.
(dlang_parse_symbol): Update signature. Handle an ambiguity between
pascal functions and template value arguments. Only check for a type
if parsing a function, or at the top level. Return failure if the
entire symbol was not successfully demangled.
(dlang_identifier): Update signature. Handle an ambiguity between two
adjacent digits in a mangled symbol string.
(dlang_type): Update call to dlang_parse_symbol.
(dlang_template_args): Likewise.
(dlang_parse_template): Likewise.
(dlang_demangle): Likewise.
* testsuite/d-demangle-expected: Fix bad tests found, and add problematic
examples to the unittests.
From-SVN: r223247
libiberty/ChangeLog:
2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_attributes): Handle return attributes, ignoring
return parameters in the mangled string. Return NULL if have encountered
an unknown attribute.
(dlang_function_args): Handle return parameters in the mangled string.
* testsuite/d-demangle-expected: Add coverage tests for functions with
return parameters and return attributes.
From-SVN: r223244
libiberty/ChangeLog:
2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_type_modifiers): New function.
(dlang_type_modifier_p): New function.
(dlang_call_convention_p): Ignore any kind of type modifier.
(dlang_type): Handle and emit the type modifier after delegate types.
(dlang_parse_symbol): Handle and emit the type modifier after the symbol.
* testsuite/d-demangle-expected: Add coverage tests for all valid
usages of function symbols with type modifiers.
From-SVN: r223242
libiberty/ChangeLog:
2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_call_convention): Return NULL if have reached the
end of the symbol, but expected something to read.
(dlang_attributes): Likewise.
(dlang_function_type): Likewise.
(dlang_type): Likewise.
(dlang_identifier): Likewise.
(dlang_value): Likewise.
From-SVN: r223241
libiberty/ChangeLog:
2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_parse_string): Represent embedded whitespace or
non-printable characters as hex or escape sequences.
* testsuite/d-demangle-expected: Add test for templates with tabs and
newlines embedded into the signature.
From-SVN: r223240
libiberty/ChangeLog:
* mkstemps.c: #include <time.h> if HAVE_TIME_H is defined
but not HAVE_SYS_TIME_H.
(fixes a build failure on LynxOS-178)
From-SVN: r222918
2015-04-22 Eli Zaretskii <eliz@gnu.org>
* strerror.c <sys_nerr, sys_errlist>: Declare only if they aren't
macros.
* setenv.c <environ>: Declare only if not a macro.
From-SVN: r222335
PR target/65351
config/
* mh-darwin: Only apply -mdynamic-no-pic for m32 Darwin when the compiler in
use supports -mno-dynamic-no-pic.
* picflag.m4: Only append -mno-dynamic-no-pic for Darwin when -mdynamic-no-pic
is present in CFLAGS.
libiberty/
* configure: Regenerate.
libada/
* configure: Regenerate.
libgcc/
* configure: Regenerate.
gcc/
* configure: Regenerate.
Co-Authored-By: Iain Sandoe <iain@codesourcery.com>
From-SVN: r221967
This fixes a MinGW warning in libiberty/strerror.c
2015-01-19 Eli Zaretskii <eliz@gnu.org>
* strerror.c <sys_nerr, sys_errlist>: Declare only if they aren't
macros.
From-SVN: r219849
gcc/testsuite/ChangeLog:
2014-11-11 Anthony Brandon <anthony.brandon@gmail.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR driver/36312
* gcc.misc-tests/output.exp: New test case for identical input and
output files.
include/ChangeLog:
2014-11-11 Anthony Brandon <anthony.brandon@gmail.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR driver/36312
* filenames.h: Add prototype for canonical_filename_eq.
gcc/ChangeLog:
2014-11-11 Anthony Brandon <anthony.brandon@gmail.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR driver/36312
* diagnostic-core.h: Add prototype for fatal_error.
* diagnostic.c (fatal_error): New function fatal_error.
* gcc.c (store_arg): Remove have_o_argbuf_index.
(process_command): Check if input and output files are the same.
* toplev.c (init_asm_output): Check if input and output files are
the same.
libiberty/ChangeLog:
2014-11-11 Anthony Brandon <anthony.brandon@gmail.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR driver/36312
* filename_cmp.c (canonical_filename_eq): New function to check if
file names are the same.
* functions.texi: Updated with documentation for new function.
Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>
From-SVN: r217391
gcc/testsuite/ChangeLog:
2014-11-05 Anthony Brandon <anthony.brandon@gmail.com>
PR driver/36312
* gcc.misc-tests/output.exp: New test case for identical input and
output files.
include/ChangeLog:
2014-11-05 Anthony Brandon <anthony.brandon@gmail.com>
PR driver/36312
* filenames.h: Add prototype for canonical_filename_eq.
gcc/ChangeLog:
2014-11-05 Anthony Brandon <anthony.brandon@gmail.com>
PR driver/36312
* diagnostic-core.h: Add prototype for fatal_error.
* diagnostic.c (fatal_error): New function fatal_error.
* gcc.c (store_arg): Remove have_o_argbuf_index.
(process_command): Check if input and output files are the same.
* toplev.c (init_asm_output): Check if input and output files are
the same.
libiberty/ChangeLog:
2014-11-05 Anthony Brandon <anthony.brandon@gmail.com>
PR driver/36312
* filename_cmp.c (canonical_filename_eq): New function to check if
file names are the same.
* functions.texi: Updated with documentation for new function.
From-SVN: r217159
gcc/testsuite/ChangeLog:
2014-11-05 Anthony Brandon <anthony.brandon@gmail.com>
PR driver/36312
* gcc.misc-tests/output.exp: New test case for identical input and
output files.
include/ChangeLog:
2014-11-05 Anthony Brandon <anthony.brandon@gmail.com>
PR driver/36312
* filenames.h: Add prototype for canonical_filename_eq.
gcc/ChangeLog:
2014-11-05 Anthony Brandon <anthony.brandon@gmail.com>
PR driver/36312
* diagnostic-core.h: Add prototype for fatal_error.
* diagnostic.c (fatal_error): New function fatal_error.
* gcc.c (store_arg): Remove have_o_argbuf_index.
(process_command): Check if input and output files are the same.
* toplev.c (init_asm_output): Check if input and output files are
the same.
libiberty/ChangeLog:
2014-11-05 Anthony Brandon <anthony.brandon@gmail.com>
PR driver/36312
* filename_cmp.c (canonical_filename_eq): New function to check if
file names are the same.
* functions.texi: Updated with documentation for new function.
From-SVN: r217149
include/ChangeLog:
* libiberty.h (choose_tmpdir): New prototype.
libiberty/ChangeLog:
* choose-temp.c (choose_tmpdir): Remove now-redundant local
copy of prototype.
* functions.texi: Regenerate.
* make-temp-file.c (choose_tmpdir): Convert return type from
char * to const char * - given that this returns a pointer to
a memoized allocation, the caller must not touch it.
From-SVN: r216285
strtold is currently used to decode templates which have a floating-point
value encoded inside; but this routine is not available on some systems,
such as Solaris 2.9 for instance.
This patch fixes the issue by replace the use of strtold by strtod.
It reduces a bit the precision, but it should still remain acceptable
in most cases.
libiberty/ChangeLog:
* d-demangle.c: Replace strtold with strtod in global comment.
(strtold): Remove declaration.
(strtod): New declaration.
(dlang_parse_real): Declare value as double instead of long
double. Replace call to strtold by call to strtod.
Update format in call to snprintf.
From-SVN: r216216
* 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
* 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
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
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
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
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-04-01 Richard Biener <rguenther@suse.de>
libiberty/
* simple-object.c (simple_object_internal_write): Handle
EINTR and short writes.
From-SVN: r208972
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
* regex.c (bzero) [!_LIBC]: Define without coma expression.
(regerror): Cast the call to memcpy to (void) to avoid unused
value warnings.
From-SVN: r208553
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
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
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
* 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
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-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 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
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
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
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
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
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
* 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
* 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-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
* 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
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
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
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
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
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
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
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-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
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
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-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-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
* 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
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-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
* 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
* 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
* c-pretty-print.c (pp_c_specifier_qualifier_list) [VECTOR_TYPE]:
Use () rather than [], and move before the element type.
* cp-demangle.c (d_print_mod): Use () rather than [] for vectors.
From-SVN: r157650
libgcc/:
PR other/42980
* Makefile.in (install): Use $(MAKE) string in rule, for
parallel make.
libiberty/:
* Makefile.in (all): Do not use exec.
From-SVN: r157159
PR c++/42338
* mangle.c (write_expression): Handle tree codes that have extra
arguments in the middle-end.
* cp-demangle.c (d_print_comp): Fix array index printing.
From-SVN: r156103
* README: Mention changes to Makefile.in and functions.texi.
* gather-docs: Mention 'make stamp-functions' in the header.
Co-Authored-By: Ben Elliston <bje@au.ibm.com>
From-SVN: r154545
* pex-unix.c (pex_child_error): Improve warning avoidance by
checking the results of write(3) and exiting with -2 if any write
returns a negative value.
Co-Authored-By: Ian Lance Taylor <iant@google.com>
From-SVN: r154431
* pex-unix.c (pex_child_error): Define writeerr macro to avoid
unused result warnings from write(3) calls. Undefine writeerr
after all uses.
From-SVN: r154344
2009-10-08 Daniel Gutson <dgutson@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
Pedro Alves <pedro@codesourcery.com>
libiberty/
* argv.c (consume_whitespace): New function.
(only_whitespace): New function.
(buildargv): Always use ISSPACE by calling consume_whitespace.
(expandargv): Skip empty files. Do not stop at the first empty
argument (calling only_whitespace)..
* testsuite/test-expandargv.c: (test_data): Test empty lines
and empty arguments.
(run_tests): Fix false positives due to shorter arguments.
Co-Authored-By: Daniel Jacobowitz <dan@codesourcery.com>
Co-Authored-By: Pedro Alves <pedro@codesourcery.com>
From-SVN: r152560
2009-09-30 Martin Thuresson <martint@google.com>
* regex.c (byte_re_match_2_internal): Split declaration and
assignment to avoid -Wc++-compat warning due to goto.
From-SVN: r152354
2009-09-02 Tristan Gingold <gingold@adacore.com>
* vmsbuild.com: Removed as unused and superceeded by makefile.vms.
* makefile.vms: Ported to Itanium VMS. Remove useless targets and
dependencies. Remove unused FORMAT variable.
* configure.com: New file to create build.com DCL script for
Itanium VMS or Alpha VMS.
From-SVN: r151333
fixincludes/
* Makefile.in (AUTOCONF, AUTOHEADER, ACLOCAL, ACLOCAL_AMFLAGS):
New variables.
($(srcdir)/configure, $(srcdir)/config.h.in, $(srcdir)/aclocal.m4):
Use them.
gcc/
* Makefile.in (AUTOCONF, ACLOCAL, ACLOCAL_AMFLAGS, aclocal_deps):
New variables.
($(srcdir)/configure, $(srcdir)/aclocal.m4): New rules.
(AUTOHEADER): New variable.
($(srcdir)/cstamp-h.in): Use it.
gnattools/
* Makefile.in (AUTOCONF, configure_deps): New variables.
($(srcdir)/configure): Use them.
libada/
* Makefile.in (AUTOCONF, configure_deps): New variables.
($(srcdir)/configure)): Use them. Also depend on multi.m4.
libgcc/
* configure.ac: Add snippet for maintainer-mode.
* configure: Regenerate.
* Makefile.in (AUTOCONF, configure_deps): New variables.
($(srcdir)/configure)): New rule, active only with maintainer
mode turned on.
libiberty/
* Makefile.in (AUTOCONF, configure_deps): New variables.
($(srcdir)/configure): New rule, active only in maintainer mode.
libobjc/
* Makefile.in (AUTOCONF, ACLOCAL, ACLOCAL_AMFLAGS, aclocal_deps):
New variables.
($(srcdir)/configure, $(srcdir)/aclocal.m4): New rules.
intl/
* Makefile.in (aclocal_deps): New variable.
($(srcdir)/aclocal.m4): Use it, for portable makefile syntax.
libdecnumber/
* Makefile.in (aclocal_deps): New variable.
($(srcdir)/aclocal.m4): Use it, for portable makefile syntax.
From-SVN: r150277