testsuite: Fix up testcase for ia32 [PR98191]
[gcc.git] / libcpp / ChangeLog
index 11c0773adb6e979e49343180e2d3834f76eac49b..83cbde30b3cfb48aaefcf26c8b3014f09daae16b 100644 (file)
@@ -1,5 +1,451 @@
+2020-12-01  JeanHeyd Meneide  <phdofthehouse@gmail.com>
+
+       * charset.c (init_iconv_desc): Initialize "to" and "from" fields.
+       * directives.c (cpp_get_narrow_charset_name): New function.
+       (cpp_get_wide_charset_name): Likewise.
+       * include/cpplib.h (cpp_get_narrow_charset_name): Prototype.
+       (cpp_get_wide_charset_name): Likewise.
+       * internal.h (cset_converter): Add "to" and "from" fields.
+
+2020-11-27  Joseph Myers  <joseph@codesourcery.com>
+
+       PR preprocessor/97602
+       * directives.c (strtolinenum): Check for overflow before it
+       occurs.  Correct comment.
+
+2020-11-24  Nathan Sidwell  <nathan@acm.org>
+
+       * include/cpplib.h (struct cpp_hashnode): Add deferred field.
+       (cpp_set_deferred_macro): Define.
+       (cpp_get_deferred_macro): Declare.
+       (cpp_macro_definition): Reformat, add overload.
+       (cpp_macro_definition_location): Deal with deferred macro.
+       (cpp_alloc_token_string, cpp_compare_macro): Declare.
+       * internal.h (_cpp_notify_macro_use): Return bool
+       (_cpp_maybe_notify_macro_use): Likewise.
+       * directives.c (do_undef): Check macro is not undef before
+       warning.
+       (do_ifdef, do_ifndef): Deal with deferred macro.
+       * expr.c (parse_defined): Likewise.
+       * lex.c (cpp_allocate_token_string): Break out of ...
+       (create_literal): ... here.  Call it.
+       (cpp_maybe_module_directive): Deal with deferred macro.
+       * macro.c (cpp_get_token_1): Deal with deferred macro.
+       (warn_of_redefinition): Deal with deferred macro.
+       (compare_macros): Rename to ...
+       (cpp_compare_macro): ... here.  Make extern.
+       (cpp_get_deferred_macro): New.
+       (_cpp_notify_macro_use): Deal with deferred macro, return bool
+       indicating definedness.
+       (cpp_macro_definition): Deal with deferred macro.
+
+2020-11-19  Nathan Sidwell  <nathan@acm.org>
+
+       * include/cpplib.h (enum cpp_main_search): New.
+       (struct cpp_options): Add main_search field.
+       (cpp_main_loc): Declare.
+       (cpp_retrofit_as_include): Declare.
+       * internal.h (struct cpp_reader): Add main_loc field.
+       (_cpp_in_main_source_file): Not main if main is a header.
+       * init.c (cpp_read_main_file): Use main_search option to locate
+       main file.  Set main_loc
+       * files.c (cpp_retrofit_as_include): New.
+
+2020-11-19  Nathan Sidwell  <nathan@acm.org>
+
+       * internal.h (cpp_in_system_header): Rename to ...
+       (_cpp_in_system_header): ... here.
+       (cpp_in_primary_file): Rename to ...
+       (_cpp_in_main_source_file): ... here.  Compare main_file equality
+       and check main_search value.
+       * lex.c (maybe_va_opt_error, _cpp_lex_direct): Adjust for rename.
+       * macro.c (_cpp_builtin_macro_text): Likewise.
+       (replace_args): Likewise.
+       * directives.c (do_include_next): Likewise.
+       (do_pragma_once, do_pragma_system_header): Likewise.
+       * files.c (struct _cpp_file): Delete main_file field.
+       (pch_open): Check pfile->main_file equality.
+       (make_cpp_file): Drop cpp_reader parm, don't set main_file.
+       (_cpp_find_file): Adjust.
+       (_cpp_stack_file): Check pfile->main_file equality.
+       (struct report_missing_guard_data): Add cpp_reader field.
+       (report_missing_guard): Check pfile->main_file equality.
+       (_cpp_report_missing_guards): Adjust.
+
+2020-11-18  Nathan Sidwell  <nathan@acm.org>
+
+       * include/cpplib.h (struct cpp_options): Add module_directives
+       option.
+       (NODE_MODULE): New node flag.
+       (struct cpp_hashnode): Make rid-code a bitfield, increase bits in
+       flags and swap with type field.
+       * init.c (post_options): Create module-directive identifier nodes.
+       * internal.h (struct lexer_state): Add directive_file_token &
+       n_modules fields.  Add module node enumerator.
+       * lex.c (cpp_maybe_module_directive): New.
+       (_cpp_lex_token): Call it.
+       (cpp_output_token): Add '"' around CPP_HEADER_NAME token.
+       (do_peek_ident, do_peek_module): New.
+       (cpp_directives_only): Detect module-directive lines.
+       * macro.c (cpp_get_token_1): Deal with directive_file_token
+       triggering.
+
+2020-11-18  Nathan Sidwell  <nathan@acm.org>
+
+       * files.c (struct _cpp_file): Add header_unit field.
+       (_cpp_stack_file): Add header unit support.
+       (cpp_find_header_unit): New.
+       * include/cpplib.h (cpp_find_header_unit): Declare.
+
+2020-11-18  Nathan Sidwell  <nathan@acm.org>
+
+       * include/cpplib.h (struct cpp_options): Add modules to
+       dep-options.
+       * include/mkdeps.h (deps_add_module_target): Declare.
+       (deps_add_module_dep): Declare.
+       * mkdeps.c (class mkdeps): Add modules, module_name, cmi_name,
+       is_header_unit fields.  Adjust cdtors.
+       (deps_add_module_target, deps_add_module_dep): New.
+       (make_write): Write module dependencies, if enabled.
+
+2020-11-17  Nathan Sidwell  <nathan@acm.org>
+
+       * include/cpplib.h (struct cpp_callbacks): Add
+       user_deferred_macro & translate_include.
+
+2020-11-17  Nathan Sidwell  <nathan@acm.org>
+
+       * include/line-map.h (enum lc_reason): Add LC_MODULE.
+       (MAP_MODULE_P): New.
+       (line_map_new_raw): Declare.
+       (linemap_enter_macro): Move declaration from internal.h
+       (linemap_module_loc, linemap_module_reparent)
+       (linemap_module_restore): Declare.
+       (linemap_lookup_macro_indec): Declare.
+       * internal.h (linemap_enter_macro): Moved to line-map.h.
+       * line-map.c (linemap_new_raw): New, broken out of ...
+       (new_linemap): ... here.  Call it.
+       (LAST_SOURCE_LINE_LOCATION): New.
+       (liemap_module_loc, linemap_module_reparent)
+       (linemap_module_restore): New.
+       (linemap_lookup_macro_index): New, broken out of ...
+       (linemap_macro_map_lookup): ... here.  Call it.
+       (linemap_dump): Add module dump.
+
+2020-11-17  Nathan Sidwell  <nathan@acm.org>
+
+       PR preprocessor/97858
+       * mkdeps.c (munge): Drop varadic args, we only ever use one.
+
+2020-11-13  Joseph Myers  <joseph@codesourcery.com>
+
+       * expr.c (cpp_classify_number): Update diagnostic for binary
+       constants for C.  Also diagnose binary constants for
+       -Wc11-c2x-compat.
+       * init.c (lang_defaults): Enable binary constants for GNUC2X and
+       STDC2X.
+
+2020-11-13  Piotr H. Dabrowski  <phd@phd.re>
+
+       PR c++/91318
+       * include/cpplib.h: Added cpp_define_unused(), cpp_define_formatted_unused()
+       * directives.c: Likewise.
+
+2020-11-12  Joseph Myers  <joseph@codesourcery.com>
+
+       * include/cpplib.h (struct cpp_callbacks): Add bool argument to
+       has_attribute.
+       (enum cpp_builtin_type): Add BT_HAS_STD_ATTRIBUTE.
+       * init.c (builtin_array): Add __has_c_attribute.
+       (cpp_init_special_builtins): Handle BT_HAS_STD_ATTRIBUTE.
+       * macro.c (_cpp_builtin_macro_text): Handle BT_HAS_STD_ATTRIBUTE.
+       Update call to has_attribute for BT_HAS_ATTRIBUTE.
+       * traditional.c (fun_like_macro): Handle BT_HAS_STD_ATTRIBUTE.
+
+2020-11-12  Nicholas Guriev  <guriev-ns@ya.ru>
+
+       PR pch/86674
+       * files.c (_cpp_find_file): Use CPP_DL_NOTE not CPP_DL_ERROR in call to
+       cpp_error.
+
+2020-11-07  Lewis Hyatt  <lhyatt@gmail.com>
+
+       * generated_cpp_wcwidth.h: Regenerated from Unicode 13.0.0 data.
+
+2020-11-06  Nathan Sidwell  <nathan@acm.org>
+
+       * include/cpplib.h (enum class CPP_time_kind): New.
+       (cpp_get_date): Declare.
+       * internal.h (struct cpp_reader): Replace source_date_epoch with
+       time_stamp and time_stamp_kind.
+       * init.c (cpp_create_reader): Initialize them.
+       * macro.c (_cpp_builtin_macro_text): Use cpp_get_date.
+       (cpp_get_date): Broken out from _cpp_builtin_macro_text and
+       genericized.
+
+2020-11-03  Nathan Sidwell  <nathan@acm.org>
+
+       * lex.c (cpp_peek_token): Do not peek past CPP_PRAGMA.
+       (_cpp_lex_direct): Handle EOF in pragma when setting need_line,
+       not when needing a line.
+
+2020-11-03  Nathan Sidwell  <nathan@acm.org>
+
+       * lex.c (_cpp_clean_line): Fix DOS off-by-one error.
+
+2020-11-03  Nathan Sidwell  <nathan@acm.org>
+
+       * init.c (cpp_read_main_file): Use cpp_get_deps result.
+
+2020-11-03  Nathan Sidwell  <nathan@acm.org>
+
+       * include/mkdeps.h: Include cpplib.h
+       (deps_write): Adjust first parm type.
+       * mkdeps.c: Include internal.h
+       (make_write): Adjust first parm type.  Check phony option
+       directly.
+       (deps_write): Adjust first parm type.
+       * init.c (cpp_read_main_file): Use get_deps.
+       * directives.c (cpp_get_deps): Check option before initializing.
+
+2020-11-02  Nathan Sidwell  <nathan@acm.org>
+
+       * internal.h (_cpp_notify_macro_use): Add location parm.
+       (_cpp_maybe_notify_macro_use): Likewise.
+       * directives.c (_cpp_do_file_change): Check we've not changed file
+       when optimizing a rewind.
+       (do_ifdef): Pass location to _cpp_maybe_notify_macro_use.
+       (do_ifndef): Likewise.  Delete obsolete comment about powerpc.
+       * expr.c (parse_defined): Pass location to
+       _cpp_maybe_notify_macro_use.
+       * macro.c (enter_macro_context): Likewise.
+       (warn_of_redefinition): Break out helper function.  Call it.
+       (compare_macros): New function broken out of warn_of_redefinition.
+       (_cpp_new_macro): Zero all fields.
+       (_cpp_notify_macro_use): Add location parameter.
+
+2020-10-20  Nathan Sidwell  <nathan@acm.org>
+
+       * lex.c (_cpp_lex_direct): Do not complete EOF processing when
+       parsing_args.
+       * macro.c (collect_args): Do not unwind fake EOF.
+       (funlike_invocation_p): Do not unwind fake EOF.
+       (cpp_context): Replace abort with gcc_assert.
+
+2020-10-19  Nathan Sidwell  <nathan@acm.org>
+
+       * internal.h (struct cpp_reader): Rename 'eof' field to 'endarg'.
+       * init.c (cpp_create_reader): Adjust.
+       * macro.c (collect_args): Use endarg for separator.  Always rewind
+       in the not-fn case.
+
+2020-10-08  Nathan Sidwell  <nathan@acm.org>
+
+       * internal.h (enum include_type): Rename IT_MAIN_INJECT to
+       IT_PRE_MAIN.
+       * init.c (cpp_read_main_file): If there is no line marker, adjust
+       the initial line marker.
+       (read_original_filename): Return bool, peek the buffer directly
+       before trying to tokenize.
+       (read_original_directory): Likewise.  Directly prod the string
+       literal.
+       * files.c (_cpp_stack_file): Adjust for IT_PRE_MAIN change.
+
+2020-09-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR bootstrap/97163
+       * lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
+       for GCC >= 4.5.
+
+2020-09-17  Patrick Palka  <ppalka@redhat.com>
+
+       PR c/80076
+       * include/line-map.h (first_map_in_common): Declare.
+       * line-map.c (first_map_in_common): Remove static.
+
+2020-09-07  Martin Storsjö  <martin@martin.st>
+
+       * files.c (remap_filename): Make a strchr return value pointer
+       to const.
+
+2020-07-30  H.J. Lu  <hjl.tools@gmail.com>
+
+       PR bootstrap/96202
+       * configure: Regenerated.
+
+2020-07-29  Tiziano Müller  <tiziano.mueller@chem.uzh.ch>
+
+       * init.c (builtin_array): Add xref comment.
+       * traditional.c (fun_like_macro): Add HAS_INCLUDE codes.
+
+2020-07-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR preprocessor/96323
+       * lex.c (lex_raw_string): For c == '\n' don't continue after reporting
+       an prefix delimiter error.
+
+2020-07-28  Nathan Sidwell  <nathan@acm.org>
+
+       * init.c (cpp_read_main_file): Always use the last map for
+       the return value.
+
+2020-07-20  Nathan Sidwell  <nathan@acm.org>
+
+       * line-map.c (linemap_add): Simplify column overflow calculation.
+       Add comment about range and column bit init.
+       (linemap_ordinary_map_lookup): Refactor for RAII
+       (linemap_macro_map_lookup): Likewise.
+
+2020-07-14  Lewis Hyatt  <lhyatt@gmail.com>
+
+       PR preprocessor/49973
+       PR other/86904
+       * include/cpplib.h (struct cpp_options):  Removed support for -ftabstop,
+       which is now handled by diagnostic_context.
+       (class cpp_display_width_computation): New class.
+       (cpp_byte_column_to_display_column): Add optional tabstop argument.
+       (cpp_display_width): Likewise.
+       (cpp_display_column_to_byte_column): Likewise.
+       * charset.c
+       (cpp_display_width_computation::cpp_display_width_computation): New
+       function.
+       (cpp_display_width_computation::advance_display_cols): Likewise.
+       (compute_next_display_width): Removed and implemented this
+       functionality in a new function...
+       (cpp_display_width_computation::process_next_codepoint): ...here.
+       (cpp_byte_column_to_display_column): Added tabstop argument.
+       Reimplemented in terms of class cpp_display_width_computation.
+       (cpp_display_column_to_byte_column): Likewise.
+       * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now
+       handled by diagnostic_context.
+
+2020-07-07  Nathan Sidwell  <nathan@acm.org>
+
+       * directives.c (do_linemarker): Optimize rewinding to line zero.
+       * files.c (_cpp_stack_file): Start on line zero when about to inject
+       headers.
+       (cpp_push_include, cpp_push_default_include): Use highest_line as
+       the location.
+       * include/cpplib.h (cpp_read_main_file): Add injecting parm.
+       * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file.
+       * internal.h (enum include_type): Add IT_MAIN_INJECT.
+
+2020-05-29  H.J. Lu  <hjl.tools@gmail.com>
+
+       PR bootstrap/95413
+       * configure: Regenerated.
+
+2020-05-23  David Edelsohn  <dje.gcc@gmail.com>
+
+       * Makefile.in (AR): Substitute @AR@.
+       * configure.ac (CHECK_PROG AR): New.
+       * configure: Regenerate.
+
+2020-05-20  Nathan Sidwell  <nathan@acm.org>
+
+       * internal.h (typedef _cpp_file): Delete, unnecessary in C++.
+       (enum _cpp_find_file_kind): New.
+       (_cpp_find_file): Use it, not 3 bools.
+       * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not
+       bools.
+       (cpp_make_system_header): Break overly long line.
+       (_cpp_stack_include, _cpp_fake_include)
+       (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust.
+       * init.c (cpp_read_main): Adjust _cpp_find_file call.
+
+2020-05-18  Nathan Sidwell  <nathan@acm.org>
+
+       * include/cpplib.h (cpp_get_otions, cpp_get_callbacks)
+       (cpp_get_deps): Mark as PURE.
+       * include/line-map.h (get_combined_adhoc_loc)
+       (get_location_from_adhoc_loc, get_pure_location): Reformat decls.
+       * internal.h (struct lexer_state): Clarify comment.
+       * system.h: Remove now-unneeded bool hackery.
+       * files.c (_cpp_find_file): Store LOC not highest_location.
+
+       PR preprocessor/95149
+       * lex.c (struct lit_accum): New.
+       (bufring_append): Replace by lit_accum::append.
+       (lex_raw_string): Reimplement, using fragments of the old version.
+       (lex_string): Adjust lex_raw_string call.
+
+       PR preprocessor/95182
+       * macro.c (collect_args): Preserve EOFif we fell out of the main
+       file.
+       (cpp_get_token_1): Reformat a couple of short lines.
+
+2020-05-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * configure: Regenerated.
+
+2020-05-13  Jason Merrill  <jason@redhat.com>
+
+       * include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
+       * init.c, lex.c: Adjust.
+
+2020-05-12  Nathan Sidwell  <nathan@acm.org>
+
+       EOF location is at end of file
+       PR preprocessor/95013
+       * lex.c (lex_raw_string): Process line notes before incrementing.
+       Correct incrementing condition.  Adjust for new
+       _cpp_get_fresh_line EOF behaviour.
+       (_cpp_get_fresh_line): Do not pop buffer at EOF, increment line
+       instead.
+       (_cpp_lex_direct): Adjust for new _cpp_get_fresh_line behaviour.
+       (cpp_directive_only_process): Assert we got a fresh line.
+       * traditional.c (_cpp_read_logical_line_trad): Adjust for new
+       _cpp_get_fresh_line behaviour.
+
+2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * Makefile.in (CET_HOST_FLAGS): New.
+       (COMPILER): Add $(CET_HOST_FLAGS).
+       * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
+       AC_SUBST(CET_HOST_FLAGS).  Clear CET_HOST_FLAGS if jit isn't
+       enabled.
+       * aclocal.m4: Regenerated.
+       * configure: Likewise.
+
+2020-05-08  Nathan Sidwell  <nathan@acm.org>
+
+       Reimplement directives only processing, support raw literals.
+       * directives-only.c: Delete.
+       * Makefile.in (libcpp_a_OBJS, libcpp_a_SOURCES): Remove it.
+       * include/cpplib.h (enum CPP_DO_task): New enum.
+       (cpp_directive_only_preprocess): Declare.
+       * internal.h (_cpp_dir_only_callbacks): Delete.
+       (_cpp_preprocess_dir_only): Delete.
+       * lex.c (do_peek_backslask, do_peek_next, do_peek_prev): New.
+       (cpp_directives_only_process): New implementation.
+
+2020-02-14  Jakub Jelinek  <jakub@redhat.com>
+
+       Partially implement P1042R1: __VA_OPT__ wording clarifications
+       PR preprocessor/92319
+       * macro.c (expand_arg): Move declarations before vaopt_state
+       definition.
+       (class vaopt_state): Move enum update_type definition earlier.  Remove
+       m_allowed member, add m_arg and m_update members.
+       (vaopt_state::vaopt_state): Change last argument from bool any_args
+       to macro_arg *arg, initialize m_arg and m_update instead of m_allowed.
+       (vaopt_state::update): When bumping m_state from 1 to 2 and m_update
+       is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING
+       tokens and set m_update to INCLUDE if it has any, DROP otherwise.
+       Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2.
+       (replace_args, create_iso_definition): Adjust last argument to
+       vaopt_state ctor.
+
+2020-02-05  Martin Sebor  <msebor@redhat.com>
+
+       * include/cpplib.h (cpp_builtin_type): Remove trailing comma to
+       avoid pedantic warnings in C++ 98 mode.
+
 2020-02-04  Jakub Jelinek  <jakub@redhat.com>
 
+       * macro.c (builtin_has_include): Diagnose __has_include* use outside
+       of preprocessing directives.
+
        PR preprocessor/93545
        * macro.c (cpp_get_token_no_padding): New function.
        (builtin_has_include): Use it instead of cpp_get_token.  Don't check