- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Using either icpc 13.1.1 or 14.0.0 and I'm observing the same optimisation issue. A statement of the form:
[cpp]A a = A().mutator();[/cpp]
where A has an empty default ctor, could causes the compiler to route the result from the mutator via the temporary, rather than route directly to the lvalue. The drawback in the former case is that there is a superfluous copy to the lvalue.
I've attached a code sample containing two exhibits. In Exibit A the compiler eliminates the temporary; in Exibit B the compiler does not eliminate the temporary.
Compilers tested:
[bash]$ icc -V Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.1.163 Build 20130313 Copyright (C) 1985-2013 Intel Corporation. All rights reserved. .. $ icc -V Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.0.080 Build 20130728 Copyright (C) 1985-2013 Intel Corporation. All rights reserved.[/bash]
CLI options used: -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -unroll-aggressive -mmic -funroll-loops -O3 -DNDEBUG
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Thank you for reporting this possible missed optimization opportunity and for the convenient test case. I routed it to Development (see internal tracking id below) and will let you know what I hear.
(Internal tracking id: DPD200247989)
(Resolution Update on 09/08/2014): This defect is fixed in the Intel® Parallel Studio XE 2015 Initial Release (2015.0.090 - Linux)
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Thank you for the quick reply, Kevin!
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
The compiler changes needed to eliminate the temporary used in Exhibit B in the original test case are now available in the new Intel Parallel Studio XE 2015 release for Linux (Version 15.0.0.090 Build 20140723) now available from the Intel Registration Center.
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora