riscv: Fix genrvv-type-indexer dependencies

Message ID ZC6Uzf9gu8sWW7+K@tucnak
State Unresolved
Headers
Series riscv: Fix genrvv-type-indexer dependencies |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jakub Jelinek April 6, 2023, 9:45 a.m. UTC
  Hi!

I've noticed
make: Circular build/genrvv-type-indexer.o <- gtype-desc.h dependency dropped.

The following patch fixes that.  The RTL_BASE_H variable includes a lot of
headers which the generator doesn't include, including gtype-desc.h.
I've preprocessed it and checked all gcc/libiberty headers against what is
included in the other dependency variables and here is what I found:
1) coretypes.h includes align.h, poly-int.h and poly-int-types.h which
   weren't listed (most of dependencies are thankfully done automatically,
   so it isn't that big deal except for these generators and the like)
2) system.h includes filenames.h (already listed) but filenames.h includes
   hashtab.h; instead of adding FILENAMES_H I've just added the dependency
   to SYSTEM_H
3) $(RTL_BASE_H) wasn't really needed at all and insn-modes.h is already
   included in $(CORETYPES_H)

I'll bootstrap/regtest this on x86_64-linux tonight, ok for trunk?

2023-04-06  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.in (CORETYPES_H): Depend on align.h, poly-int.h and
	poly-int-types.h.
	(SYSTEM_H): Depend on $(HASHTAB_H).
	* config/riscv/t-riscv (build/genrvv-type-indexer.o): Remove unused
	dependency on $(RTL_BASE_H), remove redundant dependency on
	insn-modes.h.



	Jakub
  

Comments

Kito Cheng April 6, 2023, 1:58 p.m. UTC | #1
LGTM, thanks :)

On Thu, Apr 6, 2023 at 5:46 PM Jakub Jelinek via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi!
>
> I've noticed
> make: Circular build/genrvv-type-indexer.o <- gtype-desc.h dependency dropped.
>
> The following patch fixes that.  The RTL_BASE_H variable includes a lot of
> headers which the generator doesn't include, including gtype-desc.h.
> I've preprocessed it and checked all gcc/libiberty headers against what is
> included in the other dependency variables and here is what I found:
> 1) coretypes.h includes align.h, poly-int.h and poly-int-types.h which
>    weren't listed (most of dependencies are thankfully done automatically,
>    so it isn't that big deal except for these generators and the like)
> 2) system.h includes filenames.h (already listed) but filenames.h includes
>    hashtab.h; instead of adding FILENAMES_H I've just added the dependency
>    to SYSTEM_H
> 3) $(RTL_BASE_H) wasn't really needed at all and insn-modes.h is already
>    included in $(CORETYPES_H)
>
> I'll bootstrap/regtest this on x86_64-linux tonight, ok for trunk?
>
> 2023-04-06  Jakub Jelinek  <jakub@redhat.com>
>
>         * Makefile.in (CORETYPES_H): Depend on align.h, poly-int.h and
>         poly-int-types.h.
>         (SYSTEM_H): Depend on $(HASHTAB_H).
>         * config/riscv/t-riscv (build/genrvv-type-indexer.o): Remove unused
>         dependency on $(RTL_BASE_H), remove redundant dependency on
>         insn-modes.h.
>
> --- gcc/Makefile.in.jj  2023-03-21 11:04:19.034831460 +0100
> +++ gcc/Makefile.in     2023-04-06 10:55:58.457207062 +0200
> @@ -945,7 +945,8 @@ TARGET_DEF_H = target-def.h target-hooks
>  C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \
>    $(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h
>  CORETYPES_H = coretypes.h insn-modes.h signop.h wide-int.h wide-int-print.h \
> -  insn-modes-inline.h $(MACHMODE_H) double-int.h
> +  insn-modes-inline.h $(MACHMODE_H) double-int.h align.h poly-int.h \
> +  poly-int-types.h
>  RTL_BASE_H = $(CORETYPES_H) rtl.h rtl.def reg-notes.def \
>    insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \
>    $(FIXED_VALUE_H) alias.h $(HASHTAB_H)
> @@ -998,7 +999,8 @@ C_COMMON_H = c-family/c-common.h c-famil
>  C_PRAGMA_H = c-family/c-pragma.h $(CPPLIB_H)
>  C_TREE_H = c/c-tree.h $(C_COMMON_H) $(DIAGNOSTIC_H)
>  SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
> -       $(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h
> +       $(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h \
> +       $(HASHTAB_H)
>  PREDICT_H = predict.h predict.def
>  CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
>         $(srcdir)/../libcpp/include/cpplib.h
> --- gcc/config/riscv/t-riscv.jj 2023-03-31 09:26:47.996219555 +0200
> +++ gcc/config/riscv/t-riscv    2023-04-06 10:56:48.166479250 +0200
> @@ -102,8 +102,8 @@ $(common_out_file): $(srcdir)/config/ris
>      $(srcdir)/config/riscv/riscv-protos.h \
>      $(srcdir)/config/riscv/riscv-subset.h
>
> -build/genrvv-type-indexer.o: $(srcdir)/config/riscv/genrvv-type-indexer.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)      \
> -  $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) insn-modes.h
> +build/genrvv-type-indexer.o: $(srcdir)/config/riscv/genrvv-type-indexer.cc $(BCONFIG_H) $(SYSTEM_H)    \
> +  $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H)
>
>  build/genrvv-type-indexer$(build_exeext): build/genrvv-type-indexer.o
>         +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \
>
>
>         Jakub
>
  

