re PR libgcc/60472 (Warning: array subscript is above array bounds when compiling crtstuff.c)

PR libgcc/60472
	* crtstuff.c (frame_dummy): Use void **jcr_list temporary
	variable to avoid array subscript is above array bounds warnings.
	Use __builtin_expect when checking *jcr_list for NULL.

From-SVN: r208457
This commit is contained in:
Uros Bizjak 2014-03-10 19:31:20 +01:00
parent 4d3f2fa687
commit c2e7e5974b
2 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2014-03-10 Uros Bizjak <ubizjak@gmail.com>
PR libgcc/60472
* crtstuff.c (frame_dummy): Use void **jcr_list temporary
variable to avoid array subscript is above array bounds warnings.
Use __builtin_expect when checking *jcr_list for NULL.
2014-03-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR libgcc/59339
@ -420,7 +427,7 @@
2013-12-26 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
* config/i386/cpuinfo.c (processor_types): Rename AMD cpu names
* config/i386/cpuinfo.c (processor_types): Rename AMD cpu names
AMD_BOBCAT to AMD_BTVER1 and AMD_JAGUAR to AMD_BTVER2.
(get_amd_cpu): Likewise.

View File

@ -460,12 +460,14 @@ frame_dummy (void)
#endif /* USE_EH_FRAME_REGISTRY */
#ifdef JCR_SECTION_NAME
if (__JCR_LIST__[0])
void **jcr_list;
__asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
if (__builtin_expect (*jcr_list != NULL, 0))
{
void (*register_classes) (void *) = _Jv_RegisterClasses;
__asm ("" : "+r" (register_classes));
if (register_classes)
register_classes (__JCR_LIST__);
register_classes (jcr_list);
}
#endif /* JCR_SECTION_NAME */
@ -565,12 +567,14 @@ __do_global_ctors_1(void)
#endif
#ifdef JCR_SECTION_NAME
if (__JCR_LIST__[0])
void **jcr_list
__asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
if (__builtin_expect (*jcr_list != NULL, 0))
{
void (*register_classes) (void *) = _Jv_RegisterClasses;
__asm ("" : "+r" (register_classes));
if (register_classes)
register_classes (__JCR_LIST__);
register_classes (jcr_list);
}
#endif