public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/51628] __attribute__((packed)) is unsafe in some cases
Date: Tue, 02 Apr 2013 08:30:00 -0000	[thread overview]
Message-ID: <bug-51628-4-dj4aS3J423@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51628-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> 2013-04-02 08:30:16 UTC ---
(In reply to comment #14)
> > What Ada does looks just like a workaround for what should be done properly in
> > the expander.  So no, IMHO we shouldn't be changing all other FEs and the
> > middle-end (when it wants to generate them e.g. for memcpy) to do what Ada
> > does, but we should change the expander.
> 
> Of course I have the exactly opposite viewpoint, since I think that we should
> keep the invariants we have: integral modes are naturally aligned and
> TYPE_ALIGN >= MODE_ALIGN (TYPE_MODE).  Breaking them for a few pathological
> cases that the C compiler has shun for years doesn't seem the best course of
> action.

Well.  I'm fine with forcing BLKmode for unaligned accesses, but not sure
if that is less invasive.  You'd basically have to change modes whenever
more precise knowledge about alignment appears ...


  parent reply	other threads:[~2013-04-02  8:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-19 23:00 [Bug c/51628] New: " Keith.S.Thompson at gmail dot com
2011-12-19 23:17 ` [Bug c/51628] " Keith.S.Thompson at gmail dot com
2011-12-19 23:38 ` pinskia at gcc dot gnu.org
2011-12-20  0:43 ` Keith.S.Thompson at gmail dot com
2011-12-20 10:22 ` rguenth at gcc dot gnu.org
2011-12-20 10:54 ` ebotcazou at gcc dot gnu.org
2011-12-20 11:19 ` rguenther at suse dot de
2011-12-20 11:20 ` ebotcazou at gcc dot gnu.org
2011-12-20 11:34 ` rguenther at suse dot de
2011-12-20 11:57 ` ebotcazou at gcc dot gnu.org
2011-12-20 12:00 ` rguenther at suse dot de
2011-12-20 12:29 ` ebotcazou at gcc dot gnu.org
2011-12-20 13:11 ` jakub at gcc dot gnu.org
2011-12-20 13:29 ` rguenther at suse dot de
2011-12-20 17:45 ` ebotcazou at gcc dot gnu.org
2013-04-02  0:58 ` peter at axium dot co.nz
2013-04-02  8:30 ` rguenth at gcc dot gnu.org [this message]
2013-04-02  8:31 ` rguenth at gcc dot gnu.org
2013-04-02 20:21 ` peter at axium dot co.nz
2013-04-03  7:30 ` ebotcazou at gcc dot gnu.org
2013-04-03  7:55 ` rguenther at suse dot de
2013-04-03  8:51 ` ebotcazou at gcc dot gnu.org
2013-04-03  9:20 ` rguenther at suse dot de
2015-03-10 13:29 ` sven.koehler at gmail dot com
2015-03-10 13:40 ` sven.koehler at gmail dot com

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=bug-51628-4-dj4aS3J423@http.gcc.gnu.org/bugzilla/ \
    --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).