This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/3013: templated inline function not inlined
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/3013: templated inline function not inlined
- From: buschelm at mcs dot anl dot gov
- Date: 31 May 2001 17:11:36 -0000
- Reply-To: buschelm at mcs dot anl dot gov
>Number: 3013
>Category: c++
>Synopsis: templated inline function not inlined
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu May 31 10:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: buschelm@mcs.anl.gov
>Release: unknown-1.0
>Organization:
>Environment:
linux
>Description:
The following function, add<4,float>, is not inlined by g++ all versions including the online 3.0 from Code Sourcery (as of today 5/31/01).
<begin file add.cc>
#define SIZE 4
template <int N,class T> inline int add(T*a,T*b) {
for (int i=0;i<N;i++) a[i]+=b[i];
return(0);
}
int main(int argc,char *argv[]) {
float a[SIZE], b[SIZE];
for (int i=0;i<SIZE;i++) a[i]=b[i]=(float)i;
add<SIZE>(a,b);
return(0);
}
<end file add.cc>
>How-To-Repeat:
g++ -S add.cc
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: