2013-08-13 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/trans.c (Call_to_gnu): Deal with specific conditional
+ expressions for misaligned actual parameters.
+
+2013-08-13 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/trans.c (can_equal_min_or_max_val_p): Be prepared for
values outside of the range of the type.
/* Set up to move the copy back to the original if needed. */
if (!in_param)
{
- gnu_stmt = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_orig,
- gnu_temp);
+ /* If the original is a COND_EXPR whose first arm isn't meant to
+ be further used, just deal with the second arm. This is very
+ likely the conditional expression built for a check. */
+ if (TREE_CODE (gnu_orig) == COND_EXPR
+ && TREE_CODE (TREE_OPERAND (gnu_orig, 1)) == COMPOUND_EXPR
+ && integer_zerop
+ (TREE_OPERAND (TREE_OPERAND (gnu_orig, 1), 1)))
+ gnu_orig = TREE_OPERAND (gnu_orig, 2);
+
+ gnu_stmt
+ = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_orig, gnu_temp);
set_expr_location_from_node (gnu_stmt, gnat_node);
+
append_to_statement_list (gnu_stmt, &gnu_after_list);
}
}
+2013-08-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/valued_proc.adb: New test.
+ * gnat.dg/valued_proc_pkg.ads: New helper.
+
2013-08-13 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/57661
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-gnatdm -gnatws" }
+
+with Valued_Proc_Pkg; use Valued_Proc_Pkg;
+with System; use System;
+
+procedure Valued_Proc is
+ Status : UNSIGNED_LONGWORD;
+ Length : POSITIVE;
+begin
+ GetMsg (Status, UNSIGNED_WORD(Length));
+end;
--- /dev/null
+pragma Extend_System (Aux_DEC);
+with System; use System;
+
+package Valued_Proc_Pkg is
+
+ procedure GETMSG (STATUS : out UNSIGNED_LONGWORD;
+ MSGLEN : out UNSIGNED_WORD);
+
+ pragma Interface (EXTERNAL, GETMSG);
+
+ pragma IMPORT_VALUED_PROCEDURE (GETMSG, "SYS$GETMSG",
+ (UNSIGNED_LONGWORD, UNSIGNED_WORD),
+ (VALUE, REFERENCE));
+
+end Valued_Proc_Pkg;