http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56801
Bug #: 56801
Summary: Internal Compiler Error when compiling relaxed
transaction
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libitm
AssignedTo: [email protected]
ReportedBy: [email protected]
I am receiving the following error:
internal compiler error: in expand_call_tm, at trans-mem.c:2280
When compiling a simple program. The following test case is derived from
memcached 1.4.13:
// filename: testcase.c
#include <stdio.h>
#include <stdlib.h>
__attribute__((transaction_callable))
void slabs_adjust_mem_requested(unsigned int id, size_t old, size_t ntotal);
typedef struct {
unsigned int size;
unsigned int perslab;
void *slots;
unsigned int sl_curr;
void *end_page_ptr;
unsigned int end_page_free;
unsigned int slabs;
void **slab_list;
unsigned int list_size;
unsigned int killing;
size_t requested;
} slabclass_t;
static slabclass_t slabclass[(200 + 1)];
static int power_largest;
void slabs_adjust_mem_requested(unsigned int id, size_t old, size_t ntotal)
{
__transaction_relaxed {
slabclass_t *p;
if (id < 1 || id > power_largest) {
fprintf(stderr, "Internal error! Invalid slab class\n");
abort();
}
p = &slabclass[id];
p->requested = p->requested - old + ntotal;
}
}
Compilation line:
gcc -std=gnu11 -g -O2 -fgnu-tm -pthread -c testcase.c -o testcase.o