From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19344 invoked by alias); 17 Oct 2014 07:20:53 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19305 invoked by uid 48); 17 Oct 2014 07:20:50 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/58945] Improve atomic_compare_and_swap*_doubleword pattern Date: Fri, 17 Oct 2014 07:20:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: steven at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-10/txt/msg01335.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58945 --- Comment #5 from Uro=C5=A1 Bizjak --- Created attachment 33744 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D33744&action=3Dedit Simplified patch Somehow simplified patch for mainline. Still fails with -O2 -mcx16: atomic-store-6.c: In function =E2=80=98main=E2=80=99: atomic-store-6.c:13:1: error: unable to find a register to spill } ^ atomic-store-6.c:13:1: error: this is the insn: (insn 9 48 47 3 (parallel [ (set (reg:TI 101 [86]) (unspec_volatile:TI [ (mem/v:TI (symbol_ref:DI ("i") ) [-1 S16 A128]) (reg:TI 101 [86]) (reg:DI 102 [99]) (reg:DI 99) (const_int 5 [0x5]) ] UNSPECV_CMPXCHG)) (set (mem/v:TI (symbol_ref:DI ("i") ) [-1 S16 A128]) (unspec_volatile:TI [ (const_int 0 [0]) ] UNSPECV_CMPXCHG)) (set (reg:CCZ 17 flags) (unspec_volatile:CCZ [ (const_int 0 [0]) ] UNSPECV_CMPXCHG)) ]) atomic-store-6.c:9 4876 {atomic_compare_and_swapti_doubleword} (expr_list:REG_DEAD (reg:DI 102 [99]) (nil))) atomic-store-6.c:13:1: internal compiler error: in assign_by_spills, at lra-assigns.c:1363 >>From gcc-bugs-return-464315-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Oct 17 07:25:02 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 22800 invoked by alias); 17 Oct 2014 07:25:02 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 22375 invoked by uid 48); 17 Oct 2014 07:24:57 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/63566] [5 Regression] i686 bootstrap fails: ICE RTL flag check: INSN_UID used with unexpected rtx code 'set' in INSN_UID, at rtl.h:1326 Date: Fri, 17 Oct 2014 07:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-10/txt/msg01336.txt.bz2 Content-length: 3579 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63566 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |5.0 --- Comment #5 from Jakub Jelinek --- Self-contained testcase (-m32 -O2 to reproduce): #define A \ x += y * z; \ y = (y << ((z & 2) + 1)) \ ^ (y >> (__SIZEOF_INT__ * __CHAR_BIT__ - (z & 2) - 1)); \ z *= 7; #define B A A A A A A A A A A #define C B B B B B B B B B B static unsigned int f1 (unsigned int x, unsigned int y, unsigned int z) { C return x + y + z; } static unsigned int f2 (unsigned int x, unsigned int y, unsigned int z) { C return x + y + z; } __attribute__((noinline, noclone)) unsigned int f3 (unsigned int x, unsigned int y, unsigned int z) { return f1 (x, z, y) + 6; } __attribute__((noinline, noclone)) unsigned int f4 (unsigned int x, unsigned int y, unsigned int z) { return f2 (y, x, z) + 7; } __attribute__((noinline, noclone, used)) unsigned int f5 (unsigned int x, unsigned int y, unsigned int z) { return f1 (2 * x, z / 2, y + 3) - 6; } __attribute__((noinline, noclone, used)) unsigned int f6 (unsigned int x, unsigned int y, unsigned int z) { return f2 (y + 2, x | 1, z / 73) + 1; } int main () { unsigned int x = f3 (0x173214, 0x182172, 0x9314); unsigned int y = f4 (0x173214, 0x182172, 0x9314); #if __SIZEOF_INT__ * __CHAR_BIT__ == 32 if (x != 0xd8e56f78U || y != 0x494c6699U) __builtin_abort (); #endif return 0; } BTW, this testcase also shows that the debug info state of ICF is not really solved: grep '\.set' h.s; grep -A2 'DIE.*\(DW_TAG_subprogram\|DW_TAG_GNU_call_site)\)' h.s .set f1,f2 .uleb128 0x3 # (DIE (0x2f) DW_TAG_subprogram) .ascii "f2\0" # DW_AT_name .byte 0x1 # DW_AT_decl_file (/tmp/h.c) -- .uleb128 0x5 # (DIE (0x6f) DW_TAG_subprogram) # DW_AT_external .ascii "f3\0" # DW_AT_name -- .uleb128 0x7 # (DIE (0xab) DW_TAG_GNU_call_site) .long .LVL559 # DW_AT_low_pc .byte 0 # end of children of DIE 0x6f .uleb128 0x5 # (DIE (0xb1) DW_TAG_subprogram) # DW_AT_external .ascii "f4\0" # DW_AT_name -- .uleb128 0x8 # (DIE (0xed) DW_TAG_GNU_call_site) .long .LVL561 # DW_AT_low_pc .long 0x2f # DW_AT_abstract_origin -- .uleb128 0x5 # (DIE (0x10d) DW_TAG_subprogram) # DW_AT_external .ascii "f5\0" # DW_AT_name -- .uleb128 0x7 # (DIE (0x149) DW_TAG_GNU_call_site) .long .LVL563 # DW_AT_low_pc .byte 0 # end of children of DIE 0x10d .uleb128 0x5 # (DIE (0x14f) DW_TAG_subprogram) # DW_AT_external .ascii "f6\0" # DW_AT_name -- .uleb128 0x8 # (DIE (0x18b) DW_TAG_GNU_call_site) .long .LVL565 # DW_AT_low_pc .long 0x2f # DW_AT_abstract_origin -- shows that 1) there is no DW_TAG_subprogram for f1 emitted (what exactly should be the content of it is up to the discussions with GDB folks I guess, either pretty much a copy of DW_TAG_subprogram for f2 with adjusted real type if needed, perhaps different names of arguments etc., or some way to refer to f2 subprogram DIE and telling it is ICF merged) 2) probably because of that DW_TAG_GNU_call_site in f3 and f5 don't have DW_AT_abstract_origin, meaning that even if the debugger had right code to handle ICF, it could not, because we are not telling it that we were calling f1 there