https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64905

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at redhat dot com

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Uroš Bizjak from comment #4)
> 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 in %rbp 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.

Like this

diff --git a/gcc/ira.c b/gcc/ira.c
index ea2b69f..a7cf476 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -2313,6 +2313,8 @@ ira_setup_eliminable_regset (void)

   if (frame_pointer_needed)
     df_set_regs_ever_live (HARD_FRAME_POINTER_REGNUM, true);
+  else
+    REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = 0;

   COPY_HARD_REG_SET (ira_no_alloc_regs, no_unit_alloc_regs);
   CLEAR_HARD_REG_SET (eliminable_regset);

Reply via email to