* gcc-interface/trans.c (Call_to_gnu): Remove guard for NULL_EXPR.
* gcc-interface/utils2.c (gnat_rewrite_reference) <ERROR_MARK>: Return
the reference unmodified.
<NULL_EXPR>: New case. Likewise.
From-SVN: r231513
+2015-12-10 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (Call_to_gnu): Remove guard for NULL_EXPR.
+ * gcc-interface/utils2.c (gnat_rewrite_reference) <ERROR_MARK>: Return
+ the reference unmodified.
+ <NULL_EXPR>: New case. Likewise.
+
2015-12-10 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (create_var_decl): Adjust comment.
/* If it's possible we may need to use this expression twice, make sure
that any side-effects are handled via SAVE_EXPRs; likewise if we need
to force side-effects before the call. */
- if (Ekind (gnat_formal) != E_In_Parameter
- && !is_by_ref_formal_parm
- && TREE_CODE (gnu_name) != NULL_EXPR)
+ if (Ekind (gnat_formal) != E_In_Parameter && !is_by_ref_formal_parm)
{
tree init = NULL_TREE;
gnu_name = gnat_stabilize_reference (gnu_name, true, &init);
break;
case ERROR_MARK:
- return error_mark_node;
+ case NULL_EXPR:
+ return ref;
default:
gcc_unreachable ();
+2015-12-10 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/array25.adb: New test.
+ * gnat.dg/array25_pkg.ad[sb]: New helper.
+
2015-12-10 Claudiu Zissulescu <claziss@synopsys.com>
* lib/target-supports.exp (check_effective_target_arc_atomic): New
--- /dev/null
+-- { dg-do compile }
+
+with Array25_Pkg;
+
+procedure Array25 is
+
+ package My_Pkg is new Array25_Pkg (0, 0);
+
+begin
+ null;
+end;
--- /dev/null
+package body Array25_Pkg is
+
+ procedure Get_Inner (A : out Arr1) is
+ begin
+ null;
+ end;
+
+ procedure Get (A : out Arr2) is
+ begin
+ for I in Arr2'Range loop
+ Get_Inner (A (I).Data);
+ end loop;
+ end;
+
+end Array25_Pkg;
--- /dev/null
+generic
+
+ UB1 : Natural;
+
+ UB2 : Natural;
+
+package Array25_Pkg is
+
+ type Arr1 is array (1 .. UB1) of Integer;
+
+ type Rec is record
+ Data : Arr1;
+ end record;
+
+ type Arr2 is array (1 .. UB2) of Rec;
+
+ procedure Get (A : out Arr2);
+
+end Array25_Pkg;