Branch: Tag:

2016-03-24

2016-03-24 20:52:04 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Work around for broken 32-bit code generator in gcc 4.8.5.

Gcc 4.8.5 in 32-bit mode compiled the initialization loop for the
byte code relabel section to xmms opcodes that caused a SIGSEGV.

Assume 2-complement integers and use memset to initialize instead.

324:       labels=xalloc(sizeof(INT32) * 4 * (max_label+2));    jumps = labels + max_label + 2; -  uses = jumps + max_label + 2; -  aliases = uses + max_label + 2; +  aliases = jumps + max_label + 2; +  uses = aliases + max_label + 2;    while(relabel)    {    /* First do the relabel pass. */ -  for(e=0;e<=max_label;e++) -  { -  labels[e]=jumps[e]= aliases[e] = -1; -  uses[e]=0; -  } +  /* Set labels, jumps and aliases to all -1. */ +  memset(labels, 0xff, ((max_label + 2) * 3) * sizeof(INT32)); +  memset(uses, 0x00, (max_label + 2) * sizeof(INT32));       c=(p_instr *)instrbuf.s.str;    length=instrbuf.s.len / sizeof(p_instr);