RISC-V: Add target machine headers as a dependency for riscv-sr.o

Message ID alpine.DEB.2.20.2201312132050.11348@tpp.orcam.me.uk
State Committed
Commit 3faeba72cf93bdbf0b42d6b1b65fd4f0794f9d2a
Headers
Series RISC-V: Add target machine headers as a dependency for riscv-sr.o |

Commit Message

Maciej W. Rozycki Jan. 31, 2022, 9:50 p.m. UTC
  Make riscv-sr.o depend on target machine headers, removing spurious test
failures:

FAIL: gcc.target/riscv/save-restore-3.c scan-assembler-not call[ \t]*t0,__riscv_save_0
FAIL: gcc.target/riscv/save-restore-3.c scan-assembler-not tail[ \t]*__riscv_restore_0
FAIL: gcc.target/riscv/save-restore-3.c scan-assembler tail[ \t]*foo
FAIL: gcc.target/riscv/save-restore-6.c scan-assembler-not call[ \t]*t0,__riscv_save_0
FAIL: gcc.target/riscv/save-restore-6.c scan-assembler-not tail[ \t]*__riscv_restore_0
FAIL: gcc.target/riscv/save-restore-6.c scan-assembler tail[ \t]*other_func

if the definitions of UNSPECs are locally changed and GCC rebuilt from a 
dirty tree.

	gcc/
	* config/riscv/t-riscv (riscv-sr.o): Add $(TM_H) dependency.
---
Hi,

 Noticed while fiddling with `fmin'/`fmax' further.  As not a code change 
OK to apply despite stage 4?  Might be worth backporting too.

  Maciej
---
 gcc/config/riscv/t-riscv |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

gcc-riscv-sr-dep.diff
  

Comments

Kito Cheng Feb. 7, 2022, 2:50 a.m. UTC | #1
OK to trunk, thanks for fixing this issue, I hit that issue before but
I didn't figure out what happened...since that issue will disappear
when I clean build :p

On Tue, Feb 1, 2022 at 5:52 AM Maciej W. Rozycki <macro@embecosm.com> wrote:
>
> Make riscv-sr.o depend on target machine headers, removing spurious test
> failures:
>
> FAIL: gcc.target/riscv/save-restore-3.c scan-assembler-not call[ \t]*t0,__riscv_save_0
> FAIL: gcc.target/riscv/save-restore-3.c scan-assembler-not tail[ \t]*__riscv_restore_0
> FAIL: gcc.target/riscv/save-restore-3.c scan-assembler tail[ \t]*foo
> FAIL: gcc.target/riscv/save-restore-6.c scan-assembler-not call[ \t]*t0,__riscv_save_0
> FAIL: gcc.target/riscv/save-restore-6.c scan-assembler-not tail[ \t]*__riscv_restore_0
> FAIL: gcc.target/riscv/save-restore-6.c scan-assembler tail[ \t]*other_func
>
> if the definitions of UNSPECs are locally changed and GCC rebuilt from a
> dirty tree.
>
>         gcc/
>         * config/riscv/t-riscv (riscv-sr.o): Add $(TM_H) dependency.
> ---
> Hi,
>
>  Noticed while fiddling with `fmin'/`fmax' further.  As not a code change
> OK to apply despite stage 4?  Might be worth backporting too.
>
>   Maciej
> ---
>  gcc/config/riscv/t-riscv |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> gcc-riscv-sr-dep.diff
> Index: gcc/gcc/config/riscv/t-riscv
> ===================================================================
> --- gcc.orig/gcc/config/riscv/t-riscv
> +++ gcc/gcc/config/riscv/t-riscv
> @@ -6,7 +6,7 @@ riscv-builtins.o: $(srcdir)/config/riscv
>                 $(srcdir)/config/riscv/riscv-builtins.cc
>
>  riscv-sr.o: $(srcdir)/config/riscv/riscv-sr.cc $(CONFIG_H) \
> -  $(SYSTEM_H)
> +  $(SYSTEM_H) $(TM_H)
>         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
>                 $(srcdir)/config/riscv/riscv-sr.cc
>
  
Maciej W. Rozycki Feb. 8, 2022, 12:24 p.m. UTC | #2
On Mon, 7 Feb 2022, Kito Cheng wrote:

> OK to trunk, thanks for fixing this issue, I hit that issue before but
> I didn't figure out what happened...since that issue will disappear
> when I clean build :p

 Committed to trunk now, thanks for you review.

 How about release branches?

  Maciej
  
Kito Cheng Feb. 10, 2022, 8:19 a.m. UTC | #3
Hi Maciej:

OK for release branches, thanks!

On Tue, Feb 8, 2022 at 8:24 PM Maciej W. Rozycki <macro@embecosm.com> wrote:
>
> On Mon, 7 Feb 2022, Kito Cheng wrote:
>
> > OK to trunk, thanks for fixing this issue, I hit that issue before but
> > I didn't figure out what happened...since that issue will disappear
> > when I clean build :p
>
>  Committed to trunk now, thanks for you review.
>
>  How about release branches?
>
>   Maciej
  
Maciej W. Rozycki Feb. 14, 2022, 6:43 p.m. UTC | #4
On Thu, 10 Feb 2022, Kito Cheng wrote:

> OK for release branches, thanks!

 Backported to GCC 11 & 10 then; not needed for GCC 9.

  Maciej
  

Patch

Index: gcc/gcc/config/riscv/t-riscv
===================================================================
--- gcc.orig/gcc/config/riscv/t-riscv
+++ gcc/gcc/config/riscv/t-riscv
@@ -6,7 +6,7 @@  riscv-builtins.o: $(srcdir)/config/riscv
 		$(srcdir)/config/riscv/riscv-builtins.cc
 
 riscv-sr.o: $(srcdir)/config/riscv/riscv-sr.cc $(CONFIG_H) \
-  $(SYSTEM_H)
+  $(SYSTEM_H) $(TM_H)
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
 		$(srcdir)/config/riscv/riscv-sr.cc