aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/gcc/function.c b/gcc/function.c
index f625489..986f43f 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2218,20 +2218,11 @@ use_register_for_decl (const_tree decl)
if (!DECL_REGISTER (decl))
return false;
- switch (TREE_CODE (TREE_TYPE (decl)))
- {
- case RECORD_TYPE:
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
- /* When not optimizing, disregard register keyword for variables with
- types containing methods, otherwise the methods won't be callable
- from the debugger. */
- if (TYPE_METHODS (TYPE_MAIN_VARIANT (TREE_TYPE (decl))))
- return false;
- break;
- default:
- break;
- }
+ /* When not optimizing, disregard register keyword for types that
+ could have methods, otherwise the methods won't be callable from
+ the debugger. */
+ if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (decl)))
+ return false;
return true;
}