- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
The attached code compiled with inlining fails to link. Compile as:
(note: granted, using such non-included non-exported template defs is not a common use case but nevertheless the need happens)
The attached code compiled with inlining fails to link. Compile as:
[shell]$ icpc --version icpc (ICC) 11.0 20090318 Copyright (C) 1985-2009 Intel Corporation. All rights reserved. $ icpc -O2 main.cpp foo.cpp /tmp/icpcGLJKre.o: In function `main': main.cpp:(.text+0x2e): undefined reference to `fooFrom the documentation it seems icpc supports __attribute__((noinline)), hence no compiler complaints, but the effect is nil. If __attribute__ is not the way, then what is the preferred way to selectively disable inlining (i.e. we don't want to be using -fno-inline)?::mem()' [/shell]
(note: granted, using such non-included non-exported template defs is not a common use case but nevertheless the need happens)
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem appears to be that the Intel compiler is ignoring the attribute if it is only on the definition.
If youput the attribute on the declaration then the example links as expected,i.e.:
template
class foo
{
public:
__attribute__((noinline)) void mem();
};
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If we compile the test case with g++ it compiles without any issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue has been fixed by Intel compiler development team. I will update the thread when the compiler is available for download.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue is fixed in latest Intel C++ Composer XE 12.1. The compiler is availble for dowload from INtel download and registration center.
Om
Om
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page