From: Florian Weimer <fweimer@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, eggert@cs.ucla.edu
Subject: Re: Make max_align_t respect _Float128 [version 2]
Date: Tue, 06 Sep 2016 15:06:00 -0000 [thread overview]
Message-ID: <3bb7530e-fff4-6030-a87e-1654d55d1e45@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1609061120000.31924@digraph.polyomino.org.uk>
On 09/06/2016 01:25 PM, Joseph Myers wrote:
> On Tue, 6 Sep 2016, Florian Weimer wrote:
>
>> Why aren't there any users? The standard isn't very clear what the value of
>> _Alignof (max_align_t) actually means. Does the phrase “all contexts” include
>> pointers returned malloc? Even if the requested size is smaller than the
>> fundamental alignment? Did those who wrote the standard expect there to be
>> *any* relationship between malloc and max_align_t?
>
> See my cleanup of the wording in DR#445
> <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2059.htm#dr_445>, which
> is intended to reflect the intent and stay compatible with C99. malloc
> should be usable to allocate memory for any type from the standard library
> headers, including max_align_t.
And the old text for malloc says:
“
The pointer returned if the allocation succeeds is suitably aligned so
that it may be assigned to a pointer to any type of object with a
fundamental alignment requirement and then used to access such an object
or an array of such objects in the space allocated (until the space is
explicitly deallocated).
”
So that's what ties the two things together. I still don't like what's
implied in PR66661, that all object sizes have to be multiples of the
fundamental alignment.
>> The existing situation is that most mallocs to do not provide _Alignof
>> (max_align_t) alignment unconditionally. But they can provide arbitrarily
>> large alignment with aligned_alloc/memalign-style interfaces.
>
> Well, that's a conformance bug in the implementation as a whole. The
> nonconforming modes in question are still useful and it's useful for GCC
> to support such mallocs.
PR66661 shows that GCC does not want to support such mallocs (or even
glibc's malloc).
Florian
next prev parent reply other threads:[~2016-09-06 15:00 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 20:55 Make max_align_t respect _Float128 Joseph Myers
2016-08-26 21:10 ` Marc Glisse
2016-08-26 21:30 ` Joseph Myers
2016-08-26 21:45 ` Florian Weimer
2016-08-26 21:57 ` Paul Eggert
2016-08-26 22:25 ` Joseph Myers
2016-08-26 21:51 ` Paul Eggert
2016-08-29 13:29 ` Marek Polacek
2016-08-29 15:40 ` Joseph Myers
2016-09-01 14:18 ` Ping " Joseph Myers
2016-09-05 17:07 ` Make max_align_t respect _Float128 [version 2] Joseph Myers
2016-09-06 9:06 ` Richard Biener
2016-09-06 11:26 ` Joseph Myers
2016-09-06 9:19 ` Florian Weimer
2016-09-06 9:24 ` Richard Biener
2016-09-07 7:45 ` Florian Weimer
2016-09-07 17:53 ` Joseph Myers
2016-09-08 9:35 ` Florian Weimer
2016-09-06 11:40 ` Joseph Myers
2016-09-06 15:06 ` Florian Weimer [this message]
2016-09-06 15:20 ` Joseph Myers
2016-09-06 15:59 ` Paul Eggert
2016-09-06 20:47 ` Joseph Myers
2016-09-06 21:41 ` Paul Eggert
2016-09-07 9:22 ` Florian Weimer
2016-09-07 11:52 ` Mark Wielaard
2016-09-08 1:58 ` Paul Eggert
2016-09-08 11:58 ` Mark Wielaard
2016-09-08 12:22 ` Florian Weimer
2016-09-08 14:59 ` Paul Eggert
2016-09-08 12:30 ` Bernd Schmidt
2016-09-08 12:34 ` Florian Weimer
2016-09-07 9:15 ` Florian Weimer
2016-09-06 21:03 ` Jason Merrill
2016-09-06 21:18 ` Joseph Myers
2016-09-06 21:53 ` Jason Merrill
2016-09-06 21:56 ` Joseph Myers
2016-09-06 12:06 ` Bernd Schmidt
2016-09-06 14:59 ` Florian Weimer
2016-09-12 18:02 ` Make max_align_t respect _Float128 [version 3] Joseph Myers
2016-09-19 16:08 ` Ping " Joseph Myers
2016-09-19 17:11 ` Paul Eggert
2016-09-26 16:35 ` Jeff Law
2016-09-06 18:14 Make max_align_t respect _Float128 [version 2] Bernd Edlinger
2016-09-06 20:58 ` Joseph Myers
2016-09-07 19:50 Bernd Edlinger
2016-09-07 20:06 ` Joseph Myers
2016-09-07 21:00 ` Bernd Edlinger
2016-09-07 21:48 ` Joseph Myers
2016-09-08 10:50 ` Florian Weimer
2016-09-09 17:24 ` Bernd Edlinger
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=3bb7530e-fff4-6030-a87e-1654d55d1e45@redhat.com \
--to=fweimer@redhat.com \
--cc=eggert@cs.ucla.edu \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.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).