public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zack@codesourcery.com>
To: Jason Merrill <jason@redhat.com>
Cc: Geert Bosch <bosch@gnat.com>,
	 Alexandre Oliva <aoliva@redhat.com>,
	kenner@vlsi1.ultra.nyu.edu (Richard Kenner),
	gcc-patches@gcc.gnu.org,  gcc@gcc.gnu.org,
	Jakub Jelinek <jakub@redhat.com>,
	Richard Henderson <rth@redhat.com>
Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
Date: Thu, 24 Apr 2003 18:04:00 -0000	[thread overview]
Message-ID: <87d6jbkdi9.fsf@egil.codesourcery.com> (raw)
In-Reply-To: <wvlr87rbytv.fsf@prospero.boston.redhat.com> (Jason Merrill's message of "Thu, 24 Apr 2003 18:16:28 +0100")

Jason Merrill <jason@redhat.com> writes:

> 1) For types, we want to be able to force a minimum alignment for
>   efficiency/correctness of access.
> 2) For fields, we want to be able to force a minimum alignment.
> 3) For fields, we want to be able to reduce alignment for packing efficiency.
> 4) For objects, we want to be able to force a minimum alignment.
> 5) For objects, we want to be able to force an exact alignment for building
>   up special sections (and for other reasons?).
>
> Anything else?
>
> 1 is handled by TYPE_ALIGN/TYPE_USER_ALIGN.
> 2 and 4/5 are handled by DECL_ALIGN/DECL_USER_ALIGN.
> 3 is handled by DECL_PACKED.

I'm leery of bringing DECL_PACKED into this -- the "packed" concept
has never really been nailed down as far as I know, and I worry that
it might bring in a whole 'nother set of conflicting assumptions from
the user community of __attribute__ ((packed)).

My suggestion would be that we rip out all the existing ALIGN stuff in
favor of two TYPE fields and two DECL fields named TYPE_MIN_ALIGN,
TYPE_MAX_ALIGN, DECL_MIN_ALIGN, and DECL_MAX_ALIGN.  The semantics are
that *_MIN_ALIGN is the minimum alignment to enforce for a type or
object, and *_MAX_ALIGN is the maximum alignment that can be assumed
for a type or object.  Then the front end gets to define whatever
rules it likes for setting these fields and inheriting them from types
to decls.

Note that, unless I'm even more confused than I think, normally
*_MIN_ALIGN >= *_MAX_ALIGN; possibly we want to give them different
names.

I think this covers all the cases but I could be wrong.

