Commit 62a7df9f by Marc Glisse

Protect __TMC_END__ - __TMC_LIST__ == 0

2016-11-20  Marc Glisse  <marc.glisse@inria.fr>

        PR libgcc/77813
        * crtstuff.c (deregister_tm_clones, register_tm_clones): Hide
        __TMC_END__ behind a passthrough asm.

From-SVN: r242635
parent 00212843
2016-11-20 Marc Glisse <marc.glisse@inria.fr>
PR libgcc/77813
* crtstuff.c (deregister_tm_clones, register_tm_clones): Hide
__TMC_END__ behind a passthrough asm.
2016-11-18 Walter Lee <walt@tilera.com>
* config.host (tilepro*-*-linux*): Add t-slibgcc-libgcc to tmake_file.
* config.host (tilepro*-*-linux*): Add t-slibgcc-libgcc to tmake_file.
2016-11-17 Andrew Senkevich <andrew.senkevich@intel.com>
......
......@@ -280,7 +280,10 @@ deregister_tm_clones (void)
void (*fn) (void *);
#ifdef HAVE_GAS_HIDDEN
if (__TMC_END__ - __TMC_LIST__ == 0)
func_ptr *end = __TMC_END__;
// Do not optimize the comparison to false.
__asm ("" : "+g" (end));
if (__TMC_LIST__ == end)
return;
#else
if (__TMC_LIST__[0] == NULL)
......@@ -300,7 +303,10 @@ register_tm_clones (void)
size_t size;
#ifdef HAVE_GAS_HIDDEN
size = (__TMC_END__ - __TMC_LIST__) / 2;
func_ptr *end = __TMC_END__;
// Do not optimize the comparison to false.
__asm ("" : "+g" (end));
size = (end - __TMC_LIST__) / 2;
#else
for (size = 0; __TMC_LIST__[size * 2] != NULL; size++)
continue;
......
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