From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16711 invoked by alias); 11 Dec 2014 12:10: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 16641 invoked by uid 48); 11 Dec 2014 12:10:40 -0000 From: "ramana at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/58623] lack of ldp/stp optimization Date: Thu, 11 Dec 2014 12:10: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: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: ramana at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: amker at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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-12/txt/msg01258.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58623 --- Comment #4 from Ramana Radhakrishnan --- (In reply to bin.cheng from comment #3) > Patch sent at https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02209.html > On latest trunk, the patch generates below assembly for the example: >=20 > .cpu generic+fp+simd > .file "pr58623.c" > .text > .align 2 > .global foo > .type foo, %function > foo: > adrp x0, .LANCHOR0 > add x2, x0, :lo12:.LANCHOR0 > ldr x1, [x0, #:lo12:.LANCHOR0] > ldr x0, [x2, 8] > add w0, w1, w0 > ret > .size foo, .-foo > .align 2 > .global bar > .type bar, %function > bar: > adrp x1, .LANCHOR0 > add x1, x1, :lo12:.LANCHOR0 > ldp w2, w0, [x1, 16] > add w0, w2, w0 > ret > .size bar, .-bar > .global d > .global c > .global b > .global a > .bss > .align 3 > .LANCHOR0 =3D . + 0 > .type a, %object > .size a, 8 > a: > .zero 8 > .type b, %object > .size b, 8 > b: > .zero 8 > .type c, %object > .size c, 4 > c: > .zero 4 > .type d, %object > .size d, 4 > d: > .zero 4 > .ident "GCC: (GNU) 5.0.0 20141118 (experimental)" >=20 > ldp opportunity in bar is captured, but not the one in foo. Apparently, > fwprop pass propagates the expression into memory reference, corrupting t= he > pair opportunity. This is another known issue for long time. So I think we should take the fwprop issue as a separate bug and close this= out for 5.0 as the main work required to generate ldp / stp in the compiler is = now done. >>From gcc-bugs-return-470252-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Dec 11 12:29:12 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 28268 invoked by alias); 11 Dec 2014 12:29:11 -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 28228 invoked by uid 48); 11 Dec 2014 12:29:08 -0000 From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64266] New: Can GCC produce local mergeable symbols for *.__FUNCTION__ and *.__PRETTY_FUNCTION__ function. Date: Thu, 11 Dec 2014 12:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org 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 cc attachments.created Message-ID: 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-12/txt/msg01259.txt.bz2 Content-length: 2294 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64266 Bug ID: 64266 Summary: Can GCC produce local mergeable symbols for *.__FUNCTION__ and *.__PRETTY_FUNCTION__ function. Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jason at gcc dot gnu.org Created attachment 34250 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34250&action=edit test case For the following testcase: extern "C" { extern int printf (char *, ...); } class a { public: void sub (int i) { printf ("__FUNCTION__ = %s\n", __FUNCTION__); printf ("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__); } void sub() { printf ("__FUNCTION__ = %s\n", __FUNCTION__); } }; int main (void) { a ax; ax.sub (0); ax.sub (); return 0; } Unlink clang, GCC produces a local symbol residing in .symtab and string values are not in mergeable section: $ g++ ~/Programming/testcases/pretty-function.c -o a.o $ readelf -s a.o --wide | grep PRE 15: 0000000000400710 17 OBJECT LOCAL DEFAULT 14 _ZZN1a3subEiE19__PRETTY_FUNCTION__ $ readelf -p '.rodata' a.out String dump of section '.rodata': [ 10] __FUNCTION__ = %s [ 23] __PRETTY_FUNCTION__ = %s [ 3d] sub [ 50] void a::sub(int) [ 61] sub and clang produces: $ clang++ ~/Programming/testcases/pretty-function.c -o a.o $ readelf -s a.out --wide | grep PRE (nothing) $ readelf -p '.rodata' a.o String dump of section '.rodata': [ 4] __FUNCTION__ = %s [ 17] sub [ 1b] __PRETTY_FUNCTION__ = %s [ 35] void a::sub(int) I'm wondering if we can also process such kind of optimization. For Inkscape (compiled with -O2), there are following differences: section portion size size compared comparison .rodata 15.69 % 2.41 MB 2523277 2291412 90.81 % .strtab 13.06 % 2.00 MB 2099988 1933845 92.09 % Where column 'size' is related to GCC and 'compared' is size generated by clang. Thanks, Martin