This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/66215] [4.8/4.9/5/6 Regression] Wrong after label NOP emission for -mhotpatch


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66215

--- Comment #1 from Martin LiÅka <marxin at gcc dot gnu.org> ---
Following testcase is wrongly compiled event with -O2 optimization level.

$ cat o2-test-case.c
static int a;

int t(int tt)
{
  switch (tt)
  {
    case 1: return a;
  }

  return 0;
}

$ ./xgcc -B. -mhotpatch=2,3 -O2 -fno-inline -o /tmp/test.s -S o2-test-case.c
$ head -n20 /tmp/test.s

        .file   "o2-test-case.c"
.text
        .align  8
.globl t
        .type   t, @function
        nopr    %r7     # pre-label NOPs for hotpatch (2 halfwords)
        nopr    %r7
        # alignment for hotpatch
        .align  8
t:
marxin@marxinbox:~/Programming/gcc2/objdir/gcc> head -n20 /tmp/test.s
        .file   "o2-test-case.c"
.text
        .align  8
.globl t
        .type   t, @function
        nopr    %r7     # pre-label NOPs for hotpatch (2 halfwords)
        nopr    %r7
        # alignment for hotpatch
        .align  8
t:
        # post-label NOPs for hotpatch (3 halfwords)
.LFB0:
        st      %r14,56(%r15)
        nop     0
        nopr    %r7
.LCFI0:
        l       %r4,56(%r15)
        lhi     %r2,0
        l       %r14,56(%r15)
.LCFI1:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]