From: Uros Bizjak Date: Mon, 10 Jun 2013 18:45:02 +0000 (+0200) Subject: backport: re PR target/57379 (Segfault in invalidate_any_buried_refs (x=0x0) at ... X-Git-Tag: releases/gcc-4.7.4~623 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83f93b63111f1ce27832d806ecfcc0ab9a6c39fe;p=thirdparty%2Fgcc.git backport: re PR target/57379 (Segfault in invalidate_any_buried_refs (x=0x0) at ../../gcc-svn/trunk/gcc/gcse.c:3850) Backport from mainline 2013-06-10 Uros Bizjak * config/alpha/alpha.c (alpha_emit_xfloating_compare): Also use cmp_code to construct REG_EQUAL note. Backport from mainline 2013-06-05 Uros Bizjak * config/alpha/alpha.c (alpha_emit_conditional_move): Swap all GE, GT, GEU and GTU compares, modulo DImode compares with zero. Backport from mainline 2013-05-23 Uros Bizjak PR target/57379 * 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. From-SVN: r199902 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f74e049046af..82071ffc2120 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,25 @@ +2013-06-07 Uros Bizjak + + Backport from mainline + 2013-06-10 Uros Bizjak + + * config/alpha/alpha.c (alpha_emit_xfloating_compare): Also use + cmp_code to construct REG_EQUAL note. + + Backport from mainline + 2013-06-05 Uros Bizjak + + * config/alpha/alpha.c (alpha_emit_conditional_move): Swap all + GE, GT, GEU and GTU compares, modulo DImode compares with zero. + + Backport from mainline + 2013-05-23 Uros Bizjak + + PR target/57379 + * 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. + 2013-06-09 Jakub Jelinek PR target/57568 diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index f27c08a8cf89..388e77d977e6 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -2658,12 +2658,12 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode) break; case GE: case GT: case GEU: case GTU: - /* These must be swapped. */ - if (op1 != CONST0_RTX (cmp_mode)) - { - code = swap_condition (code); - tem = op0, op0 = op1, op1 = tem; - } + /* These normally need swapping, but for integer zero we have + special patterns that recognize swapped operands. */ + if (cmp_mode == DImode && op1 == const0_rtx) + break; + code = swap_condition (code); + tem = op0, op0 = op1, op1 = tem; break; default: @@ -3025,12 +3025,9 @@ alpha_emit_xfloating_compare (enum rtx_code *pcode, rtx op0, rtx op1) operands[1] = op1; out = gen_reg_rtx (DImode); - /* What's actually returned is -1,0,1, not a proper boolean value, - so use an EXPR_LIST as with a generic libcall instead of a - comparison type expression. */ - note = gen_rtx_EXPR_LIST (VOIDmode, op1, NULL_RTX); - note = gen_rtx_EXPR_LIST (VOIDmode, op0, note); - note = gen_rtx_EXPR_LIST (VOIDmode, func, note); + /* What's actually returned is -1,0,1, not a proper boolean value. */ + 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; diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index e715cc86422c..bab04e4e566c 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -25,6 +25,7 @@ ;; Uses of UNSPEC in this file: (define_c_enum "unspec" [ + UNSPEC_XFLT_COMPARE UNSPEC_ARG_HOME UNSPEC_LDGP1 UNSPEC_INSXH