summaryrefslogtreecommitdiff
path: root/gcc/ada/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/trans.c')
-rw-r--r--gcc/ada/trans.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index 4155eecfd6e..797671de7d3 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -435,11 +435,13 @@ tree_transform (gnat_node)
here since GNU_RESULT may be a CONST_DECL. */
if (DECL_P (gnu_result)
&& (DECL_BY_REF_P (gnu_result)
- || DECL_BY_COMPONENT_PTR_P (gnu_result)))
+ || (TREE_CODE (gnu_result) == PARM_DECL
+ && DECL_BY_COMPONENT_PTR_P (gnu_result))))
{
int ro = DECL_POINTS_TO_READONLY_P (gnu_result);
- if (DECL_BY_COMPONENT_PTR_P (gnu_result))
+ if (TREE_CODE (gnu_result) == PARM_DECL
+ && DECL_BY_COMPONENT_PTR_P (gnu_result))
gnu_result = convert (build_pointer_type (gnu_result_type),
gnu_result);