public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/54063] New: [4.8 regression] on powerpc64 gcc 4.8 generates larger code for global variable accesses than gcc 4.7
@ 2012-07-21 12:05 mikpe at it dot uu.se
  2012-07-21 18:47 ` [Bug target/54063] " mikpe at it dot uu.se
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: mikpe at it dot uu.se @ 2012-07-21 12:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54063

             Bug #: 54063
           Summary: [4.8 regression] on powerpc64 gcc 4.8 generates larger
                    code for global variable accesses than gcc 4.7
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mikpe@it.uu.se


Consider this trivial test case, which scans for an element in a doubly-linked
list that uses a separate sentinel object to represent the head and tail of the
list:

struct list {
    struct list *next, *prev;
    int k;
} head = { &head, &head, 0 };

int lookup(int k)
{
    struct list *list = head.next;
    while (list != &head) {
        if (list->k == k)
            return 1;
        list = list->next;
    }
    return 0;
}

The code generated by gcc 4.8 and 4.7 on powerpc64-linux for this test case is
similar, except gcc 4.8 generates an additional instruction at the start of the
function when computing the address of the global variable 'head':

@@ -11,25 +11,26 @@
        .previous
        .type   lookup, @function
 .L.lookup:
+       addis 10,2,.LANCHOR0@toc@ha
        addis 8,2,.LANCHOR0@toc@ha
-       ld 9,.LANCHOR0@toc@l(8)
+       ld 9,.LANCHOR0@toc@l(10)
        addi 8,8,.LANCHOR0@toc@l
        cmpd 7,9,8

The rest is the same, modulo the numbers chosen for the labels.

The test case is reduced from similar code in the Linux kernel, see PR54062.


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2023-07-07 10:29 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21 12:05 [Bug target/54063] New: [4.8 regression] on powerpc64 gcc 4.8 generates larger code for global variable accesses than gcc 4.7 mikpe at it dot uu.se
2012-07-21 18:47 ` [Bug target/54063] " mikpe at it dot uu.se
2012-07-23  2:14 ` amodra at gmail dot com
2012-07-23  8:27 ` rguenth at gcc dot gnu.org
2012-09-19 13:57 ` rguenth at gcc dot gnu.org
2012-12-04 13:05 ` jakub at gcc dot gnu.org
2013-03-22 14:44 ` [Bug target/54063] [4.8/4.9 regression] on powerpc64 gcc 4.8/4.9 " jakub at gcc dot gnu.org
2013-05-31 10:58 ` jakub at gcc dot gnu.org
2013-10-16  9:49 ` jakub at gcc dot gnu.org
2013-10-25 11:10 ` rguenth at gcc dot gnu.org
2014-05-22  9:03 ` [Bug target/54063] [4.8/4.9/4.10 regression] on powerpc64 gcc 4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:25 ` [Bug target/54063] [4.8/4.9/5 regression] on powerpc64 gcc 4.8/4.9/5 " jakub at gcc dot gnu.org
2015-03-24 18:47 ` steven at gcc dot gnu.org
2015-06-23  8:17 ` [Bug target/54063] [4.8/4.9/5/6 regression] on powerpc64 gcc 4.8/4.9/5/6 " rguenth at gcc dot gnu.org
2015-06-26 19:55 ` [Bug target/54063] [4.9/5/6 regression] on powerpc64 gcc 4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:27 ` jakub at gcc dot gnu.org
2020-03-12 11:58 ` [Bug target/54063] [8/9/10 regression] on powerpc64 gcc 4.9/8 " jakub at gcc dot gnu.org
2021-06-01  8:05 ` [Bug target/54063] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-11-30 14:38 ` roger at nextmovesoftware dot com
2021-11-30 17:00 ` segher at gcc dot gnu.org
2022-05-27  9:34 ` [Bug target/54063] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:30 ` jakub at gcc dot gnu.org
2023-04-20  8:46 ` [Bug target/54063] [10/11/12/13/14 " guihaoc at gcc dot gnu.org
2023-07-07 10:29 ` [Bug target/54063] [11/12/13/14 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).