diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2014-12-15 19:43:26 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2014-12-15 19:43:26 +0100 |
commit | 2405e0ea00fea38ed86fade3d10fb728ba1ff0f6 (patch) | |
tree | ad4cbf4e91d865680291305f0c669e9be1484929 /libgcc/crtstuff.c | |
parent | c05816d64ff9c4835485c4b265eadcf8fee48415 (diff) | |
download | gcc-2405e0ea00fea38ed86fade3d10fb728ba1ff0f6.zip gcc-2405e0ea00fea38ed86fade3d10fb728ba1ff0f6.tar.gz gcc-2405e0ea00fea38ed86fade3d10fb728ba1ff0f6.tar.bz2 |
re PR libgcc/63832 (crtstuff.c:400:19: warning: array subscript is above array bounds [-Warray-bounds])
PR libgcc/63832
* crtstuff.c (__do_global_dtors_aux) [HIDDEN_DTOR_LIST_END]: Use
func_ptr *dtor_list temporary variable to avoid "array subscript
is above array bounds" warnings.
From-SVN: r218759
Diffstat (limited to 'libgcc/crtstuff.c')
-rw-r--r-- | libgcc/crtstuff.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index 62a4b42..0432794 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -393,13 +393,11 @@ __do_global_dtors_aux (void) extern func_ptr __DTOR_END__[] __attribute__((visibility ("hidden"))); static size_t dtor_idx; const size_t max_idx = __DTOR_END__ - __DTOR_LIST__ - 1; - func_ptr f; + func_ptr *dtor_list; + __asm ("" : "=g" (dtor_list) : "0" (__DTOR_LIST__)); while (dtor_idx < max_idx) - { - f = __DTOR_LIST__[++dtor_idx]; - f (); - } + dtor_list[++dtor_idx] (); } #else /* !defined (FINI_ARRAY_SECTION_ASM_OP) */ { |