diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a01c06e5c390..55afd9c9d3c9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-11-14 Jakub Jelinek + + 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 PR target/28102 diff --git a/gcc/function.c b/gcc/function.c index b40b0dbff966..233ff6d09b5d 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -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 { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 898aaf241503..bea2964c3733 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-11-14 Jakub Jelinek + + PR middle-end/36125 + * gcc.c-torture/compile/pr36125.c: New test. + 2008-11-13 Jason Merrill 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 index 000000000000..9257e84680a2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr36125.c @@ -0,0 +1,10 @@ +/* PR middle-end/36125 */ + +extern void bar (long double *); + +int +foo (long double x) +{ + bar (&x); + return 0; +}