Another compiler bug report

Another compiler bug report

Imagen de Yuan Tang
Hi ,

I have a following function "meta_m0_0", see below.

and I call this function just as follows:

int cilk_main(...)

{

...

meta_m0_0(Q, t0, t1, ...);

...

}

But when I compile it (the cilk_main()), the compiler will complain:

yuantang@octave:~/Git/6.884/lab3$ make

cilk++ -o heat.32 -O3 -DNDEBUG -I include -Wall -m32 heat.cilk
common.cilk heat_loops.cilk heat_recursive.cilk heat_util.cilk
heat_tests.cilk -lpng -lcilkutil -lm -L lib/i386

meta_func.h: In function void cilk
__cilk_spawn_base_case_kernel_116(const SimState*, volatile
__cilkrts_frame_t*):

meta_func.h:198: internal compiler error: in cilk_switch_stacks, at
cilk-common.c:899

Please submit a full bug report,

with preprocessed source if appropriate.

This compiler version is 4.2.4 (Cilk Arts build 8503)

See for instructions.

make: *** [heat.32] Error 1

Will anybody give me some hints on how to deal with this error?

Thanks!

Yuan



static inline void meta_m0_0(const SimState * Q, int t0, int t1, int x0, int dx0, int x1, int dx1, int y0, int dy0, int y1, int dy1)
{
cilk_spawn base_case_kernel(Q, 0, 1, 1, 3, 1, 3); /* the base_case_kernel() is just a simple serial computation kernel */
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 2, 2, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 0, 1, 1, 3, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 2, 2, 0, 2);
cilk_spawn base_case_kernel(Q, 0, 1, 1, 3, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 2, 2, 2, 6);
cilk_spawn base_case_kernel(Q, 0, 1, 1, 3, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 2, 2, 6, 8);
cilk_spawn base_case_kernel(Q, 0, 1, 5, 7, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 6, 6, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 0, 1, 5, 7, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 6, 6, 0, 2);
cilk_spawn base_case_kernel(Q, 0, 1, 5, 7, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 6, 6, 2, 6);
cilk_spawn base_case_kernel(Q, 0, 1, 5, 7, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 6, 6, 6, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 0, 1, 0, 1, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 0, 2, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 0, 1, 0, 1, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 0, 2, 0, 2);
cilk_spawn base_case_kernel(Q, 0, 1, 0, 1, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 0, 2, 2, 6);
cilk_spawn base_case_kernel(Q, 0, 1, 0, 1, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 0, 2, 6, 8);
cilk_spawn base_case_kernel(Q, 0, 1, 3, 5, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 2, 6, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 0, 1, 3, 5, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 2, 6, 0, 2);
cilk_spawn base_case_kernel(Q, 0, 1, 3, 5, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 2, 6, 2, 6);
cilk_spawn base_case_kernel(Q, 0, 1, 3, 5, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 2, 6, 6, 8);
cilk_spawn base_case_kernel(Q, 0, 1, 7, 8, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 6, 8, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 0, 1, 7, 8, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 6, 8, 0, 2);
cilk_spawn base_case_kernel(Q, 0, 1, 7, 8, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 6, 8, 2, 6);
cilk_spawn base_case_kernel(Q, 0, 1, 7, 8, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 1, 2, 6, 8, 6, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 2, 3, 1, 3, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 2, 2, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 2, 3, 1, 3, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 2, 2, 0, 2);
cilk_spawn base_case_kernel(Q, 2, 3, 1, 3, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 2, 2, 2, 6);
cilk_spawn base_case_kernel(Q, 2, 3, 1, 3, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 2, 2, 6, 8);
cilk_spawn base_case_kernel(Q, 2, 3, 5, 7, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 6, 6, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 2, 3, 5, 7, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 6, 6, 0, 2);
cilk_spawn base_case_kernel(Q, 2, 3, 5, 7, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 6, 6, 2, 6);
cilk_spawn base_case_kernel(Q, 2, 3, 5, 7, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 6, 6, 6, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 2, 3, 0, 1, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 0, 2, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 2, 3, 0, 1, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 0, 2, 0, 2);
cilk_spawn base_case_kernel(Q, 2, 3, 0, 1, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 0, 2, 2, 6);
cilk_spawn base_case_kernel(Q, 2, 3, 0, 1, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 0, 2, 6, 8);
cilk_spawn base_case_kernel(Q, 2, 3, 3, 5, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 2, 6, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 2, 3, 3, 5, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 2, 6, 0, 2);
cilk_spawn base_case_kernel(Q, 2, 3, 3, 5, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 2, 6, 2, 6);
cilk_spawn base_case_kernel(Q, 2, 3, 3, 5, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 2, 6, 6, 8);
cilk_spawn base_case_kernel(Q, 2, 3, 7, 8, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 6, 8, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 2, 3, 7, 8, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 6, 8, 0, 2);
cilk_spawn base_case_kernel(Q, 2, 3, 7, 8, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 6, 8, 2, 6);
cilk_spawn base_case_kernel(Q, 2, 3, 7, 8, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 3, 4, 6, 8, 6, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 4, 5, 1, 3, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 2, 2, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 4, 5, 1, 3, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 2, 2, 0, 2);
cilk_spawn base_case_kernel(Q, 4, 5, 1, 3, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 2, 2, 2, 6);
cilk_spawn base_case_kernel(Q, 4, 5, 1, 3, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 2, 2, 6, 8);
cilk_spawn base_case_kernel(Q, 4, 5, 5, 7, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 6, 6, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 4, 5, 5, 7, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 6, 6, 0, 2);
cilk_spawn base_case_kernel(Q, 4, 5, 5, 7, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 6, 6, 2, 6);
cilk_spawn base_case_kernel(Q, 4, 5, 5, 7, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 6, 6, 6, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 4, 5, 0, 1, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 0, 2, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 4, 5, 0, 1, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 0, 2, 0, 2);
cilk_spawn base_case_kernel(Q, 4, 5, 0, 1, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 0, 2, 2, 6);
cilk_spawn base_case_kernel(Q, 4, 5, 0, 1, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 0, 2, 6, 8);
cilk_spawn base_case_kernel(Q, 4, 5, 3, 5, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 2, 6, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 4, 5, 3, 5, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 2, 6, 0, 2);
cilk_spawn base_case_kernel(Q, 4, 5, 3, 5, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 2, 6, 2, 6);
cilk_spawn base_case_kernel(Q, 4, 5, 3, 5, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 2, 6, 6, 8);
cilk_spawn base_case_kernel(Q, 4, 5, 7, 8, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 6, 8, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 4, 5, 7, 8, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 6, 8, 0, 2);
cilk_spawn base_case_kernel(Q, 4, 5, 7, 8, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 6, 8, 2, 6);
cilk_spawn base_case_kernel(Q, 4, 5, 7, 8, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 5, 6, 6, 8, 6, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 6, 7, 1, 3, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 2, 2, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 6, 7, 1, 3, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 2, 2, 0, 2);
cilk_spawn base_case_kernel(Q, 6, 7, 1, 3, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 2, 2, 2, 6);
cilk_spawn base_case_kernel(Q, 6, 7, 1, 3, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 2, 2, 6, 8);
cilk_spawn base_case_kernel(Q, 6, 7, 5, 7, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 6, 6, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 6, 7, 5, 7, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 6, 6, 0, 2);
cilk_spawn base_case_kernel(Q, 6, 7, 5, 7, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 6, 6, 2, 6);
cilk_spawn base_case_kernel(Q, 6, 7, 5, 7, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 6, 6, 6, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 6, 7, 0, 1, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 0, 2, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 6, 7, 0, 1, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 0, 2, 0, 2);
cilk_spawn base_case_kernel(Q, 6, 7, 0, 1, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 0, 2, 2, 6);
cilk_spawn base_case_kernel(Q, 6, 7, 0, 1, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 0, 2, 6, 8);
cilk_spawn base_case_kernel(Q, 6, 7, 3, 5, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 2, 6, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 6, 7, 3, 5, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 2, 6, 0, 2);
cilk_spawn base_case_kernel(Q, 6, 7, 3, 5, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 2, 6, 2, 6);
cilk_spawn base_case_kernel(Q, 6, 7, 3, 5, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 2, 6, 6, 8);
cilk_spawn base_case_kernel(Q, 6, 7, 7, 8, 1, 3);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 6, 8, 2, 2);
cilk_sync;
cilk_spawn base_case_kernel(Q, 6, 7, 7, 8, 0, 1);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 6, 8, 0, 2);
cilk_spawn base_case_kernel(Q, 6, 7, 7, 8, 3, 5);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 6, 8, 2, 6);
cilk_spawn base_case_kernel(Q, 6, 7, 7, 8, 7, 8);
cilk_sync;
cilk_spawn base_case_kernel(Q, 7, 8, 6, 8, 6, 8);
}

