summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-18 18:18:53 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-18 18:18:53 +0000
commit6590374032917a56a1deeba67ec41eba8352c448 (patch)
tree98d859ebb844e06678e3fb9aac38916946385743 /gcc
parent662dbd74b585e51f1122156511fab4016bc15fe7 (diff)
downloadgcc-6590374032917a56a1deeba67ec41eba8352c448.tar.gz
* gimplify.c (gimplify_modify_expr_rhs) <COND_EXPR>: Gimplify the LHS
using the is_gimple_lvalue predicate instead of is_gimple_min_lval. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134442 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gimplify.c2
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gnat.dg/dynamic_elab1.adb20
-rw-r--r--gcc/testsuite/gnat.dg/dynamic_elab1.ads12
-rw-r--r--gcc/testsuite/gnat.dg/dynamic_elab2.adb20
-rw-r--r--gcc/testsuite/gnat.dg/dynamic_elab2.ads13
-rw-r--r--gcc/testsuite/gnat.dg/dynamic_elab_pkg.ads10
8 files changed, 87 insertions, 1 deletions
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 <ebotcazou@adacore.com>
+
+ * gimplify.c (gimplify_modify_expr_rhs) <COND_EXPR>: Gimplify the LHS
+ using the is_gimple_lvalue predicate instead of is_gimple_min_lval.
+
2008-04-18 Tom Tromey <tromey@redhat.com>
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 <ebotcazou@adacore.com>
+
+ * 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 <kris.van.hees@oracle.com>
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;