http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43829

--- Comment #46 from Mikael Morin <mikael at gcc dot gnu.org> 2011-10-09 
16:44:19 UTC ---
(In reply to comment #45)
> Are these numbers misleading, or once again compiling for size does not give
> the smallest size?

Well, to begin with, I don't think the test is close to a real world case.
It initializes a couple of arrays, and then applies to them various
computations involving sum which it basically throws away afterwards. I
wouldn't be surprised if some of the computations could be optimized away or
shared between the different checks. I'm purely speculating here, but that
would explain the size difference between inlined and then removed code vs kept
around library call.

Checks like this (for example) are good candidates for removal:
  if (any(sum(sum(a,1),1) /= sum(sum(a,2),1))) call abort

Reply via email to