diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-07-11 09:31:08 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2005-07-11 09:31:08 +0200 |
commit | 15362b89f0016748c7c060b46280d5373e43e4f7 (patch) | |
tree | aa4aa509495eee4f3892001802de1ed8b407abf3 /gcc | |
parent | b1b0d9aceca14ac6f15e5c0f6a78c8c77c1562b7 (diff) | |
download | gcc-15362b89f0016748c7c060b46280d5373e43e4f7.zip gcc-15362b89f0016748c7c060b46280d5373e43e4f7.tar.gz gcc-15362b89f0016748c7c060b46280d5373e43e4f7.tar.bz2 |
cfgexpand.c (stack_protect_classify_type): Use TYPE_SIZE_UNIT (type) instead of TYPE_MAX_VALUE (TYPE_DOMAIN (type)) to get...
* cfgexpand.c (stack_protect_classify_type): Use TYPE_SIZE_UNIT (type)
instead of TYPE_MAX_VALUE (TYPE_DOMAIN (type)) to get array size in
bytes.
From-SVN: r101864
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cfgexpand.c | 13 |
2 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 073b6c4..c150806 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-07-11 Jakub Jelinek <jakub@redhat.com> + + * cfgexpand.c (stack_protect_classify_type): Use TYPE_SIZE_UNIT (type) + instead of TYPE_MAX_VALUE (TYPE_DOMAIN (type)) to get array size in + bytes. + 2005-07-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> PR middle-end/22239 diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 87b8245..83a88cc 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -770,15 +770,14 @@ stack_protect_classify_type (tree type) || t == signed_char_type_node || t == unsigned_char_type_node) { - HOST_WIDE_INT max = PARAM_VALUE (PARAM_SSP_BUFFER_SIZE); - HOST_WIDE_INT len; + unsigned HOST_WIDE_INT max = PARAM_VALUE (PARAM_SSP_BUFFER_SIZE); + unsigned HOST_WIDE_INT len; - if (!TYPE_DOMAIN (type) - || !TYPE_MAX_VALUE (TYPE_DOMAIN (type)) - || !host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 1)) - len = max + 1; + if (!TYPE_SIZE_UNIT (type) + || !host_integerp (TYPE_SIZE_UNIT (type), 1)) + len = max; else - len = tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 1); + len = tree_low_cst (TYPE_SIZE_UNIT (type), 1); if (len < max) ret = SPCT_HAS_SMALL_CHAR_ARRAY | SPCT_HAS_ARRAY; |