This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR target/64905: unsigned short is loaded with 4-byte load (movl)
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>, Jeff Law <law at redhat dot com>
- Date: Wed, 4 Feb 2015 14:52:20 +0100
- Subject: Re: PATCH: PR target/64905: unsigned short is loaded with 4-byte load (movl)
- Authentication-results: sourceware.org; auth=none
- References: <20150202213947 dot GA27865 at intel dot com> <CAFULd4YMAKB+DLhbuOWT+mQQrmMNiJdfouQgDKZjSGNANFEsTQ at mail dot gmail dot com>
On Wed, Feb 4, 2015 at 2:21 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Mon, Feb 2, 2015 at 10:39 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>> This patch fixes a long standing bug where aligned_operand ignores
>> alignment of memory operand less than 32 bits. It drops address
>> decomposition and returns false if alignment of memory operand less
>> is than 32 bits. Tested on Linux/x86-64. OK for trunk, 4.9 and 4.8
>> branches?
>
> Can you please find some references in gcc mainlig lists why and for
> what reason is the predicate written in the current way? Are there
> some (older?) processors that require this approach, so a tuning flag
> should be used here?
After some more thinking, it looks the failure is due to:
emit-rtl.c: REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = STACK_BOUNDARY;
The testcase forces the pointer to %rbp (== HARD_FRAME_POINTER_REGNUM
in the above line), so the predicate thinks that the value is aligned,
since %rbp has its REGNO_POINTER_ALIGN set to STACK_BOUNDARY.
Looks like generic RTL infrastructure problem to me, the
REGNO_POINTER_ALIGNMENT of hard_frame_pointer should be cleared when
H_F_P is omitted and reused.
Please let's move discussion back to the PR.
Adding CC.
Uros.