Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Small-object optimization question

Marjorie_F_Intel
Employee
349 Views

(posting for a friend) Does the C++ compiler have small-object optimization so that, in particular, numeric Complex { double real; double imag; } and Interval {double min; double max;} classes can be passed and returned in registers for functions which are not exported but can't be inlined.

0 Kudos
1 Reply
jim_dempsey
Beginner
349 Views

Try passing by reference instead of value. Then use dissassembly window to see what the compiler used. Unless your code creats temporary stack values your code should work quite well. Back in the old days withBorland C++ you could define a struct with a null constructor that produced absolutely no code for the constructor. MS C++ for some odd reason inserted a call to an empty subroutine that did nothing but return (what a crock). As for Intel C++ I do not know what it doesas I do not have it. Give it a try and see what happens.

Jim Dempsey

0 Kudos
Reply