]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[committed] Fix newlib build failure with rx as well as several dozen testsuite failures
authorJeff Law <jlaw@ventanamicro.com>
Thu, 4 Jul 2024 03:11:07 +0000 (21:11 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Thu, 4 Jul 2024 03:12:25 +0000 (21:12 -0600)
The rx port has been failing to build newlib for a bit over a week.  I can't
remember if it was the late-combine work or the IRA costing twiddle, regardless
the real bug is in the rx backend.

Basically dwarf2cfi is blowing up because of inconsistent state caused by the
failure to mark a stack adjustment as frame related.  This instance in the
epilogue looks like a simple goof.

With the port building again, the testsuite would run and it showed a number of
regressions, again related to CFI handling.  The common thread was a failure to
mark a copy from FP to SP in the prologue as frame related.  The change which
introduced this bug as supposed to just be changing promotions of vector types.
It's unclear if Nick included the hunk accidentally or just goof'd on the
logic.  Regardless it looks quite incorrect.

Reverting that hunk fixes the regressions *and* fixes 94 pre-existing failures.

The net is rx-elf is regression free and has moved forward in terms of its
testsuite status.

Pushing to the trunk momentarily.

gcc/

* config/rx/rx.cc (rx_expand_prologue): Mark the copy from FP to SP
as frame related.
(rx_expand_epilogue): Mark the stack pointer adjustment as frame
related.

gcc/config/rx/rx.cc

index 8048cc9870846d39bba25388627f0ca8407621b0..c84e1398aad4f19d80660a512e01b0a8eac7f4ad 100644 (file)
@@ -1845,8 +1845,7 @@ rx_expand_prologue (void)
        gen_safe_add (stack_pointer_rtx, stack_pointer_rtx,
                      GEN_INT (- (HOST_WIDE_INT) frame_size), true);
       else
-       gen_safe_add (stack_pointer_rtx, frame_pointer_rtx, NULL_RTX,
-                     false /* False because the epilogue will use the FP not the SP.  */);
+       gen_safe_add (stack_pointer_rtx, frame_pointer_rtx, NULL_RTX, true);
     }
 }
 
@@ -2119,7 +2118,7 @@ rx_expand_epilogue (bool is_sibcall)
       /* Cannot use the special instructions - deconstruct by hand.  */
       if (total_size)
        gen_safe_add (stack_pointer_rtx, stack_pointer_rtx,
-                     GEN_INT (total_size), false);
+                     GEN_INT (total_size), true);
 
       if (MUST_SAVE_ACC_REGISTER)
        {