aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils2.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-03-16 09:59:01 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-03-16 09:59:01 +0000
commit61e0b23353f25d12fd1925ccd2aaaf19f56ddbcb (patch)
tree7c70e180d4bfd57e81574e83006ce113fff743ba /gcc/ada/gcc-interface/utils2.c
parent261cb0d3eb5e8160b88d729a2be684110ff48831 (diff)
downloadgcc-61e0b23353f25d12fd1925ccd2aaaf19f56ddbcb.zip
gcc-61e0b23353f25d12fd1925ccd2aaaf19f56ddbcb.tar.gz
gcc-61e0b23353f25d12fd1925ccd2aaaf19f56ddbcb.tar.bz2
utils2.c (gnat_invariant_expr): Return null if the type of the expression ends up being composite.
* gcc-interface/utils2.c (gnat_invariant_expr): Return null if the type of the expression ends up being composite. From-SVN: r221449
Diffstat (limited to 'gcc/ada/gcc-interface/utils2.c')
-rw-r--r--gcc/ada/gcc-interface/utils2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index e04add9..e25b815 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -2805,6 +2805,12 @@ gnat_invariant_expr (tree expr)
expr = remove_conversions (expr, false);
}
+ /* We are only interested in scalar types at the moment and, even if we may
+ have gone through padding types in the above loop, we must be back to a
+ scalar value at this point. */
+ if (AGGREGATE_TYPE_P (TREE_TYPE (expr)))
+ return NULL_TREE;
+
if (TREE_CONSTANT (expr))
return fold_convert (type, expr);