aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils2.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-11-24 08:18:40 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-11-24 08:18:40 +0000
commit90b4c164f4c725bfd77c1a1c6ad574604b423401 (patch)
treed3dce21e6f62462c4a3162939a961e2744aecfb6 /gcc/ada/gcc-interface/utils2.c
parent29e0597e2530cc21fe964e35c6cfbfadfb08a01e (diff)
downloadgcc-90b4c164f4c725bfd77c1a1c6ad574604b423401.zip
gcc-90b4c164f4c725bfd77c1a1c6ad574604b423401.tar.gz
gcc-90b4c164f4c725bfd77c1a1c6ad574604b423401.tar.bz2
trans.c (push_range_check_info): Replace early test with assertion.
* gcc-interface/trans.c (push_range_check_info): Replace early test with assertion. (Raise_Error_to_gnu): Do not call push_range_check_info if the loop stack is empty. * gcc-interface/utils.c (convert_to_fat_pointer): Fix formatting. * gcc-interface/utils2.c (gnat_invariant_expr): Deal with padded types and revert latest change. From-SVN: r217998
Diffstat (limited to 'gcc/ada/gcc-interface/utils2.c')
-rw-r--r--gcc/ada/gcc-interface/utils2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index e853e1f..1296a49 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -2780,7 +2780,13 @@ gnat_invariant_expr (tree expr)
|| (TREE_CODE (expr) == VAR_DECL && TREE_READONLY (expr)))
&& decl_function_context (expr) == current_function_decl
&& DECL_INITIAL (expr))
- expr = remove_conversions (DECL_INITIAL (expr), false);
+ {
+ expr = DECL_INITIAL (expr);
+ /* Look into CONSTRUCTORs built to initialize padded types. */
+ if (TYPE_IS_PADDING_P (TREE_TYPE (expr)))
+ expr = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (expr))), expr);
+ expr = remove_conversions (expr, false);
+ }
if (TREE_CONSTANT (expr))
return fold_convert (type, expr);
@@ -2836,7 +2842,7 @@ object:
if (!TREE_READONLY (t))
return NULL_TREE;
- if (TREE_CODE (t) == CONSTRUCTOR || TREE_CODE (t) == PARM_DECL)
+ if (TREE_CODE (t) == PARM_DECL)
return fold_convert (type, expr);
if (TREE_CODE (t) == VAR_DECL