From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20839 invoked by alias); 16 Sep 2014 23:01:15 -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 20813 invoked by uid 48); 16 Sep 2014 23:01:11 -0000 From: "anton at samba dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/63281] New: powerpc64le creates 64 bit constants from scratch instead of loading them Date: Tue, 16 Sep 2014 23:01: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: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anton at samba dot 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 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-09/txt/msg01732.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63281 Bug ID: 63281 Summary: powerpc64le creates 64 bit constants from scratch instead of loading them Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: anton at samba dot org The following testcase: #define CONST1 0x1234567812345678 #define CONST2 0x2345678123456781 #define CONST3 0x3456781234567812 #define CONST4 0x4567812345678123 #define CONST5 0x5678123456781234 #define CONST6 0x6781234567812345 #define CONST7 0x7812345678123456 #define CONST8 0x8123456781234567 void foo(unsigned long *a, unsigned long *b, unsigned long *c, unsigned long *d, unsigned long *e, unsigned long *f, unsigned long *g, unsigned long *h) { *a = CONST1; *b = CONST2; *c = CONST3; *d = CONST4; *e = CONST5; *f = CONST6; *g = CONST7; *h = CONST8; } produces some pretty horrible code. We really should be loading the constants. This looks to be present on 4.8, 4.9 and 5.0. foo: std 27,-40(1) std 28,-32(1) lis 27,0x1234 lis 28,0x2345 std 29,-24(1) std 30,-16(1) lis 29,0x3456 lis 30,0x4567 std 31,-8(1) lis 31,0x5678 ori 27,27,0x5678 ori 28,28,0x6781 ori 29,29,0x7812 ori 30,30,0x8123 ori 31,31,0x1234 sldi 27,27,32 sldi 28,28,32 sldi 29,29,32 sldi 30,30,32 sldi 31,31,32 lis 12,0x6781 lis 0,0x7812 lis 11,0x8123 oris 27,27,0x1234 oris 28,28,0x2345 oris 29,29,0x3456 oris 30,30,0x4567 oris 31,31,0x5678 ori 27,27,0x5678 ori 28,28,0x6781 ori 29,29,0x7812 ori 30,30,0x8123 ori 31,31,0x1234 std 27,0(3) ld 27,-40(1) ori 12,12,0x2345 ori 0,0,0x3456 std 28,0(4) std 29,0(5) ori 11,11,0x4567 sldi 12,12,32 std 30,0(6) ld 28,-32(1) ld 29,-24(1) sldi 0,0,32 sldi 11,11,32 std 31,0(7) ld 30,-16(1) ld 31,-8(1) oris 12,12,0x6781 oris 0,0,0x7812 oris 11,11,0x8123 ori 12,12,0x2345 ori 0,0,0x3456 ori 11,11,0x4567 std 12,0(8) std 0,0(9) std 11,0(10) blr