From 4a9206ce4a426add4b27afebb24a6e8fa0e392bd Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 28 Jun 2011 21:50:06 +0000 Subject: [PATCH] * tree-ssa-dom.c (initialize_hash_element): Fix oversight. From-SVN: r175600 --- gcc/ChangeLog | 19 ++++++++++++------- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/opt17.adb | 13 +++++++++++++ gcc/testsuite/gnat.dg/opt17.ads | 7 +++++++ gcc/tree-ssa-dom.c | 1 + 5 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/opt17.adb create mode 100644 gcc/testsuite/gnat.dg/opt17.ads diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 00991f77d93..588a0b586eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-06-28 Eric Botcazou + + * tree-ssa-dom.c (initialize_hash_element): Fix oversight. + 2011-06-28 Rainer Orth * config/sparc/sol2-64.h (TARGET_DEFAULT): Remove. @@ -122,8 +126,8 @@ 2011-06-27 Jan Hubicka - * ipa.c (cgraph_address_taken_from_non_vtable_p): Walk references of node - instead of references in node. + * ipa.c (cgraph_address_taken_from_non_vtable_p): Walk references of + node instead of references in node. 2011-06-27 Richard Henderson @@ -359,13 +363,14 @@ PR tree-optimize/49373 * tree-pass.h (all_late_ipa_passes): Declare. * cgraphunit.c (init_lowered_empty_function): Fix properties. - (cgraph_optimize): Execute late passes; remove unreachable funcions after - materialization. - * ipa-inline.c (gate_ipa_inline): Enable only when optimizing or LTOing. + (cgraph_optimize): Execute late passes; remove unreachable funcions + after materialization. + * ipa-inline.c (gate_ipa_inline): Enable only when optimizing or + LTOing. * passes.c (all_late_ipa_passes): Declare. (dump_passes, register_pass): Handle late ipa passes. - (init_optimization_passes): Move ipa_pta to late passes; schedule fixup_cfg - at beggining of all_passes. + (init_optimization_passes): Move ipa_pta to late passes; schedule + fixup_cfg at beggining of all_passes. (apply_ipa_transforms): New function. (execute_one_pass): When doing simple ipa pass, apply all transforms. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3139ebafda5..46419f307fd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-06-28 Eric Botcazou + + * gnat.dg/opt17.ad[sb]: New test. + 2011-06-28 Janis Johnson Tom de Vries diff --git a/gcc/testsuite/gnat.dg/opt17.adb b/gcc/testsuite/gnat.dg/opt17.adb new file mode 100644 index 00000000000..361f7607b88 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt17.adb @@ -0,0 +1,13 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +package body Opt17 is + + function Func return S is + V : String (1 .. 6); + begin + V (1 .. 3) := "ABC"; + return V (1 .. 5); + end; + +end Opt17; diff --git a/gcc/testsuite/gnat.dg/opt17.ads b/gcc/testsuite/gnat.dg/opt17.ads new file mode 100644 index 00000000000..601c2f201c8 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt17.ads @@ -0,0 +1,7 @@ +package Opt17 is + + subtype S is String (1 .. 5); + + function Func return S; + +end Opt17; diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index f41d7eca562..bbfe0bc8338 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -214,6 +214,7 @@ initialize_hash_element (gimple stmt, tree lhs, { case GIMPLE_SINGLE_RHS: expr->kind = EXPR_SINGLE; + expr->type = TREE_TYPE (gimple_assign_lhs (stmt)); expr->ops.single.rhs = gimple_assign_rhs1 (stmt); break; case GIMPLE_UNARY_RHS: -- 2.30.2