http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52883
--- Comment #4 from Uros Bizjak <ubizjak at gmail dot com> 2012-04-06 11:18:35
UTC ---
(In reply to comment #3)
> > simplify_const_unary_operation tries to simplify:
> >
> > (zero_extend:DI (const_int 0 [0]))
> >
> > and trips on assert where:
> >
> > /* When zero-extending a CONST_INT, we need to know its
> > original mode. */
> >
> > There is nothing wrong with the above RTX, so there is no justification to
> > trigger the ICE.
>
> Just that it makes no sense. Please fix whoever generated it instead.
It is allowed in *zero_extendsidi2_rex64, and "0" propagates into the pattern
for some corner case. For the affected part, 4.7 generates:
.L3:
movl $0, %eax # 42 *zero_extendsidi2_rex64/1
movl g(,%rax,4), %ebx # 44 *movsi_internal/1
jmp .L8 # 60 jump
while 4.8 (with the above fix) generates:
.L3:
movl $0, %eax # 42 *zero_extendsidi2_rex64/1
movl g(,%rax,4), %ebx # 44 *movsi_internal/1
jmp .L8 # 60 jump
I fail to see why zero_extending a constant should trigger an ICE, while at the
same time sign_extending a constant is allowed (please see following lines in
both cases).