This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: std::pow implementation


Richard Earnshaw <rearnsha@arm.com> writes:

[...]

| Now, assume that the amount of code in the a!=1 case is reduced.  At what 
| point does it become beneficial to always inline?  Can the programmer 
| tell?

He can profile.

|  Should he write the code in a separate function, or should he leave 
| it to the compiler to decide?  What happens if the code is ported to 
| another machine with twice as many registers?

Let's not have the compiler speculate about the future plateform the
programmer will run his program on -- it has no clue.

| With Gaby's suggested interpretation, the compiler has *no* choice; it 
| must obey the inlining constraint because the programmer always knows 
| better...  Even when prepared to admit that he doesn't.

That assertion is wrong.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]