Bug 82020 - ICE in decompose at rtl.h:2126
Summary: ICE in decompose at rtl.h:2126
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-08-29 11:23 UTC by Tom de Vries
Modified: 2017-11-20 08:28 UTC (History)
0 users

See Also:
Host:
Target: gcn
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2017-08-29 11:23:06 UTC
$ gcc -O1 -S pr28776-2.c 
gcc/testsuite/gcc.c-torture/compile/pr28776-2.c: In function 'encode_line':
gcc/testsuite/gcc.c-torture/compile/pr28776-2.c:26:1: internal compiler error: in decompose, at rtl.h:2126
0x9fac75 wi::int_traits<std::pair<rtx_def*, machine_mode> >::decompose(long*, unsigned int, std::pair<rtx_def*, machine_mode> const&)
        gcc/rtl.h:2124
0xa33264 wide_int_ref_storage<false>::wide_int_ref_storage<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*, machine_mode> const&, unsigned int)
        gcc/wide-int.h:976
0xa33212 generic_wide_int<wide_int_ref_storage<false> >::generic_wide_int<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*, machine_mode> const&, unsigned int)
        gcc/wide-int.h:753
0xe36629 bool wi::eq_p<std::pair<rtx_def*, machine_mode>, std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*, machine_mode> const&, std::pair<rtx_def*, machine_mode> const&)
        gcc/wide-int.h:1747
0xe31241 simplify_const_relational_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
        gcc/simplify-rtx.c:5131
0xe2fd0c simplify_relational_operation(rtx_code, machine_mode, machine_mode, rtx_def*, rtx_def*)
        gcc/simplify-rtx.c:4614
0xe32d00 simplify_ternary_operation(rtx_code, machine_mode, machine_mode, rtx_def*, rtx_def*, rtx_def*)
        gcc/simplify-rtx.c:5641
0x1467932 combine_simplify_rtx
        gcc/combine.c:5599
0x14676c3 subst
        gcc/combine.c:5517
0x1467472 subst
        gcc/combine.c:5462
0x1460c6e try_combine
        gcc/combine.c:3332
0x145b790 combine_instructions
        gcc/combine.c:1294
0x147ee78 rest_of_handle_combine
        gcc/combine.c:14663
0x147ef38 execute
        gcc/combine.c:14708
Comment 1 Tom de Vries 2017-08-29 11:25:02 UTC
Happens on this  rtl:
...
#13 0x0000000001467933 in combine_simplify_rtx (x=0x7ffff7424c20, op0_mode=BImode, in_dest=0, in_cond=0)
    at gcc/combine.c:5599
5599                                             XEXP (x, 1), XEXP (x, 2));
(gdb) call debug_rtx (x)
(if_then_else (lt:BI (const_int -2147483648 [0xffffffff80000000])
        (const_int 0 [0]))
    (label_ref 13)
    (pc))
...
Comment 3 Tom de Vries 2017-08-29 11:29:12 UTC
Unfortunately, haven't been able to reproduce this with an upstream branch yet.
Comment 4 Tom de Vries 2017-11-20 08:21:07 UTC
Author: vries
Date: Mon Nov 20 08:20:35 2017
New Revision: 254944

URL: https://gcc.gnu.org/viewcvs?rev=254944&root=gcc&view=rev
Log:
Fix comparison mode in simplify_ternary_operation

2017-11-20  Tom de Vries  <tom@codesourcery.com>

	PR rtl-optimization/82020
	* simplify-rtx.c (simplify_ternary_operation): Fix comparison mode of
	IF_THEN_ELSE condition.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/simplify-rtx.c
Comment 5 Tom de Vries 2017-11-20 08:28:25 UTC
Patch committed to trunk, test-case not required.

Marking resolved-fixed.