diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2005-12-06 19:45:00 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2005-12-06 19:45:00 +0000 |
commit | d7d938374664ca711b5bb894486394425d8c9227 (patch) | |
tree | 9a4d882c3bd13e5816af7f4580ea174e21a1509f /gcc/tree.c | |
parent | 3af22b23b32d69bd7cc0d444429f33e4edae008d (diff) | |
download | gcc-d7d938374664ca711b5bb894486394425d8c9227.zip gcc-d7d938374664ca711b5bb894486394425d8c9227.tar.gz gcc-d7d938374664ca711b5bb894486394425d8c9227.tar.bz2 |
re PR c++/24138 (ICE with the code in PR 20407)
PR C++/24138
* tree.c (integer_all_onesp): Always return true if all bits on.
* cp/decl.c (reshape_init_array_1): Handle max_index of -1.
* testsuite/g++.dg/init/array0.C: New.
From-SVN: r108126
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1208,9 +1208,11 @@ integer_all_onesp (tree expr) return 0; uns = TYPE_UNSIGNED (TREE_TYPE (expr)); + if (TREE_INT_CST_LOW (expr) == ~(unsigned HOST_WIDE_INT) 0 + && TREE_INT_CST_HIGH (expr) == -1) + return 1; if (!uns) - return (TREE_INT_CST_LOW (expr) == ~(unsigned HOST_WIDE_INT) 0 - && TREE_INT_CST_HIGH (expr) == -1); + return 0; /* Note that using TYPE_PRECISION here is wrong. We care about the actual bits, not the (arbitrary) range of the type. */ |