Commit 61021c2c by Andrew Pinski Committed by Andrew Pinski

re PR middle-end/32940 (REG_POINTER attribute on DECL_ARTIFICIAL pointers)

2007-08-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/32940
        * cfgexpand.c  (expand_one_register_var): Mark pointer
        DECL_ARTIFICIAL as REG_POINTER also.
        * stmt.c (expand_decl): Likewise.

From-SVN: r127634
parent 001231ff
2007-08-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/32940
* cfgexpand.c (expand_one_register_var): Mark pointer
DECL_ARTIFICIAL as REG_POINTER also.
* stmt.c (expand_decl): Likewise.
2007-08-19 Daniel Berlin <dberlin@dberlin.org> 2007-08-19 Daniel Berlin <dberlin@dberlin.org>
Fix PR 32772 Fix PR 32772
......
...@@ -673,18 +673,10 @@ expand_one_register_var (tree var) ...@@ -673,18 +673,10 @@ expand_one_register_var (tree var)
/* Note if the object is a user variable. */ /* Note if the object is a user variable. */
if (!DECL_ARTIFICIAL (var)) if (!DECL_ARTIFICIAL (var))
{
mark_user_reg (x); mark_user_reg (x);
/* Trust user variables which have a pointer type to really if (POINTER_TYPE_P (type))
be pointers. Do not trust compiler generated temporaries mark_reg_pointer (x, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (var))));
as our type system is totally busted as it relates to
pointer arithmetic which translates into lots of compiler
generated objects with pointer types, but which are not really
pointers. */
if (POINTER_TYPE_P (type))
mark_reg_pointer (x, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (var))));
}
} }
/* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL that /* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL that
......
...@@ -1898,19 +1898,11 @@ expand_decl (tree decl) ...@@ -1898,19 +1898,11 @@ expand_decl (tree decl)
/* Note if the object is a user variable. */ /* Note if the object is a user variable. */
if (!DECL_ARTIFICIAL (decl)) if (!DECL_ARTIFICIAL (decl))
{
mark_user_reg (DECL_RTL (decl)); mark_user_reg (DECL_RTL (decl));
/* Trust user variables which have a pointer type to really if (POINTER_TYPE_P (type))
be pointers. Do not trust compiler generated temporaries mark_reg_pointer (DECL_RTL (decl),
as our type system is totally busted as it relates to TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
pointer arithmetic which translates into lots of compiler
generated objects with pointer types, but which are not really
pointers. */
if (POINTER_TYPE_P (type))
mark_reg_pointer (DECL_RTL (decl),
TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
}
} }
else if (TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST else if (TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment