* gimple.c (walk_gimple_op) <GIMPLE_CALL>: Fix couple of oversights.
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 21 Apr 2011 14:15:51 +0000 (14:15 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 21 Apr 2011 14:15:51 +0000 (14:15 +0000)
From-SVN: r172828

gcc/ChangeLog
gcc/gimple.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/volatile5.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/volatile5_pkg.ads [new file with mode: 0644]

index f52081501bf0b03f9f65ffe02d637f2b32d118f5..34492bba7a871cd1096feced5e0a550f99607a00 100644 (file)
@@ -1,3 +1,7 @@
+2011-04-21  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gimple.c (walk_gimple_op) <GIMPLE_CALL>: Fix couple of oversights.
+
 2011-04-21  Richard Guenther  <rguenther@suse.de>
 
        * Makefile.in (site.exp): Do not use tmp0 but site.tmp as temporary
index 909091bcfd032dfdd36dcad9a804552017d67cb7..0d28c1b2738fc156db8b48f107c1b88e3cb6dc7b 100644 (file)
@@ -1464,7 +1464,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)
@@ -1476,7 +1477,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);
index 531984693452d17d6599dd0d4ffe9c1bd365ab1d..89541bad74185473eed0adb28db3abc6b328407b 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-21  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/volatile5.adb: New test.
+       * gnat.dg/volatile5_pkg.ads: New helper.
+
 2011-04-21  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/48708
diff --git a/gcc/testsuite/gnat.dg/volatile5.adb b/gcc/testsuite/gnat.dg/volatile5.adb
new file mode 100644 (file)
index 0000000..24527a5
--- /dev/null
@@ -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 (file)
index 0000000..71a0c80
--- /dev/null
@@ -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