diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-03-02 10:19:28 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-03-02 10:19:28 +0100 |
commit | d5a216fa21f6c67e75a91b7063d1767cff00138b (patch) | |
tree | 9bdb7b7a6aa1ef3d390e533d7e1b59fb6cab5053 /gcc/genemit.c | |
parent | da403f3178095ddf49c62994874f52650e3f5a4a (diff) | |
download | gcc-d5a216fa21f6c67e75a91b7063d1767cff00138b.zip gcc-d5a216fa21f6c67e75a91b7063d1767cff00138b.tar.gz gcc-d5a216fa21f6c67e75a91b7063d1767cff00138b.tar.bz2 |
re PR tree-optimization/79345 (passing yet-uninitialized member as argument to base class constructor should warn (-Wunitialized))
PR tree-optimization/79345
* gensupport.h (struct pattern_stats): Add min_scratch_opno field.
* gensupport.c (get_pattern_stats_1) <case MATCH_SCRATCH>: Update it.
(get_pattern_stats): Initialize it.
* genemit.c (gen_expand): Verify match_scratch numbers come after
match_operand/match_dup numbers.
* config/i386/i386.md (<s>mul<mode>3_highpart): Swap match_dup and
match_scratch numbers.
* config/i386/sse.md (avx2_gathersi<mode>, avx2_gatherdi<mode>):
Likewise.
* config/s390/s390.md (trunctdsd2): Likewise.
From-SVN: r245833
Diffstat (limited to 'gcc/genemit.c')
-rw-r--r-- | gcc/genemit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/genemit.c b/gcc/genemit.c index 4ef29e9..7bf745d 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -448,6 +448,10 @@ gen_expand (md_rtx_info *info) /* Find out how many operands this function has. */ get_pattern_stats (&stats, XVEC (expand, 1)); + if (stats.min_scratch_opno != -1 + && stats.min_scratch_opno <= MAX (stats.max_opno, stats.max_dup_opno)) + fatal_at (info->loc, "define_expand for %s needs to have match_scratch " + "numbers above all other operands", XSTR (expand, 0)); /* Output the function name and argument declarations. */ printf ("rtx\ngen_%s (", XSTR (expand, 0)); @@ -479,8 +483,6 @@ gen_expand (md_rtx_info *info) make a local variable. */ for (i = stats.num_generator_args; i <= stats.max_dup_opno; i++) printf (" rtx operand%d;\n", i); - for (; i <= stats.max_scratch_opno; i++) - printf (" rtx operand%d ATTRIBUTE_UNUSED;\n", i); printf (" rtx_insn *_val = 0;\n"); printf (" start_sequence ();\n"); @@ -516,7 +518,7 @@ gen_expand (md_rtx_info *info) (unless we aren't going to use them at all). */ if (XVEC (expand, 1) != 0) { - for (i = 0; i < stats.num_operand_vars; i++) + for (i = 0; i <= MAX (stats.max_opno, stats.max_dup_opno); i++) { printf (" operand%d = operands[%d];\n", i, i); printf (" (void) operand%d;\n", i); |