public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/21333] in_pack / in_unpack alignment issues
Date: Tue, 24 May 2005 22:46:00 -0000	[thread overview]
Message-ID: <20050524224048.30210.qmail@sourceware.org> (raw)
In-Reply-To: <20050502112726.21333.tkoenig@gcc.gnu.org>


------- Additional Comments From tkoenig at gcc dot gnu dot org  2005-05-24 22:40 -------
For 4-byte complex, an option is to check the alignment at runtime.
If the complex is aligned on an 8-byte boundary, it should be
perfectly OK to call the 8-byte-integer routines.

The check could be done with a macro like this:

#define GFC_ALIGNMENT_I8(a) (((size_t) (a)) & 7 == 0)
#define GFC_ALIGNMENT_I4(a) (((size_t) (a)) & 3 == 0)

and the code look like

if (size == 8)
{
    if (GFC_ALIGNMENT_I8(ptr))
        return internal_pack_8(whatever)
    else if (GFC_ALIGNMENT_I4(ptr))
        return internal_pack_c4(whatever)

    /* Fall through to generic routine */
}

OK in principle?  Too horrible to contemplate?

-- 


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


  parent reply	other threads:[~2005-05-24 22:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-02 11:28 [Bug libfortran/21333] New: " tkoenig at gcc dot gnu dot org
2005-05-11 21:32 ` [Bug libfortran/21333] " tobi at gcc dot gnu dot org
2005-05-11 21:58 ` tobi at gcc dot gnu dot org
2005-05-11 22:40 ` steven at gcc dot gnu dot org
2005-05-17 13:25 ` tkoenig at gcc dot gnu dot org
2005-05-24 22:46 ` tkoenig at gcc dot gnu dot org [this message]
2005-06-02 15:49 ` tkoenig at gcc dot gnu dot org
2005-06-11 19:39 ` cvs-commit at gcc dot gnu dot org
2005-06-11 20:19 ` [Bug libfortran/21333] [4.0 only] " tkoenig at gcc dot gnu dot org
2005-06-12 20:28 ` cvs-commit at gcc dot gnu dot org
2005-07-18 17:41 ` cvs-commit at gcc dot gnu dot org
2005-07-18 18:03 ` tkoenig at gcc dot gnu dot org
2005-07-19 17:49 ` cvs-commit at gcc dot gnu dot org

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=20050524224048.30210.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).