Commit 2405e0ea by Uros Bizjak Committed by Uros Bizjak

re PR libgcc/63832 (crtstuff.c:400:19: warning: array subscript is above array…

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
parent c05816d6
2014-12-15 Uros Bizjak <ubizjak@gmail.com>
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.
2014-12-09 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> 2014-12-09 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
* Makefile.in (with_aix_soname): Define. * Makefile.in (with_aix_soname): Define.
...@@ -809,7 +816,7 @@ ...@@ -809,7 +816,7 @@
PR libgcc/60472 PR libgcc/60472
* crtstuff.c (frame_dummy): Use void **jcr_list temporary * crtstuff.c (frame_dummy): Use void **jcr_list temporary
variable to avoid array subscript is above array bounds warnings. variable to avoid "array subscript is above array bounds" warnings.
Use __builtin_expect when checking *jcr_list for NULL. Use __builtin_expect when checking *jcr_list for NULL.
2014-03-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2014-03-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
......
...@@ -393,13 +393,11 @@ __do_global_dtors_aux (void) ...@@ -393,13 +393,11 @@ __do_global_dtors_aux (void)
extern func_ptr __DTOR_END__[] __attribute__((visibility ("hidden"))); extern func_ptr __DTOR_END__[] __attribute__((visibility ("hidden")));
static size_t dtor_idx; static size_t dtor_idx;
const size_t max_idx = __DTOR_END__ - __DTOR_LIST__ - 1; 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) while (dtor_idx < max_idx)
{ dtor_list[++dtor_idx] ();
f = __DTOR_LIST__[++dtor_idx];
f ();
}
} }
#else /* !defined (FINI_ARRAY_SECTION_ASM_OP) */ #else /* !defined (FINI_ARRAY_SECTION_ASM_OP) */
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment