This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Can insns be combined across UNSPEC_VOLATILE.?


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

Attachment: unspec_ira.patch
Description: Text document

Attachment: sp.c
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]