On Wed, May 3, 2017 at 9:38 AM, Bin.Cheng <[email protected]> wrote:
> On Wed, May 3, 2017 at 7:17 AM, Eric Botcazou <[email protected]> wrote:
>>> 2017-04-11 Bin Cheng <[email protected]>
>>>
>>> * rtlanal.c (rtx_cost): Handle TRUNCATE between tieable modes.
>>
>> This breaks bootstrap with RTL checking:
>>
>> /home/eric/build/gcc/native/./gcc/xgcc -B/home/eric/build/gcc/native/./gcc/ -
>> nostdinc -x c /dev/null -S -o /dev/null -fself-
>> test=/home/eric/svn/gcc/gcc/testsuite/selftests
>> cc1: internal compiler error: RTL check: expected code 'subreg', have
>> 'truncate' in rtx_cost, at rtlanal.c:4169
>> 0xbae338 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
>> char const*)
>> /home/eric/svn/gcc/gcc/rtl.c:829
>> 0xbbc9b4 rtx_cost(rtx_def*, machine_mode, rtx_code, int, bool)
>> /home/eric/svn/gcc/gcc/rtlanal.c:4169
>> 0x8517e6 set_src_cost
>> /home/eric/svn/gcc/gcc/rtl.h:2685
>> 0x8517e6 init_expmed_one_conv
>> /home/eric/svn/gcc/gcc/expmed.c:142
>> 0x8517e6 init_expmed_one_mode
>> /home/eric/svn/gcc/gcc/expmed.c:209
>> 0x853fb2 init_expmed()
>> /home/eric/svn/gcc/gcc/expmed.c:270
>> 0xc45974 backend_init_target
>> /home/eric/svn/gcc/gcc/toplev.c:1665
>> 0xc45974 initialize_rtl()
>>
> Sorry for disturbing, I will revert this if can't fix today.
It looks bogus and I couldn't find the motivating case for it, so
revert with attached patch. Build on x86 and commit as obvious.
Thanks,
bin
2017-05-03 Bin Cheng <[email protected]>
Revert
2017-05-02 Bin Cheng <[email protected]>
* rtlanal.c (rtx_cost): Handle TRUNCATE between tieable modes.
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index f18245f..321363f 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -4164,14 +4164,6 @@ rtx_cost (rtx x, machine_mode mode, enum rtx_code
outer_code,
return COSTS_N_INSNS (2 + factor);
break;
- case TRUNCATE:
- /* If we can tie these modes, make this cheap. */
- if (MODES_TIEABLE_P (mode, GET_MODE (SUBREG_REG (x))))
- {
- total = 0;
- break;
- }
- /* FALLTHRU */
default:
if (targetm.rtx_costs (x, mode, outer_code, opno, &total, speed))
return total;