This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix reload1.c warning for some targets
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, richard dot sandiford at arm dot com, rdsandiford at googlemail dot com
- Date: Mon, 24 Aug 2015 12:50:46 +0200
- Subject: Re: Fix reload1.c warning for some targets
- Authentication-results: sourceware.org; auth=none
- References: <87d1z1kedx dot fsf at e105548-lin dot cambridge dot arm dot com> <55CB7F88 dot 5040104 at redhat dot com> <87bnebc4or dot fsf at googlemail dot com>
Richard Sandiford <rdsandiford@googlemail.com> writes:
> Jeff Law <law@redhat.com> writes:
>> On 08/05/2015 08:18 AM, Richard Sandiford wrote:
>>> Building some targets results in a warning about orig_dup[i] potentially
>>> being used uninitialised. I think the warning is fair, since it isn't
>>> obvious that the reog_data-based loop bound remains unchanged between:
>>>
>>> for (i = 0; i < recog_data.n_dups; i++)
>>> orig_dup[i] = *recog_data.dup_loc[i];
>>>
>>> and:
>>>
>>> for (i = 0; i < recog_data.n_dups; i++)
>>> *recog_data.dup_loc[i] = orig_dup[i];
>>>
>>> Tested on x86_64-linux-gnu. OK to install?
>>>
>>> Thanks,
>>> Richard
>>>
>>> gcc/
>>> * reload1.c (elimination_costs_in_insn): Make it obvious to the
>>> compiler that the n_dups and n_operands loop bounds are invariant.
>> So thinking more about this, I think the best way forward is to:
>>
>> 1. Create a new BZ with the false positive extracted from c#4.
>>
>> 2. Install your patch and close 55035.
>>
>> I'll take care of #1, you can handle #2.
>
> Thanks, I've now done #2.
Unfortunately the patch broke sparcv9-sun-solaris2* (only,
sparc-sun-solaris2* is fine) bootstrap:
/vol/gcc/src/hg/trunk/local/gcc/reload1.c: In function 'void elimination_costs_in_insn(rtx_insn*)':
/vol/gcc/src/hg/trunk/local/gcc/reload1.c:3772:41: error: 'orig_dup[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
*recog_data.dup_loc[i] = orig_dup[i];
^
/vol/gcc/src/hg/trunk/local/gcc/reload1.c:3772:41: error: 'orig_dup[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University