Quantcast
Channel: Intel® Many Integrated Core Architecture
Viewing all articles
Browse latest Browse all 1347

Compiler bug with target attribute in icc 14

$
0
0

Hi there,

I'll just let the code and output speak for itself:

// broken
#define DECLARE_OFFLOADED __attribute__ ((target (mic)))

// working
//#define DECLARE_OFFLOADED

typedef void   (init_t)          (void);
typedef void   (args_t)          (void);
typedef void   (start_t)         (void);
typedef void   (eval_all_t)      (void);
typedef void   (eval_comp_t)     (void);
typedef void   (eval_rng_t)      (void);
typedef void   (init_solution_t) (void);
typedef void   (jeval_t)         (void);

DECLARE_OFFLOADED init_t             init;
DECLARE_OFFLOADED args_t             args;
DECLARE_OFFLOADED start_t            start;
DECLARE_OFFLOADED eval_all_t         eval_all;
DECLARE_OFFLOADED eval_comp_t        eval_comp;
DECLARE_OFFLOADED eval_rng_t         eval_rng;
DECLARE_OFFLOADED init_solution_t    init_solution;
DECLARE_OFFLOADED jeval_t            jeval;

int main(int argc, char **argv) {
        return 0;
}

Compiling this with icc code.c results in several compiler errors:

stochs@pool15:~/src/broken> icc  e2l.cc
e2l.cc(19): error: identifier "eval_all_t" is undefined
  DECLARE_OFFLOADED eval_all_t         eval_all;
                    ^

e2l.cc(21): error: identifier "eval_rng_t" is undefined
  DECLARE_OFFLOADED eval_rng_t         eval_rng;
                    ^

compilation aborted for e2l.cc (code 2)

... which change if you move the function declarations around, or rename them (or the typedefs).

Compiler version: Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.1.106 Build 20131008

Can anybody else confirm this? How do you suggest I proceed?

Thanks!

--Apo


Viewing all articles
Browse latest Browse all 1347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>