This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/48377] [4.6/4.7 regression] miscompilation at -O3
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 3 Jun 2011 12:56:53 +0000
- Subject: [Bug tree-optimization/48377] [4.6/4.7 regression] miscompilation at -O3
- Auto-submitted: auto-generated
- References: <bug-48377-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48377
--- Comment #45 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-03 12:55:18 UTC ---
(In reply to comment #44)
> Created attachment 24423 [details]
> gcc46-pr48377.patch
>
> I don't see why mode should be relevant, the MEM_REF should have from the type
> clear indication that it is unaligned load (or store) and just should lead to
> the bit-fieldish expansion.
>
> Anyway, here is a testsuite patch for now, works on x86_64, not tested other
> targets.
The issue is (or at least was) that the mem-attrs get the alignment from
the alignment of the mode (for indirect-refs) unconditionally on strict-align
targets until
2010-12-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* emit-rtl.c (set_mem_attributes_minus_bitpos): Explicitly derive
default values from MEM mode if no memory attributes are present.
Do not use mode alignment, even on STRICT_ALIGNMENT targets, when
called with an expression (not a type).
and the indirect-ref path never went down the misaligned path as the
get_inner_reference path did. This is a very old issue. The only thing
MEM_REF improves here is that if the target has a movmisalign_optab it
is uses for such accesses, otherwise there will be simply a MEM RTX
with alingment less than the modes alignment which has no effect.
It is a genuine middle-end / target issue that we do not properly implement
this GCC extension for strict-align targets.