mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 15:11:08 +08:00
re PR tree-optimization/60895 (error: address taken, but ADDRESSABLE bit not set)
2014-04-23 Richard Biener <rguenther@suse.de> PR middle-end/60895 * tree-inline.c (declare_return_variable): Use mark_addressable. * g++.dg/torture/pr60895.C: New testcase. From-SVN: r209675
This commit is contained in:
parent
92562f8869
commit
62ba699e01
@ -1,3 +1,8 @@
|
||||
2014-04-23 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/60895
|
||||
* tree-inline.c (declare_return_variable): Use mark_addressable.
|
||||
|
||||
2014-04-23 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/60891
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-04-23 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/60895
|
||||
* g++.dg/torture/pr60895.C: New testcase.
|
||||
|
||||
2014-04-23 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/60891
|
||||
|
32
gcc/testsuite/g++.dg/torture/pr60895.C
Normal file
32
gcc/testsuite/g++.dg/torture/pr60895.C
Normal file
@ -0,0 +1,32 @@
|
||||
// { dg-do compile }
|
||||
|
||||
struct C
|
||||
{
|
||||
double elems[3];
|
||||
};
|
||||
|
||||
C
|
||||
foo ()
|
||||
{
|
||||
C a;
|
||||
double *f = a.elems;
|
||||
int b;
|
||||
for (; b;)
|
||||
{
|
||||
*f = 0;
|
||||
++f;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
struct J
|
||||
{
|
||||
C c;
|
||||
__attribute__((always_inline)) J () : c (foo ()) {}
|
||||
};
|
||||
|
||||
void
|
||||
bar ()
|
||||
{
|
||||
J ();
|
||||
}
|
@ -3120,7 +3120,8 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
|
||||
{
|
||||
var = return_slot;
|
||||
gcc_assert (TREE_CODE (var) != SSA_NAME);
|
||||
TREE_ADDRESSABLE (var) |= TREE_ADDRESSABLE (result);
|
||||
if (TREE_ADDRESSABLE (result))
|
||||
mark_addressable (var);
|
||||
}
|
||||
if ((TREE_CODE (TREE_TYPE (result)) == COMPLEX_TYPE
|
||||
|| TREE_CODE (TREE_TYPE (result)) == VECTOR_TYPE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user