Commit 4679504c by Uros Bizjak

re PR rtl-optimization/36006 (invalid rtl sharing with -O2)

        PR rtl-optimization/36006
        * expmed.c (store_fixed_bit_field): Copy op0 rtx before moving
        temp to op0 in order to avoid invalid rtx sharing.

testsuite/ChangeLog:

        PR rtl-optimization/36006
        * gfortran.dg/pr36006-1.f90: New test.
        * gfortran.dg/pr36006-2.f90: Ditto.

From-SVN: r134618
parent 6412ecdc
2008-04-24 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/36006
* expmed.c (store_fixed_bit_field): Copy op0 rtx before moving
temp to op0 in order to avoid invalid rtx sharing.
2008-04-23 Paolo Bonzini <bonzini@gnu.org> 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
* tree-cfg.c (verify_expr): Check with is_gimple_address. Don't * tree-cfg.c (verify_expr): Check with is_gimple_address. Don't
...@@ -74,37 +80,25 @@ ...@@ -74,37 +80,25 @@
2008-04-22 Tomas Bily <tbily@suse.cz> 2008-04-22 Tomas Bily <tbily@suse.cz>
* tree-cfg.c (verify_expr): Check for NON_LVALUE_EXPR as unreachable * tree-cfg.c (verify_expr): Check for NON_LVALUE_EXPR as
case. unreachable case.
* tree-vrp.c (extract_range_from_unary_expr): Removed unused
* tree-vrp.c (extract_range_from_unary_expr): Removed unused NON_LVALUE_EXPR.
NON_LVALUE_EXPR. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
* tree-ssa-structalias.c (get_constraint_for): Likewise.
* tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-inline.c (estimate_num_insns_1): Likewise.
* varasm.c (const_hash_1, compare_constant, copy_constant)
* tree-ssa-structalias.c (get_constraint_for): Likewise. (compute_reloc_for_constant, output_addressed_constants): Likewise.
* emit-rtl.c (component_ref_for_mem_expr)
* tree-inline.c (estimate_num_insns_1): Likewise. (set_mem_attributes_minus_bitpos): Likewise.
* expr.c (highest_pow2_factor, expand_expr_real_1, )
* varasm.c (const_hash_1, compare_constant, copy_constant) (is_aligning_offset): Likewise.
(compute_reloc_for_constant, output_addressed_constants): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1, add_bound_info): Likewise.
* tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Likewise.
* emit-rtl.c (component_ref_for_mem_expr) * dojump.c (do_jump): Likewise.
(set_mem_attributes_minus_bitpos): Likewise. * builtins.c (get_pointer_alignment, get_memory_rtx)
(integer_valued_real_p, fold_builtin_next_arg): Likewise.
* expr.c (highest_pow2_factor, expand_expr_real_1, ) * tree-scalar-evolution.c (instantiate_parameters_1): Likewise.
(is_aligning_offset): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1, add_bound_info): Likewise.
* tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Likewise.
* dojump.c (do_jump): Likewise.
* builtins.c (get_pointer_alignment, get_memory_rtx)
(integer_valued_real_p, fold_builtin_next_arg): Likewise.
* tree-scalar-evolution.c (instantiate_parameters_1): Likewise.
2008-04-23 Jakub Jelinek <jakub@redhat.com> 2008-04-23 Jakub Jelinek <jakub@redhat.com>
...@@ -250,7 +244,7 @@ ...@@ -250,7 +244,7 @@
df_entry_block_defs_collect, df_exit_block_uses_collect): df_entry_block_defs_collect, df_exit_block_uses_collect):
Added mode parameter to calls to df_ref_record, df_uses_record, Added mode parameter to calls to df_ref_record, df_uses_record,
df_ref_create_structure. df_ref_create_structure.
(df_ref_equal_p, df_ref_compare): Added test for modes. (df_ref_equal_p, df_ref_compare): Added test for modes.
(df_ref_create_structure): Added code to set mode. Renamed (df_ref_create_structure): Added code to set mode. Renamed
DF_REF_WIDTH and DF_REF_OFFSET to DF_REF_EXTRACT_WIDTH and DF_REF_WIDTH and DF_REF_OFFSET to DF_REF_EXTRACT_WIDTH and
DF_REF_EXTRACT_OFFSET. DF_REF_EXTRACT_OFFSET.
......
...@@ -976,7 +976,10 @@ store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset, ...@@ -976,7 +976,10 @@ store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset,
} }
if (op0 != temp) if (op0 != temp)
emit_move_insn (op0, temp); {
op0 = copy_rtx (op0);
emit_move_insn (op0, temp);
}
} }
/* Store a bit field that is split across multiple accessible memory objects. /* Store a bit field that is split across multiple accessible memory objects.
......
2008-04-24 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR rtl-optimization/36006
* gfortran.dg/pr36006-1.f90: New test.
* gfortran.dg/pr36006-2.f90: Ditto.
2008-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2008-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35994 PR fortran/35994
! { dg-do compile }
!
subroutine test4
integer, parameter :: wp = 4
complex(wp), parameter :: i = (0._wp, 1._wp)
complex(wp) :: c(12)
integer :: m, N
N = 12
c = (/(exp(i*m),m=1,N)/)
print *, c(1)
end
subroutine test8
integer, parameter :: wp = 8
complex(wp), parameter :: i = (0._wp, 1._wp)
complex(wp) :: c(12)
integer :: m, N
N = 12
c = (/(exp(i*m),m=1,N)/)
print *, c(1)
end
! { dg-do compile }
! { dg-require-effective-target fortran_large_real }
!
subroutine test_large
integer, parameter :: wp = selected_real_kind (precision (0.0_8) + 1)
complex(wp), parameter :: i = (0._wp, 1._wp)
complex(wp) :: c(12)
integer :: m, N
N = 12
c = (/(exp(i*m),m=1,N)/)
print *, c(1)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment