aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-10-17 22:21:24 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-10-17 22:21:24 +0000
commitd79c2936cbfadddc0928df9df1353613b708febf (patch)
tree42da3018f900469fdb1aa9419abc4b5c4af439c0 /gcc
parent79ddec0279508bee9a68b640a9633d874b06ac4a (diff)
downloadgcc-d79c2936cbfadddc0928df9df1353613b708febf.zip
gcc-d79c2936cbfadddc0928df9df1353613b708febf.tar.gz
gcc-d79c2936cbfadddc0928df9df1353613b708febf.tar.bz2
tree-nested.c (convert_nonlocal_reference_stmt): New case.
* tree-nested.c (convert_nonlocal_reference_stmt) <GIMPLE_COND>: New case. Force using values to replace references within the statement. (convert_local_reference_stmt): Likewise. From-SVN: r152960
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gnat.dg/nested_proc1.adb (renamed from gcc/testsuite/gnat.dg/nested_proc.adb)2
-rw-r--r--gcc/testsuite/gnat.dg/nested_proc2.adb30
-rw-r--r--gcc/tree-nested.c12
5 files changed, 55 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c05cc6d..d4eb66f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+ * tree-nested.c (convert_nonlocal_reference_stmt) <GIMPLE_COND>: New
+ case. Force using values to replace references within the statement.
+ (convert_local_reference_stmt): Likewise.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
* gimple-low.c (lower_stmt) <GIMPLE_CALL>: If the call is noreturn,
remove a subsequent GOTO or RETURN statement.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 62f8075..168123f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+ * gnat.dg/nested_proc.adb: Rename into...
+ * gnat.dg/nested_proc1.adb: ...this.
+ * gnat.dg/nested_proc2.adb: New test.
+
+2009-10-17 Eric Botcazou <ebotcazou@adacore.com>
+
* gnat.dg/noreturn1.ad[sb]: New test.
2009-10-17 Janus Weil <janus@gcc.gnu.org>
diff --git a/gcc/testsuite/gnat.dg/nested_proc.adb b/gcc/testsuite/gnat.dg/nested_proc1.adb
index 144533c..b3abf26 100644
--- a/gcc/testsuite/gnat.dg/nested_proc.adb
+++ b/gcc/testsuite/gnat.dg/nested_proc1.adb
@@ -2,7 +2,7 @@
-- Test that a static link is correctly passed to a subprogram which is
-- indirectly called through an aggregate.
-procedure Nested_Proc is
+procedure Nested_Proc1 is
I : Integer := 0;
diff --git a/gcc/testsuite/gnat.dg/nested_proc2.adb b/gcc/testsuite/gnat.dg/nested_proc2.adb
new file mode 100644
index 0000000..b534956
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/nested_proc2.adb
@@ -0,0 +1,30 @@
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+
+procedure Nested_Proc2 is
+
+ type Arr is array(1..2) of Integer;
+
+ type Rec is record
+ Data : Arr;
+ end record;
+
+ From : Rec;
+ Index : Integer;
+
+ function F (X : Arr) return Integer is
+ begin
+ return 0;
+ end;
+
+ procedure Test is
+ begin
+ Index := F (From.Data);
+ If Index /= 0 then
+ raise Program_Error;
+ end if;
+ end;
+
+begin
+ Test;
+end;
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 706571c..0b5e732 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1307,6 +1307,12 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
*handled_ops_p = false;
return NULL_TREE;
+ case GIMPLE_COND:
+ wi->val_only = true;
+ wi->is_lhs = false;
+ *handled_ops_p = false;
+ return NULL_TREE;
+
default:
/* For every other statement that we are not interested in
handling here, let the walker traverse the operands. */
@@ -1707,6 +1713,12 @@ convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
info, gimple_omp_body (stmt));
break;
+ case GIMPLE_COND:
+ wi->val_only = true;
+ wi->is_lhs = false;
+ *handled_ops_p = false;
+ return NULL_TREE;
+
default:
/* For every other statement that we are not interested in
handling here, let the walker traverse the operands. */