From 033381118519f597dfb4f62614ffdec7f7b17390 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 6 Jan 2020 13:01:48 +0000 Subject: [PATCH] [AArch64] Use move-if-change for aarch64-tune.md If aarch64-tune.md was older than gentune.sh or aarch64-cores.def, we'd try to overwrite it even if the current contents were correct. This could cause problems with read-only source directories and could cause spurious copying for rsync --archive. 2020-01-06 Richard Sandiford gcc/ * config/aarch64/t-aarch64 ($(srcdir)/config/aarch64/aarch64-tune.md): Depend on... (s-aarch64-tune-md): ...this new stamp file. Pipe the new contents to a temporary file and use move-if-change to update the real file where necessary. From-SVN: r279900 --- gcc/ChangeLog | 8 ++++++++ gcc/config/aarch64/t-aarch64 | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 520562a1fc8..820a86f353d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2020-01-06 Richard Sandiford + + * config/aarch64/t-aarch64 ($(srcdir)/config/aarch64/aarch64-tune.md): + Depend on... + (s-aarch64-tune-md): ...this new stamp file. Pipe the new contents + to a temporary file and use move-if-change to update the real + file where necessary. + 2020-01-06 Richard Sandiford * config/aarch64/aarch64-sve.md (@aarch64_sel_dup): Use Upl diff --git a/gcc/config/aarch64/t-aarch64 b/gcc/config/aarch64/t-aarch64 index ed250ea1369..475d5c5e8af 100644 --- a/gcc/config/aarch64/t-aarch64 +++ b/gcc/config/aarch64/t-aarch64 @@ -24,11 +24,15 @@ OPTIONS_H_EXTRA += $(srcdir)/config/aarch64/aarch64-cores.def \ $(srcdir)/config/aarch64/aarch64-fusion-pairs.def \ $(srcdir)/config/aarch64/aarch64-tuning-flags.def -$(srcdir)/config/aarch64/aarch64-tune.md: $(srcdir)/config/aarch64/gentune.sh \ +$(srcdir)/config/aarch64/aarch64-tune.md: s-aarch64-tune-md; @true +s-aarch64-tune-md: $(srcdir)/config/aarch64/gentune.sh \ $(srcdir)/config/aarch64/aarch64-cores.def $(SHELL) $(srcdir)/config/aarch64/gentune.sh \ $(srcdir)/config/aarch64/aarch64-cores.def > \ + tmp-aarch64-tune.md + $(SHELL) $(srcdir)/../move-if-change tmp-aarch64-tune.md \ $(srcdir)/config/aarch64/aarch64-tune.md + $(STAMP) s-aarch64-tune-md aarch64-builtins.o: $(srcdir)/config/aarch64/aarch64-builtins.c $(CONFIG_H) \ $(SYSTEM_H) coretypes.h $(TM_H) \ -- 2.30.2