[mpich-discuss] [PATCH] Use attribute layout_compatible for pair types

Dmitri Gribenko gribozavr at gmail.com
Wed Jan 9 12:55:47 CST 2013


On Wed, Jan 9, 2013 at 8:19 PM, Dave Goodell <goodell at mcs.anl.gov> wrote:
> Both implemented and pushed as d440abb and ac15f7a.  Thanks.
>
> -Dave
>
> On Jan 1, 2013, at 11:14 PM CST, Jed Brown wrote:
>
>> In addition, I suggest guarding these definitions. Leaving these in increases the total number of symbols in an example executable linking PETSc by a factor of 2. (They're all read-only, but they're still there.) Clang is smart enough to remove these, presumably because it understands the special attributes.

No, LLVM removes these not because of the attributes, but because
these are unused.  And when they are used, most of the time they don't
have their address taken, so their value is propagated to the point
where they are read and the constants again become unused.

I don't think GCC isn't smart enough to do the same.  Do you compile
with optimization?

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the discuss mailing list