This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/23768] ubsan runtime error due to misaligned struct member access after XCNEW
- From: "simon.marchi at ericsson dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 30 Oct 2018 14:53:45 +0000
- Subject: [Bug gdb/23768] ubsan runtime error due to misaligned struct member access after XCNEW
- Auto-submitted: auto-generated
- References: <bug-23768-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=23768
--- Comment #3 from Simon Marchi <simon.marchi at ericsson dot com> ---
> The concern I have with this approach is that it pessimizes the case of plain scalars, and for tools that are performance-sensitive (such as compilation toolchains), this may not be acceptable, even with the approach you suggest of checking the alignment first.
What do you mean here with pessimization? In this case:
#define XNEW ((alignof (T) > 8) ? (some_aligned_malloc (sizeof (T), alignof
(T))) : (malloc (sizeof(T))))
scalars will be allocated exactly the same way as before, and the generated
machine code should be the same as before.
--
You are receiving this mail because:
You are on the CC list for the bug.