diff mbox series

[Ada] Fix minor inaccuracy in lvalue_required_p

Message ID 2425733.X3XQZhxnem@arcturus.home
State New
Headers show
Series [Ada] Fix minor inaccuracy in lvalue_required_p | expand

Commit Message

Eric Botcazou Aug. 30, 2019, 2:48 p.m. UTC
It can only result in a missed early optimization.

Tested on x86_64-suse-linux, applied on the mainline.


2019-08-30  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/trans.c (lvalue_required_p) <N_Slice>: Adjust GNU_TYPE
	in the recursive call.
	<N_Selected_Component>: Likewise.
diff mbox series

Patch

Index: gcc-interface/trans.c
===================================================================
--- gcc-interface/trans.c	(revision 275187)
+++ gcc-interface/trans.c	(working copy)
@@ -873,12 +873,14 @@  lvalue_required_p (Node_Id gnat_node, tree gnu_typ
       if (Prefix (gnat_parent) != gnat_node)
 	return 0;
 
-      return lvalue_required_p (gnat_parent, gnu_type, constant,
-				address_of_constant);
+      return lvalue_required_p (gnat_parent,
+				get_unpadded_type (Etype (gnat_parent)),
+				constant, address_of_constant);
 
     case N_Selected_Component:
-      return lvalue_required_p (gnat_parent, gnu_type, constant,
-				address_of_constant);
+      return lvalue_required_p (gnat_parent,
+				get_unpadded_type (Etype (gnat_parent)),
+				constant, address_of_constant);
 
     case N_Object_Renaming_Declaration:
       /* We need to preserve addresses through a renaming.  */