public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* Alignment not supported?
@ 2017-01-01  0:00 정인배(Inbae Jeong)
  2017-01-01  0:00 ` Florian Weimer
  0 siblings, 1 reply; 16+ messages in thread
From: 정인배(Inbae Jeong) @ 2017-01-01  0:00 UTC (permalink / raw)
  To: jit

I need to align a type for calling an external function.

How do I set the alignment for a type like the struct below?

struct my_arg {
int a;
alignas(32) int b;
};

I don't see any option for giving the alignment requirement to b.

Currently I make a large enough character array and manually
serialize/deserialize as if gcc would do with alignof and sizeof
operator (and with non-standard endianness macros), and it seems it's
working, but i really hope there is support for alignment. The code
gets uglier when the struct contains another struct in it so that i
don't think i can manage it if the struct changes.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-04-24 20:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-01  0:00 Alignment not supported? 정인배(Inbae Jeong)
2017-01-01  0:00 ` Florian Weimer
2017-01-01  0:00   ` 정인배(Inbae Jeong)
2017-01-01  0:00     ` [PATCH] Work-in-progress: gcc_jit_type_get_aligned David Malcolm
2017-01-01  0:00       ` Florian Weimer
2017-01-01  0:00         ` [PATCH] Add gcc_jit_type_get_aligned David Malcolm
2017-01-01  0:00           ` David Malcolm
2017-01-01  0:00     ` Alignment not supported? Florian Weimer
2017-01-01  0:00     ` David Malcolm
2017-01-01  0:00       ` Florian Weimer
2017-01-01  0:00         ` David Malcolm
2017-01-01  0:00           ` Florian Weimer
2017-01-01  0:00           ` David Malcolm
2017-01-01  0:00             ` Florian Weimer
2017-01-01  0:00               ` David Malcolm
2017-01-01  0:00                 ` Florian Weimer

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).