Patchwork [RFA,alpha] : Fix PR 57379, segfault in invalidate_any_buried_refs

login
register
mail settings
Submitter Uros Bizjak
Date June 10, 2013, 1:58 p.m.
Message ID <CAFULd4aKEk+A5EpdpgFy3d4zdsJc7+-UoBDjAQMZZ4ogpbB0FA@mail.gmail.com>
Download mbox | patch
Permalink /patch/250252/
State New
Headers show

Comments

Uros Bizjak - June 10, 2013, 1:58 p.m.
On Thu, May 23, 2013 at 7:20 PM, Richard Henderson <rth@redhat.com> wrote:
> On 05/23/2013 12:38 AM, Uros Bizjak wrote:
>> 2013-05-23  Uros Bizjak  <ubizjak@gmail.com>
>>
>>     * config/alpha/alpha.md (unspec): Add UNSPEC_XFLT_COMPARE.
>>     * config/alpha/alpha.c (alpha_emit_xfloating_compare): Construct
>>     REG_EQUAL note as UNSPEC_XFLT_COMPARE unspec.
>>
>> Patch was bootstrapped and regression tested on alphaev68-linux-gnu.
>>
>> OK for mainline and release branches?
>>
>> [1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57379
>
> Ok.

Actually, backport uncovered the problem with different compares,
which now shared the same REG_EQUAL note. Attached patch fixes this
oversight.

2013-06-10  Uros Bizjak  <ubizjak@gmail.com>

    * config/alpha/alpha.c (alpha_emit_xfloating_compare): Also use
    cmp_code to construct REG_EQUAL note.

Tested on alphaev68-pc-linux-gnu and committed to mainline SVN.

Uros.

Patch

Index: alpha.c
===================================================================
--- alpha.c    (revision 199788)
+++ alpha.c    (working copy)
@@ -3068,7 +3068,8 @@  alpha_emit_xfloating_compare (enum rtx_code *pcode
   out = gen_reg_rtx (DImode);

   /* What's actually returned is -1,0,1, not a proper boolean value.  */
-  note = gen_rtx_UNSPEC (DImode, gen_rtvec (2, op0, op1), UNSPEC_XFLT_COMPARE);
+  note = gen_rtx_fmt_ee (cmp_code, VOIDmode, op0, op1);
+  note = gen_rtx_UNSPEC (DImode, gen_rtvec (1, note), UNSPEC_XFLT_COMPARE);
   alpha_emit_xfloating_libcall (func, out, operands, 2, note);

   return out;