This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch to solve PR64291
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Vladimir Makarov <vmakarov at redhat dot com>, Marc Glisse <marc dot glisse at inria dot fr>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 28 Dec 2014 07:35:25 -0800
- Subject: Re: patch to solve PR64291
- Authentication-results: sourceware.org; auth=none
- References: <54933E72 dot 6070702 at redhat dot com> <CAMe9rOoLyxou2+HxhBuLUMun3RRyNCPOt7_haBS9pEVafiNmdw at mail dot gmail dot com> <CAMe9rOrdwipd6x0sL+wg=yi6AXdiu8EsWW7vLk=U6cpU3f9YSw at mail dot gmail dot com>
On Sun, Dec 28, 2014 at 7:34 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Dec 28, 2014 at 7:28 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Thu, Dec 18, 2014 at 12:52 PM, Vladimir Makarov <vmakarov@redhat.com> wrote:
>>> The following patch solves
>>>
>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291
>>>
>>> It is a bug in a new rematerialization subpass of LRA.
>>>
>>> The patch was bootstrapped on x86/x86-64.
>>>
>>> Committed as rev. 218874.
>>>
>>> 2014-12-18 Vladimir Makarov <vmakarov@redhat.com>
>>>
>>> PR rtl-optimization/64291
>>> * lra-remat.c (bad_for_rematerialization_p): Add UNPSEC_VLOATILE.
>>> (create_cands): Process only output reload insn with potential
>>> cands.
>>>
>>> 2014-12-18 Vladimir Makarov <vmakarov@redhat.com>
>>>
>>> PR rtl-optimization/64291
>>> * testsuite/gcc.target/i386/pr64291-[12].c: New tests.
>>>
>>
>> There are a couple problems with the testcase:
>>
>> 1. It has
>>
>> typedef struct
>> {
>> int _mp_size;
>> unsigned long *_mp_d;
>> } __mpz_struct;
>> typedef __mpz_struct mpz_t[1];
>>
>> int main ()
>> {
>> mpz_t n, d;
>> long nn, dn;
>> unsigned long *np, *dup, *dnp, *qp;
>> long alloc, itch;
>>
>> f (n);
>> f (d);
>> qp = (unsigned long*)__builtin_alloca(4099*8) + 1;
>> dnp = (unsigned long*)__builtin_alloca (2049*8);
>> alloc = 1;
>> for (test = 0; test < 1; test++)
>> {
>> dn = d->_mp_size;
>> dup = d->_mp_d;
>> f (dnp, dup, dn);
>> dnp[dn - 1] |= 1UL<<63;
>>
>> For 32-bit targets, like -m32 and -mx32, GCC complains:
>>
>> /export/gnu/import/git/gcc/gcc/testsuite/gcc.target/i386/pr64291-1.c:33:25:
>> warning: left shift count >= width of type [-Wshift-count-overflow]
>>
>> 2. This program uses uninitialized stack variable n, d:
>>
>> void f(void*p,...){}
>>
>> The behavior of this testcase is totally undefined.
>>
>
> I opened:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291
>
Oops. I meant:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64427
--
H.J.