Commit d79c2936 by Eric Botcazou Committed by Eric Botcazou

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
parent 79ddec02
2009-10-17 Eric Botcazou <ebotcazou@adacore.com> 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, * gimple-low.c (lower_stmt) <GIMPLE_CALL>: If the call is noreturn,
remove a subsequent GOTO or RETURN statement. remove a subsequent GOTO or RETURN statement.
2009-10-17 Eric Botcazou <ebotcazou@adacore.com> 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. * gnat.dg/noreturn1.ad[sb]: New test.
2009-10-17 Janus Weil <janus@gcc.gnu.org> 2009-10-17 Janus Weil <janus@gcc.gnu.org>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-- Test that a static link is correctly passed to a subprogram which is -- Test that a static link is correctly passed to a subprogram which is
-- indirectly called through an aggregate. -- indirectly called through an aggregate.
procedure Nested_Proc is procedure Nested_Proc1 is
I : Integer := 0; I : Integer := 0;
......
-- { 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;
...@@ -1307,6 +1307,12 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, ...@@ -1307,6 +1307,12 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
*handled_ops_p = false; *handled_ops_p = false;
return NULL_TREE; return NULL_TREE;
case GIMPLE_COND:
wi->val_only = true;
wi->is_lhs = false;
*handled_ops_p = false;
return NULL_TREE;
default: default:
/* For every other statement that we are not interested in /* For every other statement that we are not interested in
handling here, let the walker traverse the operands. */ handling here, let the walker traverse the operands. */
...@@ -1707,6 +1713,12 @@ convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, ...@@ -1707,6 +1713,12 @@ convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
info, gimple_omp_body (stmt)); info, gimple_omp_body (stmt));
break; break;
case GIMPLE_COND:
wi->val_only = true;
wi->is_lhs = false;
*handled_ops_p = false;
return NULL_TREE;
default: default:
/* For every other statement that we are not interested in /* For every other statement that we are not interested in
handling here, let the walker traverse the operands. */ handling here, let the walker traverse the operands. */
......
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