[Bug middle-end/87054] misaligned asm output is turned into dereferenced pointer-to-aligned
aoliva at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 20 21:16:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87054
--- Comment #4 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Author: aoliva
Date: Thu Sep 20 19:34:44 2018
New Revision: 264450
URL: https://gcc.gnu.org/viewcvs?rev=264450&root=gcc&view=rev
Log:
[PR87054] fix unaligned access
Building an ADDR_EXPR uses the canonical type to build the pointer
type, but then, as we dereference it, we lose track of lax alignment
known to apply to the dereferenced object. This might not be a
problem in general, but it is when the compiler implicitly introduces
address taking and dereferencing, as it does for asm statements, and
as it may do in some loop optimizations.
From: Richard Biener <rguenther@suse.de>
for gcc/ChangeLog
PR middle-end/87054
* gimplify.c (gimplify_expr): Retain alignment of
addressable lvalue in dereference.
From: Alexandre Oliva <oliva@adacore.com>
for gcc/testsuite/ChangeLog
PR middle-end/87054
* gcc.dg/pr87054.c: New.
Added:
trunk/gcc/testsuite/gcc.dg/pr87054.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/testsuite/ChangeLog
More information about the Gcc-bugs
mailing list