Jakub Jelinek [Wed, 1 Jun 2005 10:23:17 +0000 (12:23 +0200)]
re PR c/21536 (C99 array of variable length use causes segmentation fault)
PR c/21536
PR c/20760
* gimplify.c (gimplify_decl_expr): Call gimplify_type_sizes
on variable sizes types if a decl is a pointer to a VLA.
(gimplify_type_sizes): Handle POINTER_TYPE and REFERENCE_TYPE.
Call gimplify_type_sizes on aggregate fields. Prevent infinite
recursion.
Paul Thomas [Wed, 1 Jun 2005 07:18:20 +0000 (07:18 +0000)]
trans-expr.c (gfc_conv_variable): Clean up bracketting.
2005-06-01 Paul Thomas <pault@gcc.gnu.org>
* fortran/trans-expr.c (gfc_conv_variable): Clean up bracketting.
* fortran/trans-expr.c (gfc_conv_function_call): Insert spaces.
Correct comments and replace convert of integer_one_node with
build_int_cst.
* opts.h (cl_option_state): New structure.
(get_option_state): Declare.
* opts.c (get_option_state): New function.
* toplev.c (option_affects_pch_p): New function.
(default_get_pch_validity): Store the state of all options for which
option_affects_pch_p returns true.
(default_pch_valid_p): Check the state of those options here.
Only check target_flags separately if targetm.check_pch_target_Flags
is nonnull or if TARGET_SWITCHES is defined.
* config/rs6000/rs6000.md (sync_boolcshort_internal): New.
* config/rs6000/rs6000.c (rs6000_emit_sync): Shift count must
be complemented for big-endian. Mask for AND must be rotated,
not shifted. Handle short operands with NOT on the memory
operation.
DJ Delorie [Wed, 1 Jun 2005 00:20:13 +0000 (20:20 -0400)]
expr.c (convert_move): When a partial_int requires multiple conversion steps...
* expr.c (convert_move): When a partial_int requires multiple
conversion steps, make sure successive steps convert the
intermediate value, not the original value.
* expmed.c (expand_mult): Convert partial_int multiplies to
shift/add combinations too.
* genmodes.c (mode_data): Add wider_2x.
(calc_wider_mode): Calculate twice-wider mode too.
(emit_mode_wider): Emit twice-wider mode too.
* machmode.h (mode_2xwider, GET_MODE_2XWIDER_MODE): New.
* expr.c (expand_expr_real_1): Use it for expanding
multiplies.
Nathan Sidwell [Tue, 31 May 2005 17:43:26 +0000 (17:43 +0000)]
re PR c++/21165 (bogus error on a user-defined conversion in a template)
cp:
PR c++/21165
* init.c (integral_constant_value): Check the type of the
initializer, not the decl.
testsuite:
PR c++/21165
* g++.dg/template/init5.C: New.
Paul Thomas [Tue, 31 May 2005 17:39:03 +0000 (17:39 +0000)]
char_initialiser_actual.f90: Test character initialisers as actual arguments.
2005-05-30 Paul Thomas <pault@gcc.gnu.org>
* gfortran.dg/char_initialiser_actual.f90:
Test character initialisers as actual arguments.
* gfortran.dg/char_pointer_comp_assign.f90:
Test character pointer structure component assignments.
* gfortran.dg/char_array_structure_constructor.f90:
Test character components in structure constructors.
Paul Thomas [Tue, 31 May 2005 17:19:11 +0000 (17:19 +0000)]
re PR fortran/18109 (ICE with explicit array of strings)
2005-05-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/18109
PR fortran/18283
PR fortran/19107
* fortran/trans-array.c (gfc_conv_expr_descriptor): Obtain the
string length from the expression typespec character length value
and set temp_ss->stringlength and backend_decl. Obtain the
tree expression from gfc_conv_expr rather than gfc_conv_expr_val.
Dereference the expression to obtain the character.
* fortran/trans-expr.c (gfc_conv_component_ref): Remove the
dereference of scalar character pointer structure components.
* fortran/trans-expr.c (gfc_trans_subarray_assign): Obtain the
string length for the structure component from the component
expression.
Andrew Pinski [Tue, 31 May 2005 16:29:16 +0000 (16:29 +0000)]
re PR tree-optimization/21732 (-ftree-dump-all-details hangs during *.c.t24.copyprop or *.c.t38.copyprop2)
2005-05-31 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/21732
* tree-ssa-copy.c (dump_copy_of): Create a bitmap and don't visit a
SSA_NAME twice and cause the loop to become finite. Remove the test
for val.
tm.texi (TARGET_GET_PCH_VALIDITY, [...]): Tweak the documentation to make it more future-proof.
* doc/tm.texi (TARGET_GET_PCH_VALIDITY, TARGET_PCH_VALID_P): Tweak
the documentation to make it more future-proof.
(TARGET_CHECK_PCH_TARGET_FLAGS): Document this new hook.
* target.h (gcc_target): Add check_pch_target_flags.
* target-def.h (TARGET_CHECK_PCH_TARGET_FLAGS): New macro.
(TARGET_INITIALIZER): Include it.
* toplev.c (default_pch_valid_p): Use targetm.check_pch_target_flags.
* config/sh/sh.h (sh_pch_valid_p): Delete.
* config/sh/sh.c (TARGET_PCH_VALID_P, sh_pch_valid_p): Delete.
(sh_check_pch_target_flags): New function.
(TARGET_CHECK_PCH_TARGET_FLAGS): Override default.
Jeff Law [Tue, 31 May 2005 14:33:29 +0000 (08:33 -0600)]
fold-const.c (extract_array_ref): Handle more cases, do some useful canonicalization of the base.
* fold-const.c (extract_array_ref): Handle more cases,
do some useful canonicalization of the base.
(fold_binary): Explicitly deal with arrays of zero-sized
structures during folding of &a[i] == &a[j].
Roger Sayle [Mon, 30 May 2005 22:16:08 +0000 (22:16 +0000)]
gfortran.h (GFC_STD_LEGACY): New "standard" macro.
* gfortran.h (GFC_STD_LEGACY): New "standard" macro. Reindent.
* options.c (gfc_init_options): By default, allow legacy extensions
but warn about them.
(gfc_post_options): Make -pedantic warn about legacy extensions
even with -std=legacy.
(gfc_handle_option): Make -std=gnu follow the default behaviour
of warning about legacy extensions, but allowing them. Make the
new -std=legacy accept everything and warn about nothing.
* lang.opt (std=legacy): New F95 command line option.
* invoke.texi: Document both -std=f2003 and -std=legacy.
* gfortran.texi: Explain the two types of extensions and document
how they are affected by the various -std= command line options.
Roger Sayle [Mon, 30 May 2005 18:02:08 +0000 (18:02 +0000)]
re PR rtl-optimization/15422 (fmod loop exposes non-efficient code generation in reg-stack.c)
PR rtl-optimization/15422
* reg-stack.c (starting_stack_p): New static global.
(straighten_stack): Delete prototype. Change to update the stack
before the current insn.
(subst_stack_regs): Update call to straighten stack.
(emit_swap_insn): Delete prototype. For the first insn in a
basic block, update stack_in instead of emitting a real swap.
(change_stack): When changing the stack before the first insn
in a basic block, update stack_in instead of emitting real code.
(compensate_edges): Clear starting_stack_p during compensation.
(convert_regs_1): Keep track of starting_stack_p whilst processing
a basic block.
Kazu Hirata [Mon, 30 May 2005 02:12:42 +0000 (02:12 +0000)]
tree-outof-ssa.c (_elim_graph): Change the type of edge_list to VEC(int,heap)*.
* tree-outof-ssa.c (_elim_graph): Change the type of edge_list
to VEC(int,heap)*.
(new_elim_graph, clear_elim_graph, delete_elim_graph,
elim_graph_add_edge, elim_graph_remove_succ_edge,
FOR_EACH_ELIM_GRAPH_SUCC, FOR_EACH_ELIM_GRAPH_PRED): Use VEC
instead of VARRAY.
Paul Thomas [Sun, 29 May 2005 16:03:43 +0000 (16:03 +0000)]
char_pointer_assign.f90: Test character-pointerassignments and pointer assignments.
2005-05-29 Paul Thomas <pault@gcc.gnu.org>
* gfortran.dg/char_pointer_assign.f90:
Test character-pointerassignments and pointer assignments.
* gfortran.dg/char_pointer_dummy.f90:
Test character-pointer dummy arguments.
* gfortran.dg/char_pointer_func.f90:
Test character-pointer function returns.
* gfortran.dg/char_pointer_dependency.f90:
Test character-pointer functions with dependencies.
Paul Thomas [Sun, 29 May 2005 16:02:09 +0000 (16:02 +0000)]
re PR fortran/16939 (Pointers not passed as subroutine arguments)
2005-05-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/16939
PR fortran/17192
PR fortran/17193
PR fortran/17202
PR fortran/18689
PR fortran/18890
PR fortran/21297
* fortran/trans-array.c (gfc_conv_resolve_dependencies): Add string
length to temp_ss for character pointer array assignments.
* fortran/trans-expr.c (gfc_conv_variable): Correct errors in
dereferencing of characters and character pointers.
* fortran/trans-expr.c (gfc_conv_function_call): Provide string
length as return argument for various kinds of handling of return.
Return a char[]* temporary for character pointer functions and
dereference the temporary upon return.
Roger Sayle [Sun, 29 May 2005 15:37:44 +0000 (15:37 +0000)]
reg-stack.c (propagate_stack): Always copy the source stack to the destination.
* reg-stack.c (propagate_stack): Always copy the source stack to
the destination. This routine is now only called when this is safe.
(better_edge): New function split out from convert_regs_1 to
determine which of two edges is better to propagate across.
(convert_regs_1): We need only search for a best edge if the
stack layout hasn't been defined yet. Use better_edge to help
find beste. No longer traverse unnecessary edges.
Keith Besaw [Sun, 29 May 2005 13:14:42 +0000 (13:14 +0000)]
tree-ssa-alias.c (new_type_alias): New procedure to create a type memory tag for a pointer with a may-alias set...
2005-05-29 Keith Besaw <kbesaw@us.ibm.com>
* tree-ssa-alias.c (new_type_alias): New procedure to
create a type memory tag for a pointer with a may-alias
set determined from a variable declaration.
* tree-flow.h: export declaration of new_type_alias
* tree-optimize.c (init_tree_optimization_passes): document
that pass_may_alias cannot be called after pass_vectorize.
* tree-vect-transform (vect_create_data_ref_ptr): Call
new_type_alias when an type memory tag isn't available
for a reference.
(vectorizable_store): Use copy_virtual_operands to update
virtual defs in place (so that loop_version can be called).
Call mark_for_renaming for the virtual defs in case peeling
is done and virtual uses outside the loop need to be updated.
re PR libfortran/20006 ($ format extension doesn't work)
PR libfortran/20006
* io.c (format_item_1): Add check and extension warning for
$ edit descriptor.
* io/format.c (parse_format_list): Set repeat count of $ format
node to 1.
* io/transfer.c (read_sf): Add g.seen_dollar to the test
concerning advancing I/O.
(data_transfer_init): Likewise.
(finalize_transfer): Likewise.
Paolo Carlini [Sat, 28 May 2005 21:57:03 +0000 (21:57 +0000)]
revert: re PR libstdc++/19495 (basic_string::_M_rep() can produce an unnaturally aligned pointer to _Rep)
2005-05-28 Paolo Carlini <pcarlini@suse.de>
Revert:
2005-05-18 Paolo Carlini <pcarlini@suse.de>
Nathan Myers <ncm@cantrip.org>
PR libstdc++/19495
* include/bits/basic_string.h (_Raw_bytes_alloc): Rebind to
size_type instead of char and rename to _Raw_alloc.
* include/bits/basic_string.tcc (_Rep::_M_destroy, _Rep::_S_create):
Use the above.
* src/bitmap_allocator.cc: Add instantiation for size_type.
* src/mt_allocator.cc: Likewise.
* src/pool_allocator.cc: Likewise.
* include/ext/array_allocator.h: Tweak slightly, avoid assuming
the existence of an _Array::begin() and size() members.
* testsuite/ext/array_allocator/2.cc: Tweak to use an allocator
of size_type, instead of char, thus avoiding problems with
rebinds, not treated correctly by array_allocator.
* tree-ssa-threadupdate.c: (create_edge_and_update_destination_phis):
Update profile.
* value-prof.c (tree_divmod_fixed_value_transform): Be more verbose in
debug output.
(tree_mod_subtract): Fix profile updating code.
(tree_divmod_values_to_profile): Do not produce useless value profilers
for divisions.