This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/52883] ICE in simplify_const_unary_operation, at simplify-rtx.c:1464
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 06 Apr 2012 12:36:06 +0000
- Subject: [Bug rtl-optimization/52883] ICE in simplify_const_unary_operation, at simplify-rtx.c:1464
- Auto-submitted: auto-generated
- References: <bug-52883-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52883
Uros Bizjak <ubizjak at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
AssignedTo|ubizjak at gmail dot com |unassigned at gcc dot
| |gnu.org
--- Comment #6 from Uros Bizjak <ubizjak at gmail dot com> 2012-04-06 12:36:06 UTC ---
(In reply to comment #3)
> Just that it makes no sense. Please fix whoever generated it instead.
OK, tracing this a bit deeper:
#0 internal_error (gmsgid=0x111f5e0 "in %s, at %s:%d") at
../../gcc-svn/trunk/gcc/diagnostic.c:839
#1 0x0000000000e1cda4 in fancy_abort (file=<optimized out>, line=1464,
function=0xef4380 "simplify_const_unary_operation")
at ../../gcc-svn/trunk/gcc/diagnostic.c:899
#2 0x0000000000881783 in simplify_const_unary_operation (code=<optimized out>,
mode=DImode, op=0x7ffff19ad470, op_mode=<optimized out>)
at ../../gcc-svn/trunk/gcc/simplify-rtx.c:1464
#3 0x000000000087f4d0 in simplify_unary_operation (code=ZERO_EXTEND,
mode=DImode, op=0x7ffff19ad470, op_mode=VOIDmode)
at ../../gcc-svn/trunk/gcc/simplify-rtx.c:579
#4 0x00000000005ec860 in cselib_expand_value_rtx_1 (orig=<optimized out>,
evd=0x7fffffffd950, max_depth=<optimized out>)
at ../../gcc-svn/trunk/gcc/cselib.c:1805
The problem starts at cselib.c, where:
/* If an operand has been simplified into CONST_INT, which doesn't
have a mode and the mode isn't derivable from whole rtx's mode,
try simplify_*_operation first with mode from original's operand
and as a fallback wrap CONST_INT into gen_rtx_CONST. */
We do have specializations for this case:
switch (GET_RTX_CLASS (code))
{
case RTX_UNARY:
if (CONST_INT_P (XEXP (copy, 0))
&& GET_MODE (XEXP (orig, 0)) != VOIDmode)
{
scopy = simplify_unary_operation (code, mode, XEXP (copy, 0),
GET_MODE (XEXP (orig, 0)));
if (scopy)
return scopy;
}
break;
...
But, since we have VOIDmode operand, we should do as the comment says and wrap
CONST_INT with CONST. However, we directly hit:
scopy = simplify_rtx (copy);
if (scopy)
return scopy;
return copy;
where simplify_rtx just passes problematic RTX to simplify_unary_operation.
Leaving this to RTX experts, since the code does not match the comment.