summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0161-gimple.c-walk_gimple_op-GIMPLE_CALL-Fix-couple-of-ov.patch
blob: 64e797835a4f0c14cc8c6c72f0df0006e961bea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Upstream-Status: Inappropriate [Backport]
From 20a8b6ba99d25394d9d4b958a8ecc171fe3d263b Mon Sep 17 00:00:00 2001
From: ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 21 Apr 2011 14:18:54 +0000
Subject: [PATCH 161/200] 	* gimple.c (walk_gimple_op) <GIMPLE_CALL>: Fix couple of oversights.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172829 138bc75d-0d04-0410-961f-82ee72b054a4

index e60dc92..9a94f06 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -1405,7 +1405,8 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
       for (i = 0; i < gimple_call_num_args (stmt); i++)
 	{
 	  if (wi)
-	    wi->val_only = is_gimple_reg_type (gimple_call_arg (stmt, i));
+	    wi->val_only
+	      = is_gimple_reg_type (TREE_TYPE (gimple_call_arg (stmt, i)));
 	  ret = walk_tree (gimple_call_arg_ptr (stmt, i), callback_op, wi,
 			   pset);
 	  if (ret)
@@ -1417,7 +1418,8 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
 	  if (wi)
 	    {
 	      wi->is_lhs = true;
-	      wi->val_only = is_gimple_reg_type (gimple_call_lhs (stmt));
+	      wi->val_only
+		= is_gimple_reg_type (TREE_TYPE (gimple_call_lhs (stmt)));
 	    }
 
 	  ret = walk_tree (gimple_call_lhs_ptr (stmt), callback_op, wi, pset);
new file mode 100644
index 0000000..24527a5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/volatile5.adb
@@ -0,0 +1,16 @@
+-- { dg-do compile }
+
+with Volatile5_Pkg; use Volatile5_Pkg;
+
+procedure Volatile5 is
+
+   A : Rec;
+
+   procedure Proc is
+   begin
+      A := F;
+   end;
+
+begin
+   Proc;
+end;
diff --git a/gcc/testsuite/gnat.dg/volatile5_pkg.ads b/gcc/testsuite/gnat.dg/volatile5_pkg.ads
new file mode 100644
index 0000000..71a0c80
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/volatile5_pkg.ads
@@ -0,0 +1,11 @@
+package Volatile5_Pkg is
+
+   type Rec is record
+      I : Integer;
+   end record;
+   pragma Volatile(Rec);
+
+  function F return Rec;
+
+end Volatile5_Pkg;
+-- 
\ No newline at end of file
-- 
1.7.0.4

OpenPOWER on IntegriCloud