OSDN Git Service

PR middle-end/36125
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Nov 2008 07:50:52 +0000 (07:50 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Nov 2008 07:50:52 +0000 (07:50 +0000)
* function.c (gimplify_parameters): For callee copies parameters,
move TREE_ADDRESSABLE flag from the PARM_DECL to the local copy.

* gcc.c-torture/compile/pr36125.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141848 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/function.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr36125.c [new file with mode: 0644]

index a01c06e..55afd9c 100644 (file)
@@ -1,3 +1,9 @@
+2008-11-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/36125
+       * function.c (gimplify_parameters): For callee copies parameters,
+       move TREE_ADDRESSABLE flag from the PARM_DECL to the local copy.
+
 2008-11-13  Thomas Schwinge  <tschwinge@gnu.org>
 
        PR target/28102
index b40b0db..233ff6d 100644 (file)
@@ -3265,6 +3265,14 @@ gimplify_parameters (void)
                {
                  local = create_tmp_var (type, get_name (parm));
                  DECL_IGNORED_P (local) = 0;
+                 /* If PARM was addressable, move that flag over
+                    to the local copy, as its address will be taken,
+                    not the PARMs.  */
+                 if (TREE_ADDRESSABLE (parm))
+                   {
+                     TREE_ADDRESSABLE (parm) = 0;
+                     TREE_ADDRESSABLE (local) = 1;
+                   }
                }
              else
                {
index 898aaf2..bea2964 100644 (file)
@@ -1,3 +1,8 @@
+2008-11-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/36125
+       * gcc.c-torture/compile/pr36125.c: New test.
+
 2008-11-13  Jason Merrill  <jason@redhat.com>
 
        PR c++/37932
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr36125.c b/gcc/testsuite/gcc.c-torture/compile/pr36125.c
new file mode 100644 (file)
index 0000000..9257e84
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR middle-end/36125 */
+
+extern void bar (long double *);
+
+int
+foo (long double x)
+{
+  bar (&x);
+  return 0;
+}