summaryrefslogtreecommitdiff
path: root/gcc/tree-gimple.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-gimple.c')
-rw-r--r--gcc/tree-gimple.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c
index e723b472177..3bf773b23ea 100644
--- a/gcc/tree-gimple.c
+++ b/gcc/tree-gimple.c
@@ -260,12 +260,10 @@ is_gimple_id (tree t)
bool
is_gimple_reg_type (tree type)
{
- return (!AGGREGATE_TYPE_P (type)
- && TREE_CODE (type) != COMPLEX_TYPE);
+ return !AGGREGATE_TYPE_P (type);
}
-
-/* Return true if T is a scalar register variable. */
+/* Return true if T is a non-aggregate register variable. */
bool
is_gimple_reg (tree t)
@@ -275,6 +273,7 @@ is_gimple_reg (tree t)
if (!is_gimple_variable (t))
return false;
+
if (!is_gimple_reg_type (TREE_TYPE (t)))
return false;
@@ -301,6 +300,11 @@ is_gimple_reg (tree t)
if (TREE_CODE (t) == VAR_DECL && DECL_HARD_REGISTER (t))
return false;
+ /* Complex values must have been put into ssa form. That is, no
+ assignments to the individual components. */
+ if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE)
+ return DECL_COMPLEX_GIMPLE_REG_P (t);
+
return true;
}