[
https://issues.apache.org/jira/browse/STDCXX-424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12498030#action_12498030
]
sebor edited comment on STDCXX-424 at 3/25/08 9:25 AM:
--------------------------------------------------------------
Hmm, the inliner in this compiler seems to be of quite poor quality. The
following simple program should inline into essentially an empty main. Instead
it produces the .s file below (note the loop!)
{noformat}
#include <valarray>
inline void f0 (std::valarray<int>) { }
inline void f1 (std::valarray<int> va) { f0 (va); }
int main ()
{
f1 (std::valarray<int>());
}
.file "t.cpp"
.globl _Unwind_Resume
.text
.align 2
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB672:
.L3:
.L17:
.L21:
.L26:
.L34:
.L36:
.L41:
.L45:
.L48:
.L83:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
subl $56, %esp
.LCFI2:
andl $-16, %esp
movl $0, -24(%ebp)
movl $0, -20(%ebp)
subl $16, %esp
movl $0, -40(%ebp)
movl $0, -36(%ebp)
leal -40(%ebp), %eax
movl 4(%eax), %eax
movl %eax, (%esp)
call operator delete(void*)
movl -20(%ebp), %edx
movl -24(%ebp), %eax
leal -24(%ebp), %ecx
leal (%edx,%eax,4), %eax
jmp .L86
.L97:
.L63:
.L66:
.L80:
.p2align 4,,7
.L91:
addl $4, %edx
.L86:
cmpl %eax, %edx
jne .L91
movl 4(%ecx), %eax
movl %eax, (%esp)
call operator delete(void*)
leave
xorl %eax, %eax
ret
.LFE672:
.size main, .-main
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.3-hammer"
{noformat}
was (Author: sebor):
Hmm, the inliner in this compiler seems to be of quite poor quality. The
following simple program should inline into essentially an empty main. Instead
it produces the .s file below (note the loop!)
#include <valarray>
inline void f0 (std::valarray<int>) { }
inline void f1 (std::valarray<int> va) { f0 (va); }
int main ()
{
f1 (std::valarray<int>());
}
.file "t.cpp"
.globl _Unwind_Resume
.text
.align 2
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB672:
.L3:
.L17:
.L21:
.L26:
.L34:
.L36:
.L41:
.L45:
.L48:
.L83:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
subl $56, %esp
.LCFI2:
andl $-16, %esp
movl $0, -24(%ebp)
movl $0, -20(%ebp)
subl $16, %esp
movl $0, -40(%ebp)
movl $0, -36(%ebp)
leal -40(%ebp), %eax
movl 4(%eax), %eax
movl %eax, (%esp)
call operator delete(void*)
movl -20(%ebp), %edx
movl -24(%ebp), %eax
leal -24(%ebp), %ecx
leal (%edx,%eax,4), %eax
jmp .L86
.L97:
.L63:
.L66:
.L80:
.p2align 4,,7
.L91:
addl $4, %edx
.L86:
cmpl %eax, %edx
jne .L91
movl 4(%ecx), %eax
movl %eax, (%esp)
call operator delete(void*)
leave
xorl %eax, %eax
ret
.LFE672:
.size main, .-main
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.3-hammer"
> [gcc 3.3.3] warning: inlining failed in call to std::valarray copy ctor
> -----------------------------------------------------------------------
>
> Key: STDCXX-424
> URL: https://issues.apache.org/jira/browse/STDCXX-424
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 26. Numerics
> Affects Versions: 4.1.3, 4.1.4
> Environment: gcc 3.3.3 on Linux
> Reporter: Martin Sebor
> Assignee: Martin Sebor
> Priority: Minor
> Fix For: 4.2.1
>
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> We're getting lots of warnings like the ones below from valarray tests. Even
> four levels of inlining in user code (not at all uncommon) triggers the
> noise...
> $ cat t.cpp && make t
> #include <valarray>
> inline void f0 (std::valarray<int>) { }
> inline void f1 (std::valarray<int> va) { f0 (va); }
> inline void f2 (std::valarray<int> va) { f1 (va); }
> inline void f3 (std::valarray<int> va) { f2 (va); }
> inline void f4 (std::valarray<int> va) { f3 (va); }
> int main ()
> {
> f4 (std::valarray<int>());
> }
> gcc -c -I/amd/devco/sebor/stdcxx/include/ansi -pthread
> -I/amd/devco/sebor/stdcxx/include
> -I/build/sebor/stdcxx-gcc-3.3.3_43.41-12d/include
> -I/amd/devco/sebor/stdcxx/examples/include -pedantic -nostdinc++ -O2 -m32
> -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long
> -Wcast-align t.cpp
> gcc t.o -o t -pthread -m32 -L/build/sebor/stdcxx-gcc-3.3.3_43.41-12d/lib
> -Wl,-R/build/sebor/stdcxx-gcc-3.3.3_43.41-12d/lib -lstd12d -lsupc++ -lm
> In file included from /amd/devco/sebor/stdcxx/include/rw/_array.h:7:
> t.cpp: In function `int main()':
> /amd/devco/sebor/stdcxx/include/valarray:93: warning: inlining failed in call
> to `std::valarray<_TypeT>::valarray(const std::valarray<_TypeT>&) [with
> _TypeT = int]'
> t.cpp:6: warning: called from here
> In file included from /amd/devco/sebor/stdcxx/include/rw/_array.h:6:
> /amd/devco/sebor/stdcxx/include/valarray:93: warning: inlining failed in call
> to `std::valarray<_TypeT>::valarray(const std::valarray<_TypeT>&) [with
> _TypeT = int]'
> t.cpp:5: warning: called from here
> In file included from /amd/devco/sebor/stdcxx/include/rw/_array.h:5:
> /amd/devco/sebor/stdcxx/include/valarray:93: warning: inlining failed in call
> to `std::valarray<_TypeT>::valarray(const std::valarray<_TypeT>&) [with
> _TypeT = int]'
> t.cpp:4: warning: called from here
> In file included from /amd/devco/sebor/stdcxx/include/rw/_array.h:4:
> /amd/devco/sebor/stdcxx/include/valarray:93: warning: inlining failed in call
> to `std::valarray<_TypeT>::valarray(const std::valarray<_TypeT>&) [with
> _TypeT = int]'
> t.cpp:3: warning: called from here
> In file included from t.cpp:7,
> from t.cpp:11:
> /amd/devco/sebor/stdcxx/include/valarray:93: warning: inlining failed in call
> to `std::valarray<_TypeT>::valarray(const std::valarray<_TypeT>&) [with
> _TypeT = int]'
> t.cpp:6: warning: called from here
> In file included from t.cpp:6,
> from t.cpp:7,
> from t.cpp:11:
> /amd/devco/sebor/stdcxx/include/valarray:93: warning: inlining failed in call
> to `std::valarray<_TypeT>::valarray(const std::valarray<_TypeT>&) [with
> _TypeT = int]'
> t.cpp:5: warning: called from here
> In file included from t.cpp:5,
> from t.cpp:6,
> from t.cpp:7,
> from t.cpp:11:
> /amd/devco/sebor/stdcxx/include/valarray:93: warning: inlining failed in call
> to `std::valarray<_TypeT>::valarray(const std::valarray<_TypeT>&) [with
> _TypeT = int]'
> t.cpp:4: warning: called from here
> In file included from t.cpp:4,
> from t.cpp:5,
> from t.cpp:6,
> from t.cpp:7,
> from t.cpp:11:
> /amd/devco/sebor/stdcxx/include/valarray:93: warning: inlining failed in call
> to `std::valarray<_TypeT>::valarray(const std::valarray<_TypeT>&) [with
> _TypeT = int]'
> t.cpp:3: warning: called from here
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.