aboutsummaryrefslogtreecommitdiff
path: root/libiberty
AgeCommit message (Collapse)AuthorFilesLines
2015-01-19strerror.c: Do not declare sys_nerr or sys_errlist if already macrosEli Zaretskii2-0/+10
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
2014-12-24xasprintf.c: New file.Uros Bizjak4-5/+85
libiberty/ChangeLog: * xasprintf.c: New file. * Makefile.in (CFILES): Add xasprintf.c. (REQUIRED_OFILES): Add xasprintf.$(objext). (xasprintf.$(objext)): New target. * functions.texi: Regenerate. include/ChangeLog: * libiberty.h (xasprintf): Declare. gcc/ChangeLog: * gengtype.h (xasprintf): Remove declaration. * gengtype.c (xasprintf): Remove. Co-Authored-By: Ben Elliston <bje@au.ibm.com> Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r219060
2014-12-11xvasprintf.c: New file.Uros Bizjak7-84/+255
* xvasprintf.c: New file. * vprintf-support.h: Likewise. * vprintf-support.c: Likewise. * Makefile.in (CFILES): Add vprintf-support.c, xvasprintf.c. (REQUIRED_OFILES): Add vprintf-support.$(objext), xvasprintf.$(objext). (vprintf-support.$(objext), xvasprintf.$(objext)): New targets. (vasprintf.$(objext)): Depend on $(srcdir)/vprintf-support.h. * functions.texi: Regenerate. * vasprintf.c (int_vasprintf): Use libiberty_vprintf_buffer_size. include/ChangeLog: * libiberty.h (xvasprintf): Declare. libcpp/ChangeLog: * directives.c (cpp_define_formatted): Use xvasprintf. Co-Authored-By: Ben Elliston <bje@au.ibm.com> Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r218618
2014-11-22Commit missing change log entries.John David Anglin1-0/+7
From-SVN: r217974
2014-11-22re PR other/63694 (Build error compiling asan.c: strtoull undeclared)John David Anglin2-0/+42
PR other/63694 * libiberty/configure.ac: Check for strtol, strtoul, strtoll and strtoull declarations. * libiberty/configure: Regenerated. * gcc/configure.ac: Check for strtol, strtoul, strtoll and strtoull declarations. * gcc/configure: Regenerated. * gcc/config.in: Regenerated. From-SVN: r217972
2014-11-12Cast strtol return to unsigned longKirill Yukhin2-1/+7
* testsuite/test-strtol.c (run_tests): Cast strtol return to unsigned long. From-SVN: r217429
2014-11-11re PR driver/36312 (should refuse to overwrite input file with output file)Anthony Brandon3-4/+51
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
2014-11-11Merger of dmalcolm/jit branch from gitDavid Malcolm2-0/+27
ChangeLog: * ChangeLog.jit: New. * MAINTAINERS (Various Maintainers): Add myself as jit maintainer. contrib/ChangeLog: * ChangeLog.jit: New. * jit-coverage-report.py: New file: a script to print crude code-coverage information for the libgccjit API. gcc/ChangeLog: * ChangeLog.jit: New. * Makefile.in (doc_build_sys): New variable, set to "sphinx" if sphinx is installed, falling back to "texinfo" otherwise. (FULL_DRIVER_NAME): New variable, adapted from the install-driver target. New target, a symlink within the builddir, linked to "xgcc", for use when running the JIT library from the builddir. (MOSTLYCLEANFILES): Add FULL_DRIVER_NAME. (install-driver): Use $(FULL_DRIVER_NAME) rather than spelling it out. * configure.ac (doc_build_sys): New variable, set to "sphinx" if sphinx is installed, falling back to "texinfo" otherwise. (GCC_DRIVER_NAME): Generate a gcc-driver-name.h file containing GCC_DRIVER_NAME for the benefit of jit/internal-api.c. * configure: Regenerate. * doc/install.texi (--enable-host-shared): Specify that this is required when building libgccjit. (Tools/packages necessary for modifying GCC): Add Sphinx. * timevar.def (TV_JIT_REPLAY): New. (TV_ASSEMBLE): New. (TV_LINK): New. (TV_LOAD): New. gcc/java/ChangeLog: * gcc/ChangeLog.jit: New. gcc/jit/ChangeLog: * ChangeLog.jit: New. * ChangeLog: New. * Make-lang.in: New. * TODO.rst: New. * config-lang.in: New. * docs/Makefile: New. * docs/_build/texinfo/Makefile: New. * docs/_build/texinfo/factorial.png: New. * docs/_build/texinfo/libgccjit.texi: New. * docs/_build/texinfo/sum-of-squares.png: New. * docs/conf.py: New. * docs/examples/tut01-hello-world.c: New. * docs/examples/tut02-square.c: New. * docs/examples/tut03-sum-of-squares.c: New. * docs/examples/tut04-toyvm/Makefile: New. * docs/examples/tut04-toyvm/factorial.toy: New. * docs/examples/tut04-toyvm/fibonacci.toy: New. * docs/examples/tut04-toyvm/toyvm.c: New. * docs/index.rst: New. * docs/internals/index.rst: New. * docs/intro/factorial.png: New. * docs/intro/index.rst: New. * docs/intro/sum-of-squares.png: New. * docs/intro/tutorial01.rst: New. * docs/intro/tutorial02.rst: New. * docs/intro/tutorial03.rst: New. * docs/intro/tutorial04.rst: New. * docs/topics/contexts.rst: New. * docs/topics/expressions.rst: New. * docs/topics/functions.rst: New. * docs/topics/index.rst: New. * docs/topics/locations.rst: New. * docs/topics/objects.rst: New. * docs/topics/results.rst: New. * docs/topics/types.rst: New. * dummy-frontend.c: New. * jit-builtins.c: New. * jit-builtins.h: New. * jit-common.h: New. * jit-playback.c: New. * jit-playback.h: New. * jit-recording.c: New. * jit-recording.h: New. * libgccjit++.h: New. * libgccjit.c: New. * libgccjit.h: New. * libgccjit.map: New. * notes.txt: New. gcc/testsuite/ChangeLog: * ChangeLog.jit: New. * jit.dg/all-non-failing-tests.h: New. * jit.dg/harness.h: New. * jit.dg/jit.exp: New. * jit.dg/test-accessing-struct.c: New. * jit.dg/test-accessing-union.c: New. * jit.dg/test-array-as-pointer.c: New. * jit.dg/test-arrays.c: New. * jit.dg/test-calling-external-function.c: New. * jit.dg/test-calling-function-ptr.c: New. * jit.dg/test-combination.c: New. * jit.dg/test-dot-product.c: New. * jit.dg/test-empty.c: New. * jit.dg/test-error-accessing-field-in-other-struct.c: New. * jit.dg/test-error-adding-to-terminated-block.c: New. * jit.dg/test-error-array-as-pointer.c: New. * jit.dg/test-error-bad-cast.c: New. * jit.dg/test-error-block-in-wrong-function.c: New. * jit.dg/test-error-call-through-ptr-with-mismatching-args.c: New. * jit.dg/test-error-call-through-ptr-with-non-function.c: New. * jit.dg/test-error-call-through-ptr-with-non-pointer.c: New. * jit.dg/test-error-call-through-ptr-with-not-enough-args.c: New. * jit.dg/test-error-call-through-ptr-with-too-many-args.c: New. * jit.dg/test-error-call-with-mismatching-args.c: New. * jit.dg/test-error-call-with-not-enough-args.c: New. * jit.dg/test-error-call-with-too-many-args.c: New. * jit.dg/test-error-dereference-field-of-non-pointer.c: New. * jit.dg/test-error-dereference-read-of-non-pointer.c: New. * jit.dg/test-error-get-type-bad-enum.c: New. * jit.dg/test-error-index-not-a-numeric-type.c: New. * jit.dg/test-error-mismatching-types-in-assignment.c: New. * jit.dg/test-error-mismatching-types-in-call.c: New. * jit.dg/test-error-missing-return.c: New. * jit.dg/test-error-new-binary-op-bad-op.c: New. * jit.dg/test-error-new-function-bad-kind.c: New. * jit.dg/test-error-new-unary-op-bad-op.c: New. * jit.dg/test-error-null-passed-to-api.c: New. * jit.dg/test-error-return-within-void-function.c: New. * jit.dg/test-error-unreachable-block.c: New. * jit.dg/test-error-unterminated-block.c: New. * jit.dg/test-error-value-not-a-numeric-type.c: New. * jit.dg/test-expressions.c: New. * jit.dg/test-factorial.c: New. * jit.dg/test-fibonacci.c: New. * jit.dg/test-functions.c: New. * jit.dg/test-fuzzer.c: New. * jit.dg/test-hello-world.c: New. * jit.dg/test-linked-list.c: New. * jit.dg/test-long-names.c: New. * jit.dg/test-nested-contexts.c: New. * jit.dg/test-nested-loops.c: New. * jit.dg/test-operator-overloading.cc: New. * jit.dg/test-quadratic.c: New. * jit.dg/test-quadratic.cc: New. * jit.dg/test-reading-struct.c: New. * jit.dg/test-string-literal.c: New. * jit.dg/test-sum-of-squares.c: New. * jit.dg/test-threads.c: New. * jit.dg/test-types.c: New. * jit.dg/test-using-global.c: New. * jit.dg/test-volatile.c: New. include/ChangeLog: * ChangeLog.jit: New. libbacktrace/ChangeLog: * ChangeLog.jit: New. libcpp/ChangeLog: * ChangeLog.jit: New. libdecnumber/ChangeLog: * ChangeLog.jit: New. libiberty/ChangeLog: * ChangeLog.jit: New. zlib/ChangeLog: * ChangeLog.jit: New. From-SVN: r217374
2014-11-05Revert revision 217149 because it breaks Ada:Manuel López-Ibáñez3-50/+4
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
2014-11-05re PR driver/36312 (should refuse to overwrite input file with output file)Anthony Brandon3-4/+50
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
2014-11-05Fix gnu11 fallout on Solaris 10+Rainer Orth2-1/+4
libobjc: * thr.c (_XOPEN_SOURCE): Define as 600. libiberty: * sigsetmask.c (_POSIX_SOURCE): Remove. libgomp: * config/posix/lock.c (_XOPEN_SOURCE) Define as 600. From-SVN: r217117
2014-10-28Add strtoll and strtoull to libiberty.Yury Gribov10-18/+721
2014-10-28 Yury Gribov <y.gribov@samsung.com> include/ * libiberty.h (strtol, strtoul, strtoll, strtoull): New prototypes. libiberty/ * strtoll.c: New file. * strtoull.c: New file. * configure.ac: Add long long checks. Add harness for strtoll and strtoull. Check decls for strtol, strtoul, strtoll, strtoull. * Makefile.in (CFILES, CONFIGURED_OFILES): Add strtoll and strtoull. * config.in: Regenerate. * configure: Regenerate. * functions.texi: Regenerate. * testsuite/Makefile.in (check-strtol): New rule. (test-strtol): Likewise. (mostlyclean): Clean up strtol test. * testsuite/test-strtol.c: New test. From-SVN: r216772
2014-10-15libiberty: Expose choose_tmpdir, and fix constness of return typeDavid Malcolm4-10/+17
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
2014-10-14Use strtod instead of strtold in libiberty/d-demangle.cJoel Brobecker2-5/+14
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
2014-09-26mangle.c (is_std_substitution): Check for abi_tag.Jason Merrill3-1/+17
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-26pex-common.h (struct pex_funcs): Add new parameter for open_write field.Max Ostapenko6-11/+26
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-23demangle.h (DMGL_DLANG): New macro.Iain Buclaw6-3/+2311
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-19simple-object-elf.c (simple_object_elf_write_ehdr): Correctly handle objects ↵Ian Lance Taylor2-9/+37
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-08-29cp-demangle.c (d_dump): Only access field from s_fixed part of the union for ↵Andrew Burgess3-2/+19
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-13demangler-fuzzer.c: New file.Gary Benson3-0/+124
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-06-11Delete temporary string within demangler even in failure cases.Andrew Burgess2-1/+9
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-01pex-win32.c (argv_to_cmdline): Don't quote args unnecessarilyRay Donnelly2-9/+42
2014-06-01 Ray Donnelly <mingw.android@gmail.com> * pex-win32.c (argv_to_cmdline): Don't quote args unnecessarily From-SVN: r211116
2014-05-28Fix demangler testsuite crashes with CP_DEMANGLE_DEBUG definedPedro Alves2-0/+11
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-22Fix test in libiberty/testsuite/demangle-expected.Thomas Schwinge2-0/+5
libiberty/ * testsuite/demangle-expected: Fix last commit. From-SVN: r210803
2014-05-14cplus-dmem.c (internal_cplus_demangle): Free any resources allocated by ↵Andrew Burgess3-0/+18
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-08cp-demangle.c (struct d_component_stack): New structure.Gary Benson3-6/+90
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-17re PR sanitizer/56781 (boostrap-asan failure: fixincl fails to link (missing ↵Jakub Jelinek5-9/+405
-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-01simple-object.c (simple_object_internal_write): Handle EINTR and short writes.Richard Biener2-8/+22
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-28simple-object.c (simple_object_internal_read): Handle EINTR and short reads.Richard Biener2-8/+22
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-13* regex.c (bzero) [!_LIBC]: Cast the call to memcpy to (void).Uros Bizjak1-1/+1
From-SVN: r208558
2014-03-13regex.c (bzero): Define without coma expression.Uros Bizjak2-3/+9
* 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-01-28Avoid "'dc' may be uninitialized" warning.Thomas Schwinge2-1/+8
libiberty/ * cp-demangle.c (d_demangle_callback): Put an abort call in place, to help the compiler. From-SVN: r207200
2014-01-21includeTom Tromey7-49/+49
* 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-06libiberty: fix --enable-install-libiberty flag [PR 56780]Mike Frysinger3-2/+6
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-06cp-demangle.c (struct d_print_info): New fields next_saved_scope...Gary Benson2-61/+223
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
2013-12-23re PR c++/41090 (Using static label reference in c++ class constructor ↵Jason Merrill2-0/+13
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-11-22Fix demangler to handle conversion operators correctly.Cary Coutant4-36/+202
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-15picflag.m4 (m68k-*-*): Use default PIC flag.Andreas Schwab2-3/+4
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-12cp-demangle.c (d_copy_templates): Cast result of malloc to (struct ↵Uros Bizjak2-9/+16
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-10-29re PR tree-optimization/58689 ([meta-bug] __attribute__((returns_nonnull)) ↵Marc Glisse2-14/+7
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-27* testsuite/test-demangle.c: Include unistd.h.Gerald Pfeifer2-0/+7
From-SVN: r204107
2013-10-25cp-demangle.c (struct d_saved_scope): New structure.Gary Benson3-2/+149
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-23* testsuite/test-expandargv.c: Include unistd.h.Gerald Pfeifer2-0/+7
From-SVN: r203993
2013-10-23Fix up ChangeLog entries (name, e-mail, formatting, otherwise).Gerald Pfeifer1-3/+3
From-SVN: r203992
2013-10-15Add --enable-host-shared configuration optionDavid Malcolm3-0/+17
/ * 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-11cp-demangle.c (d_name): Demangle local-source-names.Paul Pluzhnikov3-1/+9
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-09-12ChangeLog: Add missing file to two entries.Gary Benson1-0/+2
* libiberty/ChangeLog: Add missing file to two entries. From-SVN: r202526
2013-09-10re PR bootstrap/58386 (libstdc++.so.6: undefined symbol: htab_hash_pointer)Paolo Carlini3-170/+26
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-10cp-demangle.c: Include hashtab.h.Gary Benson3-2/+189
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-08-20floatformat.h (floatformat_ibm_long_double): Delete.Alan Modra2-2/+17
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