Can insns be combined across UNSPEC_VOLATILE.?

Christian Bruel christian.bruel@st.com
Fri Nov 5 16:42:00 GMT 2010


Hello,

The attached tests fails on SH4 when compiled with:

-fstack-protector-all -Os  -fpic  -fnon-call-exceptions sp.c 
-fomit-frame-pointer -S -fno-regmove

The cause is that 2 insns have been combined by ira, despite an blockage 
insns, causing a spill failure for R0.

so we have before ira:

(set (reg:SI 3 r3 [174])
   (plus:SI (reg/f:SI 3 r3 [173]) (reg:SI 12 r12)))

(unspec_volatile [
             (const_int 0 [0x0])
         ] 0) 287 {blockage} (nil))

set (reg:SI 5 r5 [172])
         (mem/u/c:SI (reg:SI 3 r3 [174])

combined into

(set (reg/f:SI 2 r2 [172])
         (mem/u/c:SI (plus:SI (reg/f:SI 1 r1 [173])
                 (reg:SI 12 r12))

Can I assume than the unspec_volatile should prevent that ? Quickly 
fixing the problem with the illustrative attached patch solves it.

Many thanks

Christian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unspec_ira.patch
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20101105/b415c71b/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sp.c
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20101105/b415c71b/attachment.c>


More information about the Gcc-help mailing list