I'm getting the following assembler error with current gcc 4.3. This worked with 20070604 and is probably due to the dataflow merge. This is possible the same as, or related to, PR32337, but I cannot tell for sure. tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O2 -fno-omit-frame-pointer skalibs-dns_transmit.c /tmp/cc1yk7fL.s: Assembler messages: /tmp/cc1yk7fL.s:93: Warning: .restore outside of body region /tmp/cc1yk7fL.s:101: Error: .prologue within prologue Testcase: struct dns_transmit { }; firstudp (struct dns_transmit *d) { } firsttcp (struct dns_transmit *d) { } dns_transmit_start (struct dns_transmit *d, char const *q) { unsigned int len; len = dns_domain_length (q); if (len > 512) return firsttcp (d); return firstudp (d); }
I can make the warning message go away by using -fno-schedule-insns2.
The thing that changed is that new dataflow now allows moving around the (set (r12) (something)) frame related instructions within EBBs during scheduling more easily. These are generated for the sibcall epilogues before sibling calls and also for epilogue before br.ret. ia64.c unwind generation code assumes that the frame related r12 setting insns say in the same BB (while scheduling works with EBBs) and emits .body and .copy_state at the start of next BB after .label_state, but in this case we want it another BB later. I'll attach 3 possible fixes, one is to add blockage like we do for current_frame_info.total_size != 0 or cfun->machine->ia64_eh_epilogue_sp functions when we need frame pointer (and thus emit the r12 = something frame related insn), the other is the same but only emit the blockage in sibcall epilogues. The last one I'm ATM bootstrapping/regtesting doesn't limit the scheduling in anyway, instead adds a little state machine to control the addition of .label_state/.restore sp, .prologue, .body and .copy_state. If that works, it would e.g. also fix unnecessary .body directives when already in .body region.
Created attachment 13934 [details] gcc43-pr32338-1.patch
Created attachment 13935 [details] gcc43-pr32338-2.patch
Created attachment 13936 [details] gcc43-pr32338-3.patch
Created attachment 13938 [details] gcc43-pr32338-3.patch Testing showed I was wrong with the .body and we need duplicate .body even when there was no second .prologue. This updated patch has been bootstrapped/regtested on ia64-linux.
Can an ia64-maintainer approve one of the patches Jakub has suggested?
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128446