This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: (set (reg:SI ) (scratch:SI)) unrecognizable insn
On Sat, Oct 3, 2009 at 6:03 PM, Kim, Eunchan <helpbygrace@gmail.com> wrote:
> Hello everyone.
>
> Here is Thanksgiving day. Everyone went to hometown. But still i'm
> porting gcc. :(
>
> anyway, while i'm compiling libgcc, i got a error message.
>
>>>-----------
> ../../../../sdk/gcc-4.3.3/libgcc/../gcc/unwind-dw2.c: In function
> ‘uw_install_context_1’:
> ../../../../sdk/gcc-4.3.3/libgcc/../gcc/unwind-dw2.c:1532: error:
> unrecognizable insn:
> (insn 217 80 81 14
> ../../../../sdk/gcc-4.3.3/libgcc/../gcc/unwind-dw2.c:1503 (set (reg:SI
> 1 r1)
> ? ? ? ?(scratch:SI)) -1 (nil))
> ../../../../sdk/gcc-4.3.3/libgcc/../gcc/unwind-dw2.c:1532: internal
> compiler error: in extract_insn, at recog.c:1990
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> --------------<<
>
> the statement is memcpy in unwind-dw2.c:1503
>
>>>------------ unwind-dw2.c:1500-1505
> ? ? ?if (dwarf_reg_size_table[i] == sizeof (_Unwind_Word))
> ? ? ? ?{
> ? ? ? ? ?w = (_Unwind_Internal_Ptr) t;
> ? ? ? ? ?memcpy (c, &w, sizeof (_Unwind_Word));
> ? ? ? ?}
> ? ? ?else
> -----------------<<
>
> memcpy is just a function call. so i can not understand why the
> compiler try to set some value into register.
>
> Also, i've known that (scratch:m ) is used with clobber RTL. But
> scratch is used without (clobber ) in the error message.
>
> Do i specify this RTL into machine description file? or... did i write
> something wrong ?
>
> -- Eunchan
>
One interest thing is that same memcpy is called right below it.
>>-------------- unwind-dw2.c:1500-1511
if (target->by_value[i] && c)
{
_Unwind_Word w;
_Unwind_Ptr p;
if (dwarf_reg_size_table[i] == sizeof (_Unwind_Word))
{
w = (_Unwind_Internal_Ptr) t;
memcpy (c, &w, sizeof (_Unwind_Word));
}
else
{
gcc_assert (dwarf_reg_size_table[i] == sizeof (_Unwind_Ptr));
p = (_Unwind_Internal_Ptr) t;
memcpy (c, &p, sizeof (_Unwind_Ptr));
}
}
------------------------<<
i commented out the error code ( line 1503 ). then, the error is not occured.
_Unwind_Word is __attribute__((__mode__(__unwind_word__))). and
_Unwind_Ptr is __attribute((__mode__(__pointer__))).
t is 'void *' (void pointer). So, in my opinion, the size of
_Unwind_Word and void * are different. But i'm not sure. I can not
find the way to see the size of _Unwind_Word and _Unwind_Ptr.
In addition, I do not know why a instruction RTL is changed to (set
reg scratch) pattern. the original expanded rtl of :1503 is
>>------------------------ unwind-dw2.c.131r.expand
;; memcpy (c, &w, 4)
(insn 78 77 79 ../../../../sdk/gcc-4.3.3/libgcc/../gcc/unwind-dw2.c:1503
(set (reg:SI 74)
(plus:SI (reg/f:SI 33 virtual-stack-vars)
(const_int 4 [0x4]))) -1 (nil))
(insn 79 78 80 ../../../../sdk/gcc-4.3.3/libgcc/../gcc/unwind-dw2.c:1503
(set (reg:SI 75)
(mem/c/i:SI (reg:SI 74) [0 w+0 S4 A32])) -1 (nil))
(insn 80 79 81 ../../../../sdk/gcc-4.3.3/libgcc/../gcc/unwind-dw2.c:1503
(set (mem:BLK (reg/v/f:SI 43 [ c ]) [0 S4 A8])
(unspec:BLK [
(reg:SI 75)
(mem:QI (plus:SI (reg/v/f:SI 43 [ c ])
(const_int 3 [0x3])) [0 S1 A8])
] 20)) -1 (nil))
(insn 81 80 0 ../../../../sdk/gcc-4.3.3/libgcc/../gcc/unwind-dw2.c:1503
(parallel [
(set (mem:BLK (reg/v/f:SI 43 [ c ]) [0 S4 A8])
(unspec:BLK [
(reg:SI 75)
(mem:QI (reg/v/f:SI 43 [ c ]) [0 S1 A8])
(mem:BLK (reg/v/f:SI 43 [ c ]) [0 S4 A8])
] 21))
(clobber (scratch:SI))
]) -1 (nil))
----------------------<<
anyone give me an advice?
-- Eunchan