aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2004-06-01 01:42:35 -0600
committerJeff Law <law@gcc.gnu.org>2004-06-01 01:42:35 -0600
commit0b068ee90da7cbccbc7fd3ef66d58b9bcbcedabd (patch)
tree2b16ad65ff14e5d87159e2e3e1d8d3ebbecfa368 /gcc
parent61c627ed2c1b7184807d2101ab2d288e9ca4f39b (diff)
downloadgcc-0b068ee90da7cbccbc7fd3ef66d58b9bcbcedabd.zip
gcc-0b068ee90da7cbccbc7fd3ef66d58b9bcbcedabd.tar.gz
gcc-0b068ee90da7cbccbc7fd3ef66d58b9bcbcedabd.tar.bz2
stmt.c (expand_decl): Be more selective about calling mark_reg_pointer.
* stmt.c (expand_decl): Be more selective about calling mark_reg_pointer. From-SVN: r82533
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/stmt.c19
2 files changed, 19 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9e3fd3b..8656d29 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-19 Jeff Law <law@redhat.com>
+
+ * stmt.c (expand_decl): Be more selective about calling
+ mark_reg_pointer.
+
2004-06-01 Nicola Pero <nicola@brainstorm.co.uk>
PR objc/7993
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 7c4c67b..4df59f8 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -3422,12 +3422,21 @@ expand_decl (tree decl)
SET_DECL_RTL (decl, gen_reg_rtx (reg_mode));
+ /* Note if the object is a user variable. */
if (!DECL_ARTIFICIAL (decl))
- mark_user_reg (DECL_RTL (decl));
-
- if (POINTER_TYPE_P (type))
- mark_reg_pointer (DECL_RTL (decl),
- TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
+ {
+ mark_user_reg (DECL_RTL (decl));
+
+ /* Trust user variables which have a pointer type to really
+ be pointers. Do not trust compiler generated temporaries
+ 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 (DECL_RTL (decl),
+ TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
+ }
maybe_set_unchanging (DECL_RTL (decl), decl);