From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29935 invoked by alias); 31 Oct 2013 19:25:45 -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 29906 invoked by uid 48); 31 Oct 2013 19:25:41 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/58945] New: Improve atomic_compare_and_swap*_doubleword pattern Date: Thu, 31 Oct 2013 19:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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: 2013-10/txt/msg02352.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58945 Bug ID: 58945 Summary: Improve atomic_compare_and_swap*_doubleword pattern Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: ubizjak at gmail dot com Created attachment 31126 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D31126&action=3Dedit Patch to simplify atomic_compare_and_swap_doubleword pattern Currently, gcc generates lots of unnecessary moves for following testcase (actually gcc.dg/atomic-store-6.c): --cut here-- __int128_t i; int main() { __atomic_store_16(&i, -1, 0); if (i !=3D -1) __builtin_abort(); return 0; } --cut here-- gcc -O2 -mcx16: movq i(%rip), %rsi movq $-1, %rcx movq i+8(%rip), %rdi .L2: movq %rsi, %rax movq %rdi, %rdx movq %rcx, %rbx lock cmpxchg16b i(%rip) movq %rdx, %rdi movq %rax, %rsi jne .L2 I have experimented with sync x86_64 pattern, to see if we can simplify atomic_compare_and_swap_doubleword pattern, so it would work with real doublemode values and this way remove unnecessary register moves. However, I have hit an ICE in assing_by_spills that prevents me from using these simplifications: gcc -O2 -mcx16 atomic-store-6.c: In function =E2=80=98main=E2=80=99: atomic-store-6.c:13:1: internal compiler error: in assign_by_spills, at lra-assigns.c:1281 } ^ 0x883e7f assign_by_spills ../../gcc-svn/trunk/gcc/lra-assigns.c:1281 0x884320 lra_assign() ../../gcc-svn/trunk/gcc/lra-assigns.c:1439 Please submit a full bug report, I believe that the pattern is correct, and LRA is tripping on some unknown issue. >>From gcc-bugs-return-433209-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Oct 31 19:26:59 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 30991 invoked by alias); 31 Oct 2013 19:26:59 -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 30961 invoked by uid 48); 31 Oct 2013 19:26:56 -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: Thu, 31 Oct 2013 19:26: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: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_gcctarget bug_status cf_reconfirmed_on cc everconfirmed bug_severity 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: 2013-10/txt/msg02353.txt.bz2 Content-length: 692 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58945 Uro=C5=A1 Bizjak changed: What |Removed |Added ---------------------------------------------------------------------------- Target| |x86 Status|UNCONFIRMED |NEW Last reconfirmed| |2013-10-31 CC| |vmakarov at gcc dot gnu.org Ever confirmed|0 |1 Severity|normal |enhancement --- Comment #1 from Uro=C5=A1 Bizjak --- Confirmed as an enhancement. >>From gcc-bugs-return-433210-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Oct 31 20:25:32 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 11719 invoked by alias); 31 Oct 2013 20:25:31 -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 11672 invoked by uid 48); 31 Oct 2013 20:25:26 -0000 From: "octoploid at yandex dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/58946] New: [4.9 Regression] internal compiler error: in operator[], at vec.h:722 Date: Thu, 31 Oct 2013 20:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: octoploid at yandex dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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: 2013-10/txt/msg02354.txt.bz2 Content-length: 2249 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58946 Bug ID: 58946 Summary: [4.9 Regression] internal compiler error: in operator[], at vec.h:722 Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: octoploid at yandex dot com Building dev-util/kdevplatform-1.5.2 ICEs. markus@x4 tmp % cat test.ii class A { public: A(int p1) : m_index(p1) { if (!p1) m_index =3D DummyMask; } enum { DummyMask =3D 1 << 31 }; unsigned m_fn1() const { int a; a =3D m_index & DummyMask; if (a) return 0; return m_index; } unsigned m_index; }; class B { public: int contains___trans_tmp_4; void m_fn1(int &p1) { const A &b =3D p1; contains___trans_tmp_4 =3D b.m_fn1(); } }; void fn1(A p1, B &p2) { int c; c =3D p1.m_fn1(); p2.m_fn1(c); } markus@x4 tmp % g++ -c -O2 test.ii test.ii: In function =E2=80=98void fn1(A, B&)=E2=80=99: test.ii:28:6: internal compiler error: in operator[], at vec.h:722 void fn1(A p1, B &p2) { ^ 0xc819a7 vec::operator[](unsigned int) ../../gcc/gcc/vec.h:722 0xc84207 vec::operator[](unsigned int) ../../gcc/gcc/tree.h:2806 0xc84207 vec::operator[](unsigned int) ../../gcc/gcc/vec.h:1152 0xc84207 update_ops ../../gcc/gcc/tree-ssa-reassoc.c:2619 0xc8c1fa maybe_optimize_range_tests ../../gcc/gcc/tree-ssa-reassoc.c:2907 0xc8c1fa reassociate_bb ../../gcc/gcc/tree-ssa-reassoc.c:4325 0xc8b927 reassociate_bb ../../gcc/gcc/tree-ssa-reassoc.c:4482 0xc8b927 reassociate_bb ../../gcc/gcc/tree-ssa-reassoc.c:4482 0xc8e2db do_reassoc ../../gcc/gcc/tree-ssa-reassoc.c:4515 0xc8e2db execute_reassoc ../../gcc/gcc/tree-ssa-reassoc.c:4597 0xc8e2db execute ../../gcc/gcc/tree-ssa-reassoc.c:4639 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. Looks related to PR58911. >>From gcc-bugs-return-433211-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Oct 31 20:51:43 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 7119 invoked by alias); 31 Oct 2013 20:51:42 -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 7055 invoked by uid 48); 31 Oct 2013 20:51:36 -0000 From: "mikpelinux at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/58943] wrong calculation of indirect structure member arithmetic via function call Date: Thu, 31 Oct 2013 20:51:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: mikpelinux at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created 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: 2013-10/txt/msg02355.txt.bz2 Content-length: 962 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58943 Mikael Pettersson changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikpelinux at gmail dot com --- Comment #1 from Mikael Pettersson --- Created attachment 31127 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31127&action=edit reduced test case I believe this bug is real, and a dup or variation of PR48814, the difference being that PR48814 had a postfix ++ while here we have a compound assignment (|=). According to Joseph's comment in the same interleaving restrictions apply to ++ and |=. The bug appears to trigger when the lvalue is a non-scalar. It doesn't have to be a struct member, an array element (as in this test case) suffices.