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

Jed Brown jedbrown at mcs.anl.gov
Wed Jan 9 14:00:50 CST 2013


On Jan 9, 2013 12:56 PM, "Dmitri Gribenko" <gribozavr at gmail.com> wrote:

> 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, as discussed in the other thread, it's smart enough, but only when
optimization is turned on. There's no reason to needlessly make debug
builds heavier than necessary. This is not a big deal either way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20130109/92c5a5f7/attachment.html>


More information about the discuss mailing list