Avoid creating useless local bounds around calls
commitfccc47dddc2ee605dd7fce5c1d1711404e19cd7f
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 28 Apr 2021 08:21:59 +0000 (28 10:21 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 28 Apr 2021 08:21:59 +0000 (28 10:21 +0200)
tree763c35580310792004c439ac5fbc0ed7f665beff
parentb81e2d5e76a6bcc71f45b122e8b5538ddb7ebf4c
Avoid creating useless local bounds around calls

This prevents the compiler from creating useless local bounds around calls
that take a parameter of an unconstrained array type when the bounds already
exist somewhere else for the actual parameter.

gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_subprog_type): Do not demote a
const or pure function because of a parameter whose type is pointer
to function.
* gcc-interface/trans.c (Call_to_gnu): Do not put back a conversion
between an actual and a formal that are unconstrained array types.
(gnat_gimplify_expr) <CALL_EXPR>: New case.
* gcc-interface/utils2.c (build_binary_op): Do not use |= operator.
(gnat_stabilize_reference_1): Likewise.
(gnat_rewrite_reference): Likewise.
(build_unary_op): Do not clear existing TREE_CONSTANT on the result.
(gnat_build_constructor): Also accept the address of a constant
CONSTRUCTOR as constant element.
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/trans.c
gcc/ada/gcc-interface/utils2.c