2000-07-08 Toon Moene <toon@moene.indiv.nluug.nl>
* fold-const.c (extract_muldiv) case PLUS_EXPR, MINUS_EXPR:
Check whether c divides op1 exactly if operation is not
multiplication.
From-SVN: r34928
* cpplib.h (struct cpp_name): Now struct cpp_string.
(CPP_INT, CPP_FLOAT, CPP_NUMBER, CPP_COMMENT,
CPP_HEADER_NAME): Change to type S.
(struct cpp_token): Rename 'name' field to 'str'. Add 'node'
field, a cpp_hashnode *. All references to val.name updated
to use val.str or val.node as appropriate.
(struct cpp_reader): Add spec_nodes field.
(cpp_idcmp): Now cpp_ideq; takes a token * and a char *.
* cpphash.h (struct spec_nodes): New.
(enum spell_type): Reorder. Only SPELL_STRING tokens use
val.str. All references to 'spelling > SPELL_NONE' updated to
match.
(CPP_IN_SYSTEM_HEADER): Check pfile->buffer and
pfile->buffer->inc are not NULL before dereferencing them.
* cpplex.c (parse_name): Take a pointer to the current token,
plus current position and limit as args; return the new
position; don't copy the text of a name into the string
buffer, instead call cpp_lookup and store the node pointer.
If extending a token, copy out the text of the old into a
scratch buffer, append the new, look that up and store the new
node pointer. Inline.
(maybe_paste_with_next): If the result of paste is a NAME,
then look up the pasted text and store its node pointer.
(lex_line): Adjust for new parse_name interface.
Check for L"str", L'str' using spec_nodes->n_L.
(spell_token): SPELL_IDENT tokens have their spelling in
val.node->name. Handle SPELL_STRING tokens that don't have
string delimiters.
(_cpp_expand_name_space,
(can_paste): Check for L ## "str" using spec_nodes->n_L.
(cpp_get_token, special_symbol): No need to call cpp_lookup.
(cpp_idcmp): Now cpp_ideq; take a token * and a const char *;
return 1=equal 0=not, not a tristate.
* cpphash.c (var_args_str): Delete.
(find_param): Compare node fields directly.
(is__va_args__): Use CPP_PEDANTIC. Just compare
token->val.node with spec_nodes->n__VA_ARGS__.
(dump_funlike_macro): Don't use var_args_str.
* cpplib.c (_cpp_check_directive): Just walk through
spec_nodes->dirs comparing pointers.
(get_define_node, do_pragma_poison, detect_if_not_defined,
parse_ifdef): The identifier has already been looked up.
(do_ifdef, do_ifndef): parse_ifdef won't return a poisoned
node.
(do_if): Only call detect_if_not_defined at beginning of file.
(_cpp_parse_assertion): Only copy string pointers for
SPELL_STRING tokens.
(pragma_dispatch): Take a node pointer and examine its name
field.
(_cpp_init_stacks): Also initialize the spec_nodes structure.
* cppinit.c (cpp_reader_init): Call _cpp_init_stacks after
_cpp_init_macros.
(cpp_cleanup): Free pfile->spec_nodes. Call _cpp_cleanup_* in
reverse order from the corresponding _cpp_init_* routines.
* cppexp.c (parse_number, parse_charconst, parse_defined,
lex): Check val.node->type instead of calling cpp_defined.
Use spec_nodes entries where appropriate.
* fix-header.c, scan-decls.c: Update for interface changes.
From-SVN: r34926
2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
* jcf-write.c (generate_classfile): Properly install the
ConstantValue attribute and the initial value constant pool index
on string constants.
* parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
class files.
(http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00233.html)
From-SVN: r34921
* cpphash.c (is__va_args__): New function.
(count_params): Fix line reported in error messages. Use
is__va_args__. Don't return ')' on error. Flag GNU style
rest args macro definitions.
(parse_define): Check macro name is not __VA_ARGS__.
(save_expansion): Check identifier in non-varargs-macro is
not __VA_ARGS__. Don't flag GNU_VARARGS.
* cpplex.c (parse_args): Accept no argument iff GNU_REST_ARGS.
(maybe_paste_with_next): Use per-macro GNU_REST_ARGS rather
than per-token GNU_VARARGS.
* cpplib.h (GNU_VARARGS): Remove.
(GNU_REST_ARGS): New.
* gcc.dg/cpp/macsyntx.c: New tests.
From-SVN: r34919
2000-07-07 Benjamin Kosnik <bkoz@soma.redhat.com>
* configure.in (AC_OUTPUT_COMMANDS): Link $THREADS.h and
c++threads.h instead of copying.
* acinclude.m4 (GLIBCPP_ENABLE_THREADS): Do link here.
Tweaks.
From-SVN: r34918
2000-07-07 Benjamin Kosnik <bkoz@soma.redhat.com>
Clean up configure/build longstanding issues.
* src/Makefile.am (AC_CXXFLAGS): Don't set @SECTION_LDFLAGS@ here.
(CXXLINK): Add here, instead.
* Makefile.am (check-install): Make sure mkcheck has execute privs.
(check): Same here.
* configure.in (AC_OUTPUT_COMMANDS): Remove hacks here.
* configure.in (AC_OUTPUT_COMMANDS): Link c_io_libio.h and
c_io_libio.cc instead of copying.
* acinclude.m4 (GLIBCPP_ENABLE_CSTDIO): Do link here.
* configure.in (AC_OUTPUT_COMMANDS): Link $THREADS.h and
c++threads.h instead of copying.
* acinclude.m4 (GLIBCPP_ENABLE_THREADS): Do link here.
* config/c_io_libio.cc (__basic_file::_M_open_mode): Consolidate.
* bits/basic_file.h: Declare.
* mkcheck.in (TESTS_FILE): Use -v instead of --version.
From-SVN: r34917
* i386.md (call_pop, call, call_value_pop): Do not set
current_function_uses_pic_offset_table for calls to static
functions or indirect calls.
From-SVN: r34916
2000-07-07 Benjamin Kosnik <bkoz@soma.redhat.com>
Clean up configure/build longstanding issues.
* src/Makefile.am (AC_CXXFLAGS): Don't set @SECTION_LDFLAGS@ here.
(CXXLINK): Add here, instead.
* Makefile.am (check-install): Make sure mkcheck has execute privs.
(check): Same here.
* configure.in (AC_OUTPUT_COMMANDS): Remove hacks here.
* configure.in (AC_OUTPUT_COMMANDS): Link c_io_libio.h and
c_io_libio.cc instead of copying.
* acinclude.m4 (GLIBCPP_ENABLE_CSTDIO): Do link here.
* configure.in (AC_OUTPUT_COMMANDS): Link $THREADS.h and
c++threads.h instead of copying.
* acinclude.m4 (GLIBCPP_ENABLE_THREADS): Do link here.
From-SVN: r34914
* sibcall.c (uses_addressof): Add INMEM argument, check for
current_function_internal_arg_pointer outside of MEM rtxs in addition
to ADDRESSOFs.
(sequence_uses_addressof): Update caller.
* gcc.c-torture/execute/20000706-1.c: New test.
* gcc.c-torture/execute/20000706-2.c: New test.
* gcc.c-torture/execute/20000706-3.c: New test.
* gcc.c-torture/execute/20000706-4.c: New test.
* gcc.c-torture/execute/20000706-5.c: New test.
From-SVN: r34906
* system.h (UNION_INIT_ZERO): New macro for initializing union
members in structs.
* cpplex.c (placemarker_token, eof_token): Use UNION_INIT_ZERO.
From-SVN: r34904
2000-07-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
construct.
* parse.y (find_as_inner_class): Fixed typo.
(do_resolve_class): Explore enclosing contexts when searching for
innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
(check_inner_class_access): Check `decl' which can be null in case
of previous errors.
2000-07-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (java_debug_context): Declared `extern.'
(safe_layout_class): Likewise.
* parse.y (resolve_field_access): Field must be `static' in order
to be replaced by its initial value. Added comments.
(find_applicable_accessible_methods_list): Fixed typo.
(find_most_specific_methods_list): Methods found in innerclasses
take over methods founds in the enclosing contexts.
(java_complete_tree): Loosen restrictions on the type of DECLs
that can be replaced by their initialization values.
(valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p.'
(http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00184.html)
From-SVN: r34895
* tradcpp.c: New file.
* tradcif.y: New file.
* tradcif.c: New generated file.
* Makefile.in: Add rules to build tradcpp.o, tradcif.o,
$(srcdir)/tradcif.c. Add tradcpp to STAGESTUFF and
dependencies of C. Install tradcpp from install-common, in
$(libsubdir).
From-SVN: r34893
* cppinit.c: Include cppdefault.h. Refer to
cpp_GCC_INCLUDE_DIR and cpp_GCC_INCLUDE_DIR_len, not directly
to GCC_INCLUDE_DIR and its length.
(SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE,
USER_LABEL_PREFIX, REGISTER_PREFIX, struct default_include,
STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT): Move to
cppdefault.h.
(include_defaults_array): Move to cppdefault.c.
* cppdefault.h: New file.
* cppdefault.c: New file.
* Makefile.in (LIBCPP_OBJS): Add cppdefault.o.
(cppinit.o): Don't apply $(PREPROCESSOR_DEFINES) to this file.
(cppdefault.o): New rule; apply $(PREPROCESSOR_DEFINES) to
this file.
From-SVN: r34892