public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
To: John David Anglin <dave.anglin@bell.net>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Jeff Law	<law@redhat.com>, Jason Merrill <jason@redhat.com>
Subject: Re: [PATCH] Implement new hook for max_align_t_align
Date: Sun, 09 Oct 2016 08:35:00 -0000	[thread overview]
Message-ID: <AM4PR0701MB21620703A5F16667523B065DE4D80@AM4PR0701MB2162.eurprd07.prod.outlook.com> (raw)
In-Reply-To: <305D4697-79B3-4B69-8741-98BFC00A5ECE@bell.net>

On 10/08/16 19:36, John David Anglin wrote:
> On 2016-10-08, at 1:01 PM, Bernd Edlinger wrote:
>
>> I think your callback should also directly control the
>> alignment of max_align_t in stddef.h:
>>
>>
>>    long long __max_align_ll __attribute__((__aligned__(__alignof__(long
>> long))));
>>    long double __max_align_ld
>> __attribute__((__aligned__(__alignof__(long double))));
>>    /* _Float128 is defined as a basic type, so max_align_t must be
>>       sufficiently aligned for it.  This code must work in C++, so we
>>       use __float128 here; that is only available on some
>>       architectures, but only on i386 is extra alignment needed for
>>       __float128.  */
>> #ifdef __i386__
>>    __float128 __max_align_f128
>> __attribute__((__aligned__(__alignof(__float128))));
>> #endif
>> } max_align_t;
>>
>>
>> otherwise these will not match.
>
> Yes, i missed a hunk in the submission.  On hpux, the alignment is determined by the long
> double field.  With glibc, we need 16 byte alignment for max_align_t.
>

This looks still brittle to me.

I mean also the defines __hppa__ and __hpux__ come from
builtin_define calls in the backend, why not define
something with builtin_define_with_int_value,
which can be used as is in max_align_t.

For instance have:

typedef struct {
   char __max_align[0] __attribute__((__aligned__(__MAX_ALIGN_T_ALIGN__)));
} max_align_t;

Provided we do:

builtin_define_with_value ("__MAX_ALIGN_T_ALIGN__",
targetm.max_align_t_align () / BITS_PER_UNIT);

Would'nt that guarantee, that __max_align_t and
max_align_t_align () will always be the same?


Bernd.

  reply	other threads:[~2016-10-09  8:35 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-08 17:01 Bernd Edlinger
2016-10-08 17:36 ` John David Anglin
2016-10-09  8:35   ` Bernd Edlinger [this message]
2016-10-09 17:52     ` John David Anglin
2016-10-10 18:21       ` John David Anglin
2016-10-11 18:51         ` Jason Merrill
2016-10-11 18:59           ` DJ Delorie
2016-10-11 20:12             ` Jason Merrill
2016-10-11 20:55               ` John David Anglin
2016-10-11 20:57                 ` Jakub Jelinek
2016-10-11 21:27                 ` Jason Merrill
2016-10-11 20:04           ` John David Anglin
2016-10-12  7:02             ` Carlos O'Donell
2016-10-12  7:25               ` Jakub Jelinek
2016-10-12  7:52                 ` Florian Weimer
2016-10-12  8:02                   ` Jakub Jelinek
2016-10-12 12:13                     ` John David Anglin
2016-10-12 12:33                       ` Bernd Schmidt
2016-10-12 12:43                         ` Richard Biener
2016-10-12 12:46                           ` Bernd Schmidt
2016-10-12 15:51                           ` Joseph Myers
2016-10-12 13:48                     ` Jason Merrill
2016-10-12 14:17                       ` John David Anglin
2016-10-12 19:59                         ` Carlos O'Donell
2016-10-12 16:14                     ` Jeff Law
2016-10-12 17:24                       ` John David Anglin
2017-02-25 17:46                         ` Gerald Pfeifer
2017-02-25 22:13                           ` John David Anglin
2017-02-25 22:46                             ` Gerald Pfeifer
2017-02-25 23:46                               ` John David Anglin
2016-10-12 18:01                       ` Florian Weimer
2016-10-12 18:13                         ` John David Anglin
  -- strict thread matches above, loose matches on Subject: below --
2016-10-08 16:43 Bernd Edlinger
2016-10-08 15:45 John David Anglin

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=AM4PR0701MB21620703A5F16667523B065DE4D80@AM4PR0701MB2162.eurprd07.prod.outlook.com \
    --to=bernd.edlinger@hotmail.de \
    --cc=dave.anglin@bell.net \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=law@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).