publicaciones de 6 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de jsukha

Hi,

I just wanted to add my comments to this post, since I have encountered what I think is the same bug. The problem is likely to be the same, since we are both working with code derived from the same code base (one of our labs in MIT's 6.884 class).

"make heat_B2.64" leads to the following error messages:

cilk++ -o heat_B2.64 -DBLOCK_VALUE=2 -O2 -DNDEBUG -I include -Wall -Werror -m64 heat.cilk common.cilk heat_loops.cilk heat_recursive.cilk heat_util.cilk heat_tests.cilk -lpng -lcilkutil -lm -L lib/x86_64
common.h: In function void cilk walk2(const SimState*, int, int, int, int, int, int, int, int, int, int):
common.h:184: internal compiler error: in cilk_switch_stacks, at cilk-common.c:899
Please submit a full bug report,
with preprocessed source if appropriate.
This compiler version is 4.2.4 (Cilk Arts build 8503)
See for instructions.
make: *** [heat_B2.64] Error 1

The bug "goes away" if I stop trying to inline a kernel function (see ~ line 174 of common.h).
I've attached the project code which trips the bug.

Any help with figuring out what is wrong would be helpful. Thanks!

Jim

Adjuntos: 

AdjuntoTamaño
Descargar heat_inlinebug.tar.gz14.8 KB
Imagen de John Carr (Intel)

You can work around the problem by forcing kernel_inline to be a C/C++ function rather than a Cilk function. Use a forward declaration:

extern "C++" { static inline void kernel_inline(...params...); }

before the definition

static inline void kernel_inline(...params...) { ...body... }

extern "C" should work as well.

The code to switch from heap-allocated frames to the C stack when calling out of Cilk into C is fragile. InliningCilk functions probably confused it.

Imagen de Yuan Tang

If I wrap : extern "C++" {} around the definition, it will report something like:

cilk_sync may only be used in a cilk++ funcion
cilk_spawn outside of cilk function

Imagen de Yuan Tang

BTW: My up-to-date version of recursive cilk function call will be something like following:

void rect_meta(void * args)
{
argBundle *data = (argBundle*)args;
meta_m0_0(data->Q, data->t0, data->t1, data->x0, 0, data->x1, 0, data->y0, 0, data->y1, 0);
return;
}
void meta_m0_0(const SimState * Q, int t0, int t1, int x0, int dx0, int x1, int dx1, int y0, int dy0, int y1, int dy1)
{ /* main meta-function */

/* IS_SPAWN */
cilk_spawn meta_t1_0(Q, 0, 2, 0, 0, 4, 0, 0, 0, 4, 0);
cilk_sync;

/* IS_SPAWN */
cilk_spawn meta_t1_1(Q, 2, 4, 0, 0, 4, 0, 0, 0, 4, 0);
return;
}
void meta_t1_0(const SimState * Q, int t0, int t1, int x0, int dx0, int x1, int dx1, int y0, int dy0, int y1, int dy1)
{ /* cut into Time dimension */

/* IS_SPAWN */
cilk_spawn meta_t2_2(Q, 0, 1, 0, 0, 4, 0, 0, 0, 4, 0);
cilk_sync;

/* IS_SPAWN */
cilk_spawn meta_t2_3(Q, 1, 2, 0, 0, 4, 0, 0, 0, 4, 0);
return;
}
void meta_t2_2(const SimState * Q, int t0, int t1, int x0, int dx0, int x1, int dx1, int y0, int dy0, int y1, int dy1)
{ /* cut into Time dimension */
base_case_kernel(Q, 0, 1, 0, 0, 4, 0, 0, 0, 4, 0);
return;
}

... /* lots of recursive function calls */

Imagen de John Carr (Intel)

In the shorter example Jim Sukha posted applying the noinline attribute to kernel_single_timestep was sufficient to avoid the crash. It was not necessary to suppress inlining of kernel() itself.

static __attribute__((noinline)) inline void kernel_single_timestep(...) { ... }

A noinline attribute on an inline function is not as nonsensical as it looks because inline has two distinct meanings in C++. It requests the compiler to inline the function and also suppresses errors when different files define the same inline function. But removing the inline keyword from this one function might work as well. More generally, using the -fno-inline or -fno-inline-function keywords can turn off inlining. This may be undesirable for performance, but it may also take a while to figure out the internal cause of the compiler error.

Inicie sesión para dejar un comentario.