https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #25 from dennis luehring ---
(In reply to dennis luehring from comment #24)
> > However if I do not rename main to main2 I get in #0 testcase:
>
> also with main2 it gets optimized with gcc trunk on gcc.godbolt
correction: it works
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #24 from dennis luehring ---
> However if I do not rename main to main2 I get in #0 testcase:
also with main2 it gets optimized with gcc trunk on gcc.godbolt
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #20 from dennis luehring ---
thanks!
works with latest gcc.godbolt gcc trunk - on par with clang behavior
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96945
dennis luehring changed:
What|Removed |Added
CC||dl.soluz at gmx dot net
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #18 from dennis luehring ---
rechecked it with godbolt gcc-trunk and 14.2
gcc still does not optimize the std::vector case
clang is doing the optimization for at least 11 years
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #16 from dennis luehring ---
the sample still gets reduced by clang to 160 with -O2 or -O3
clang:
main: # @main
mov eax, 160
ret
and gcc 11.2/trunk producing
-O2
main:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103232
--- Comment #1 from dennis luehring ---
gcc 11.2
https://gcc.godbolt.org/z/jG8f6Phjc
clang 7
https://gcc.godbolt.org/z/c4Md5Yh1x
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dl.soluz at gmx dot net
Target Milestone: ---
C++17 allows scoped template specalization - clang 7+ and VStudio 2017/2019
allow it - gcc 11.2 and trunk are not able to compile
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186
--- Comment #5 from dennis luehring ---
-DTEST=1 compiles under Ubuntu 21.04 with g++ 10.3.0
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186
--- Comment #4 from dennis luehring ---
(In reply to Andrew Pinski from comment #3)
> >gcc -Wall -Wextra -std=c++17 test.cpp -DTEST=2
>
>
> This is wrong, you should use g++ to link as you need to link against
> libstdc++ which gcc does not do
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186
--- Comment #2 from dennis luehring ---
Created attachment 51766
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51766&action=edit
s-file
output of "gcc -Wall -Wextra -std=c++17 test.cpp -DTEST=1 -save-temps"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186
--- Comment #1 from dennis luehring ---
Created attachment 51765
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51765&action=edit
ii-file
output of "gcc -Wall -Wextra -std=c++17 test.cpp -DTEST=1 -save-temps"
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dl.soluz at gmx dot net
Target Milestone: ---
Created attachment 51764
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51764&action=edit
test source
How to reproduce
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #7 from dennis luehring ---
clang got now support for
(see:
http://clang-developers.42468.n3.nabble.com/missing-optimization-opportunity-for-const-std-vector-compared-to-std-array-td4034587.html#none)
void *__builtin_operator_new(s
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #5 from dennis luehring ---
but clang 3.3 produces only the optimized output when using -O2 (-O3 still
invokes the loop optimizer too early - but this is a known bug)
so it seems that the llvm/clang developers think that new/delete ca
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #4 from dennis luehring ---
rechecked with latest clang 3.3(3.4) on http://gcc.godbolt.org/
reduces both cases std::array and std::vector down to
return 160
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #3 from dennis luehring ---
according to the feedback from the clang mailing list by Benjamin Kramer
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/032111.html
llvm seems to not have any problem in removing new/delete in t
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #2 from dennis luehring ---
i missed the commandline
g++-4.8 -O3 -march=native -std=c++11 -fdump-tree-optimized test.cpp
: enhancement
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: dl.soluz at gmx dot net
this small testprogram shows a missing optimization opportunity for const
std::vector when using initialization_list - in compared to
19 matches
Mail list logo