zw

  reply	other threads:[~2003-04-24 17:32 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-23  2:20 Richard Kenner
2003-04-23  5:31 ` Alexandre Oliva
2003-04-24  6:23   ` Jason Merrill
2003-04-24  8:43     ` Geert Bosch
2003-04-24 17:48       ` Jason Merrill
2003-04-24 18:04         ` Zack Weinberg [this message]
2003-04-24 19:31           ` Jason Merrill
2003-04-24 21:32         ` Geert Bosch
2003-04-24 23:24           ` Jason Merrill
2003-04-25  2:56     ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2003-04-23  3:29 Robert Dewar
2003-04-22 15:08 Richard Kenner
2003-04-23  1:07 ` Alexandre Oliva
2003-04-22  0:15 Robert Dewar
2003-04-22  1:58 ` Jamie Lokier
2003-04-22  0:11 Robert Dewar
2003-04-22  1:35 ` Jamie Lokier
2003-04-21 21:25 Richard Kenner
2003-04-21 20:59 Richard Kenner
2003-04-21 21:14 ` Jamie Lokier
2003-04-21 20:45 Richard Kenner
2003-04-21 20:58 ` Jamie Lokier
2003-04-21 18:14 Richard Kenner
2003-04-21 20:33 ` Jamie Lokier
2003-04-21 17:25 Richard Kenner
2003-04-21 18:14 ` Jamie Lokier
2003-04-22  9:00 ` Alexandre Oliva
2003-04-20 21:28 Robert Dewar
2003-04-21 17:05 ` Alexandre Oliva
2003-04-20 21:19 Robert Dewar
2003-04-18 11:41 Richard Kenner
2003-04-18  8:06 Richard Kenner
2003-04-18  8:59 ` Richard Henderson
2003-04-17 21:41 Richard Kenner
2003-04-17 23:20 ` Alexandre Oliva
2003-04-18  1:16 ` Richard Henderson
2003-04-17 21:40 Richard Kenner
2003-04-17 11:56 Richard Kenner
2003-04-17 20:35 ` Alexandre Oliva
2003-04-17 22:41   ` Geert Bosch
2003-04-17 23:19     ` Alexandre Oliva
2003-04-17 10:44 Robert Dewar
2003-04-17 20:30 ` Alexandre Oliva
2003-04-17  8:12 Richard Kenner
2003-04-17  8:38 ` Alexandre Oliva
2003-04-11 22:26 Robert Dewar
2003-04-11 16:59 Robert Dewar
2003-04-11 18:49 ` Laurent Guerby
2003-04-11 16:51 Robert Dewar
2003-04-11 14:52 Robert Dewar
2003-04-11  4:45 Richard Kenner
2003-04-17  5:39 ` Alexandre Oliva
2003-04-11  0:45 Ulrich Weigand
2003-04-10 22:43 Richard Kenner
2003-04-11  0:31 ` Richard Henderson
2003-04-11  2:19   ` David Edelsohn
2003-04-10 22:23 Richard Kenner
2003-04-10 22:16 Richard Kenner
2003-04-10 22:07 Richard Kenner
2003-04-10 22:23 ` David Edelsohn
2003-04-10 22:05 Robert Dewar
2003-04-10 22:02 Richard Kenner
2003-04-10 22:24 ` Richard Henderson
2003-04-11 11:20   ` Laurent Guerby
2003-04-11 11:57     ` Arnaud Charlet
2003-04-11 14:16       ` Laurent Guerby
2003-04-10 21:56 Richard Kenner
2003-04-10 22:02 ` David Edelsohn
2003-04-10 21:45 Richard Kenner
2003-04-10 21:52 ` David Edelsohn
2003-04-10 21:57 ` Richard Henderson
2003-04-10 21:44 Richard Kenner
2003-04-10 21:32 Robert Dewar
2003-04-10 21:32 ` David Edelsohn
2003-04-10 21:31 Richard Kenner
2003-04-10 21:29 Robert Dewar
2003-04-10 21:10 Richard Kenner
2003-04-10 21:10 Robert Dewar
2003-04-10 21:17 ` David Edelsohn
2003-04-10 21:04 Richard Kenner
2003-04-10 21:41 ` Geoff Keating
2003-04-10 20:57 Robert Dewar
2003-04-10 21:07 ` Ulrich Weigand
2003-04-10 20:52 Robert Dewar
2003-04-10 20:39 Richard Kenner
2003-04-10 21:00 ` Geoff Keating
2003-04-10 21:01 ` Ulrich Weigand
2003-04-10 21:44 ` Richard Henderson
2003-04-10 20:13 Richard Kenner
2003-04-10 20:28 ` Ulrich Weigand
2003-04-10 19:20 Richard Kenner
2003-04-10  5:33 Richard Kenner
2003-04-10  7:20 ` Ulrich Weigand
2003-04-09 23:31 Ulrich Weigand
2003-04-10  2:27 ` Richard Henderson
2003-04-10  3:10   ` Ulrich Weigand
2003-04-10 16:20     ` Ulrich Weigand
2003-04-10 16:39       ` Geoff Keating
2003-04-10 16:44         ` Ulrich Weigand
2003-04-10 18:06       ` Richard Henderson
2003-04-08 17:47 Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d6jbkdi9.fsf@egil.codesourcery.com \
    --to=zack@codesourcery.com \
    --cc=aoliva@redhat.com \
    --cc=bosch@gnat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=kenner@vlsi1.ultra.nyu.edu \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).