From ed3444e90132848d00d21f901ea1626d3af8b499 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 18 Apr 2008 18:18:53 +0000 Subject: [PATCH] gimplify.c (gimplify_modify_expr_rhs): Gimplify the LHS using the is_gimple_lvalue predicate instead of is_gimple_min_lval. * gimplify.c (gimplify_modify_expr_rhs) : Gimplify the LHS using the is_gimple_lvalue predicate instead of is_gimple_min_lval. From-SVN: r134442 --- gcc/ChangeLog | 5 +++++ gcc/gimplify.c | 2 +- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gnat.dg/dynamic_elab1.adb | 20 ++++++++++++++++++++ gcc/testsuite/gnat.dg/dynamic_elab1.ads | 12 ++++++++++++ gcc/testsuite/gnat.dg/dynamic_elab2.adb | 20 ++++++++++++++++++++ gcc/testsuite/gnat.dg/dynamic_elab2.ads | 13 +++++++++++++ gcc/testsuite/gnat.dg/dynamic_elab_pkg.ads | 10 ++++++++++ 8 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gnat.dg/dynamic_elab1.adb create mode 100644 gcc/testsuite/gnat.dg/dynamic_elab1.ads create mode 100644 gcc/testsuite/gnat.dg/dynamic_elab2.adb create mode 100644 gcc/testsuite/gnat.dg/dynamic_elab2.ads create mode 100644 gcc/testsuite/gnat.dg/dynamic_elab_pkg.ads diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 81d4f5d1ea2..c3296981345 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-04-18 Eric Botcazou + + * gimplify.c (gimplify_modify_expr_rhs) : Gimplify the LHS + using the is_gimple_lvalue predicate instead of is_gimple_min_lval. + 2008-04-18 Tom Tromey PR libcpp/15500: diff --git a/gcc/gimplify.c b/gcc/gimplify.c index cc9fd1505ec..52f63c1fc0d 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3636,7 +3636,7 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p, tree result = *to_p; ret = gimplify_expr (&result, pre_p, post_p, - is_gimple_min_lval, fb_lvalue); + is_gimple_lvalue, fb_lvalue); if (ret != GS_ERROR) ret = GS_OK; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e839cde8630..3ef066ad9e4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-04-18 Eric Botcazou + + * gnat.dg/dynamic_elab_pkg.ads: New helper. + * gnat.dg/dynamic_elab1.ad[sb]: New test. + * gnat.dg/dynamic_elab2.ad[sb]: Likewise. + 2008-04-18 Kris Van Hees Tests for char16_t and char32_t support. diff --git a/gcc/testsuite/gnat.dg/dynamic_elab1.adb b/gcc/testsuite/gnat.dg/dynamic_elab1.adb new file mode 100644 index 00000000000..88f76688c17 --- /dev/null +++ b/gcc/testsuite/gnat.dg/dynamic_elab1.adb @@ -0,0 +1,20 @@ +-- { dg-do compile } +-- { dg-options "-gnatE" } + +package body Dynamic_Elab1 is + + function Get_Plot return Plot is + + procedure Fill (X : out Plot) is + begin + X.Data := Get_R; + end; + + X : Plot; + + begin + Fill(X); + return X; + end; + +end Dynamic_Elab1; diff --git a/gcc/testsuite/gnat.dg/dynamic_elab1.ads b/gcc/testsuite/gnat.dg/dynamic_elab1.ads new file mode 100644 index 00000000000..c241e54cca6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/dynamic_elab1.ads @@ -0,0 +1,12 @@ +with Dynamic_Elab_Pkg; use Dynamic_Elab_Pkg; + +package Dynamic_Elab1 is + + type Plot is record + Data : R; + end record; + pragma Pack (Plot); + + function Get_Plot return Plot; + +end Dynamic_Elab1; diff --git a/gcc/testsuite/gnat.dg/dynamic_elab2.adb b/gcc/testsuite/gnat.dg/dynamic_elab2.adb new file mode 100644 index 00000000000..138d130c747 --- /dev/null +++ b/gcc/testsuite/gnat.dg/dynamic_elab2.adb @@ -0,0 +1,20 @@ +-- { dg-do compile } +-- { dg-options "-gnatE" } + +package body Dynamic_Elab2 is + + function Get_Plot return Plot is + + procedure Fill (X : out Plot) is + begin + X.Data := Get_R; + end; + + X : Plot; + + begin + Fill(X); + return X; + end; + +end Dynamic_Elab2; diff --git a/gcc/testsuite/gnat.dg/dynamic_elab2.ads b/gcc/testsuite/gnat.dg/dynamic_elab2.ads new file mode 100644 index 00000000000..9191dabd549 --- /dev/null +++ b/gcc/testsuite/gnat.dg/dynamic_elab2.ads @@ -0,0 +1,13 @@ +with Dynamic_Elab_Pkg; use Dynamic_Elab_Pkg; + +package Dynamic_Elab2 is + + type Plot is record + B : Boolean; + Data : R; + end record; + pragma Pack (Plot); + + function Get_Plot return Plot; + +end Dynamic_Elab2; diff --git a/gcc/testsuite/gnat.dg/dynamic_elab_pkg.ads b/gcc/testsuite/gnat.dg/dynamic_elab_pkg.ads new file mode 100644 index 00000000000..2e2574f3495 --- /dev/null +++ b/gcc/testsuite/gnat.dg/dynamic_elab_pkg.ads @@ -0,0 +1,10 @@ +package Dynamic_Elab_Pkg is + + type R is record + Code : Integer; + Val : Boolean; + end record; + + function Get_R return R; + +end Dynamic_Elab_Pkg; -- 2.30.2