This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix potential uninitialized variable error
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Xinliang David Li <davidxl at google dot com>, Uros Bizjak <ubizjak at gmail dot com>, Jan Hubicka <jh at suse dot cz>
- Cc: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 14 Aug 2013 22:53:58 +0200
- Subject: Re: Fix potential uninitialized variable error
- References: <CAAkRFZKgm2nCNe-Kpq=5K8zKsU_FAtk5tLw+c-bP9e+o-c18aA at mail dot gmail dot com> <20130814181755 dot GV17022 at redhat dot com> <20130814182346 dot GT1814 at tucnak dot redhat dot com> <CAAkRFZLOGXOJ-MmUtgDtSAZ-1mJjuXbZGWegRY7h_fQmvNBmJA at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Aug 14, 2013 at 01:50:31PM -0700, Xinliang David Li wrote:
> Here is the clean up patch. Ok for trunk?
Ok.
> --- config/i386/i386.c (revision 201735)
> +++ config/i386/i386.c (working copy)
> @@ -2792,7 +2792,6 @@ static const char *stringop_alg_names[]
>
> struct stringop_size_range
> {
> - int min;
> int max;
> stringop_alg alg;
> bool noalign;
> @@ -2815,7 +2814,7 @@ ix86_parse_stringop_strategy_string (cha
>
> do
> {
> - int mins = 0, maxs;
> + int maxs;
> stringop_alg alg;
> char alg_name[128];
> char align[16];
> @@ -2831,7 +2830,7 @@ ix86_parse_stringop_strategy_string (cha
> return;
> }
>
> - if (n > 0 && (maxs < (mins = input_ranges[n - 1].max + 1) && maxs != -1))
> + if (n > 0 && (maxs < (input_ranges[n - 1].max + 1) && maxs != -1))
> {
> error ("size ranges of option %s should be increasing",
> is_memset ? "-mmemset_strategy=" : "-mmemcpy_strategy=");
> @@ -2855,7 +2854,6 @@ ix86_parse_stringop_strategy_string (cha
> return;
> }
>
> - input_ranges[n].min = mins;
> input_ranges[n].max = maxs;
> input_ranges[n].alg = alg;
> if (!strcmp (align, "align"))
Jakub