Patch

--- gcc/Makefile.in.jj	2023-03-21 11:04:19.034831460 +0100
+++ gcc/Makefile.in	2023-04-06 10:55:58.457207062 +0200
@@ -945,7 +945,8 @@  TARGET_DEF_H = target-def.h target-hooks
 C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \
   $(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h
 CORETYPES_H = coretypes.h insn-modes.h signop.h wide-int.h wide-int-print.h \
-  insn-modes-inline.h $(MACHMODE_H) double-int.h
+  insn-modes-inline.h $(MACHMODE_H) double-int.h align.h poly-int.h \
+  poly-int-types.h
 RTL_BASE_H = $(CORETYPES_H) rtl.h rtl.def reg-notes.def \
   insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \
   $(FIXED_VALUE_H) alias.h $(HASHTAB_H)
@@ -998,7 +999,8 @@  C_COMMON_H = c-family/c-common.h c-famil
 C_PRAGMA_H = c-family/c-pragma.h $(CPPLIB_H)
 C_TREE_H = c/c-tree.h $(C_COMMON_H) $(DIAGNOSTIC_H)
 SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
-	$(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h
+	$(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h \
+	$(HASHTAB_H)
 PREDICT_H = predict.h predict.def
 CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
 	$(srcdir)/../libcpp/include/cpplib.h
--- gcc/config/riscv/t-riscv.jj	2023-03-31 09:26:47.996219555 +0200
+++ gcc/config/riscv/t-riscv	2023-04-06 10:56:48.166479250 +0200
@@ -102,8 +102,8 @@  $(common_out_file): $(srcdir)/config/ris
     $(srcdir)/config/riscv/riscv-protos.h \
     $(srcdir)/config/riscv/riscv-subset.h
 
-build/genrvv-type-indexer.o: $(srcdir)/config/riscv/genrvv-type-indexer.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
-  $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H) insn-modes.h
+build/genrvv-type-indexer.o: $(srcdir)/config/riscv/genrvv-type-indexer.cc $(BCONFIG_H) $(SYSTEM_H)	\
+  $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H)
 
 build/genrvv-type-indexer$(build_exeext): build/genrvv-type-indexer.o
 	+$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \