public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/103465] Invalid note with -fno-reorder-blocks-and-partition
Date: Thu, 09 Dec 2021 13:39:45 +0000	[thread overview]
Message-ID: <bug-103465-4-v4LKperQpg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103465-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
> However, still talking about the current master only, I see a difference
> with -O3, when I try on the repro example from Bug 103274 and -O3:
> 
> x86_64-w64-mingw32-gcc -c -S -O3 -fno-reorder-blocks-and-partition a.c -o
> nropt.s
> 
> x86_64-w64-mingw32-gcc -c -S -O3 -freorder-blocks-and-partition a.c -o ropt.s
> x86_64-w64-mingw32-gcc -c -S -O3  a.c -o noopt.s
> 
> All of these assembler files are different (and from my non-expert reading,
> noopt.s uses the optimization and does have the invalid unwind information
> as reported in Bug 103274). Is the optimization correctly dropped also with
> -O3 only?

Hmmm, I've just tested the same with the locally built cross-compiler:
~/Programming/gcc/configure --enable-languages=c,c++
--prefix=/home/marxin/bin/gcc --disable-multilib --enable-host-shared
--disable-libsanitizer --enable-valgrind-annotations --disable-bootstrap
--target=x86_64-w64-mingw32

and it works fine, all 3 assembly files are identical.

cat 1.s
        .file   "pr103274.c"
        .text
        .section .rdata,"dr"
.LC0:
        .ascii "factor\0"
        .text
        .p2align 4
        .globl  _Z5dummyP7SEXPREC
        .def    _Z5dummyP7SEXPREC;      .scl    2;      .type   32;     .endef
        .seh_proc       _Z5dummyP7SEXPREC
_Z5dummyP7SEXPREC:
.LFB2:
        pushq   %r13
        .seh_pushreg    %r13
        pushq   %r12
        .seh_pushreg    %r12
        pushq   %rbp
        .seh_pushreg    %rbp
        pushq   %rdi
        .seh_pushreg    %rdi
        pushq   %rsi
        .seh_pushreg    %rsi
        pushq   %rbx
        .seh_pushreg    %rbx
        subq    $40, %rsp
        .seh_stackalloc 40
        .seh_endprologue
        movq    %rcx, %r12
        call    _Z11mypredicateP7SEXPREC
        testl   %eax, %eax
        jne     .L21
.L2:
        movq    .refptr.R_NilValue(%rip), %rax
        movq    (%rax), %rax
        addq    $40, %rsp
        popq    %rbx
        popq    %rsi
        popq    %rdi
        popq    %rbp
        popq    %r12
        popq    %r13
        ret
        .p2align 4,,10
        .p2align 3
.L21:
        movq    %r12, %rcx
        call    _Z11mygetattribP7SEXPREC
        movq    %rax, %rcx
        movq    %rax, %r13
        call    _Z8mylengthP7SEXPREC
        movl    %eax, %ebp
        testl   %eax, %eax
        jle     .L2
        movl    %eax, %r12d
        movl    $1, %esi
        leaq    .LC0(%rip), %rdi
        jmp     .L6
        .p2align 4,,10
        .p2align 3
.L8:
        movq    %rax, %rsi
.L6:
        movzbl  0(%r13), %ebx
        andl    $1, %ebx
        je      .L3
        leal    -1(%rsi), %edx
        movq    %r13, %rcx
        call    _Z11myaltstringP7SEXPRECi
        movq    %rdi, %rdx
        movq    %rax, %rcx
        addq    $8, %rcx
        call    _Z6strcmpPKcS0_
        testl   %eax, %eax
        je      .L5
.L22:
        cmpq    %r12, %rsi
        je      .L2
        leaq    1(%rsi), %rax
        testb   %bl, %bl
        jne     .L8
        movslq  %esi, %rsi
.L7:
        movq    8(%r13,%rsi,8), %rax
        movq    %rdi, %rdx
        leaq    8(%rax), %rcx
        call    _Z6strcmpPKcS0_
        testl   %eax, %eax
        je      .L5
        addq    $1, %rsi
        cmpl    %esi, %ebp
        jg      .L7
        jmp     .L2
        .p2align 4,,10
        .p2align 3
.L3:
        movq    0(%r13,%rsi,8), %rcx
        movq    %rdi, %rdx
        addq    $8, %rcx
        call    _Z6strcmpPKcS0_
        testl   %eax, %eax
        jne     .L22
.L5:
        call    _Z11myerrorcallv
        nop
        .seh_endproc
        .ident  "GCC: (GNU) 12.0.0 20211209 (experimental)"
        .def    _Z11mypredicateP7SEXPREC;       .scl    2;      .type   32;    
.endef
        .def    _Z11mygetattribP7SEXPREC;       .scl    2;      .type   32;    
.endef
        .def    _Z8mylengthP7SEXPREC;   .scl    2;      .type   32;     .endef
        .def    _Z11myaltstringP7SEXPRECi;      .scl    2;      .type   32;    
.endef
        .def    _Z6strcmpPKcS0_;        .scl    2;      .type   32;     .endef
        .def    _Z11myerrorcallv;       .scl    2;      .type   32;     .endef
        .section        .rdata$.refptr.R_NilValue, "dr"
        .globl  .refptr.R_NilValue
        .linkonce       discard
.refptr.R_NilValue:
        .quad   R_NilValue

  parent reply	other threads:[~2021-12-09 13:39 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 10:00 [Bug rtl-optimization/103465] New: " tomas.kalibera at gmail dot com
2021-11-29 10:12 ` [Bug rtl-optimization/103465] " marxin at gcc dot gnu.org
2021-11-29 10:17 ` tomas.kalibera at gmail dot com
2021-11-29 10:18 ` marxin at gcc dot gnu.org
2021-11-29 13:23 ` marxin at gcc dot gnu.org
2021-11-29 15:25 ` tomas.kalibera at gmail dot com
2021-12-09 13:39 ` marxin at gcc dot gnu.org [this message]
2021-12-09 13:40 ` marxin at gcc dot gnu.org
2021-12-09 14:37 ` tomas.kalibera at gmail dot com
2021-12-09 14:41 ` tomas.kalibera at gmail dot com
2021-12-09 14:44 ` tomas.kalibera at gmail dot com
2021-12-09 15:24 ` tomas.kalibera at gmail dot com
2021-12-09 15:28 ` marxin at gcc dot gnu.org
2021-12-09 15:44 ` marxin at gcc dot gnu.org
2021-12-09 15:53 ` tomas.kalibera at gmail dot com
2021-12-09 15:55 ` tomas.kalibera at gmail dot com
2021-12-09 19:29 ` marxin at gcc dot gnu.org
2021-12-28 10:05 ` [Bug driver/103465] " cvs-commit at gcc dot gnu.org
2021-12-28 10:06 ` marxin at gcc dot gnu.org
2022-01-06  7:32 ` [Bug driver/103465] [12 regression] -freorder-blocks-and-partition broken on 64-bit Windows ebotcazou at gcc dot gnu.org
2022-01-06  9:51 ` marxin at gcc dot gnu.org
2022-01-06 11:42 ` ebotcazou at gcc dot gnu.org
2022-01-06 12:47 ` marxin at gcc dot gnu.org
2022-01-06 13:45 ` ebotcazou at gcc dot gnu.org
2022-01-06 13:50 ` marxin at gcc dot gnu.org
2022-01-06 14:07 ` tomas.kalibera at gmail dot com
2022-01-06 17:17 ` [Bug target/103465] " ebotcazou at gcc dot gnu.org
2022-01-06 22:18 ` tomas.kalibera at gmail dot com
2022-01-07  9:50 ` tomas.kalibera at gmail dot com
2022-01-07 17:33 ` tomas.kalibera at gmail dot com
2022-01-10 11:44 ` cvs-commit at gcc dot gnu.org
2022-01-10 16:06 ` cvs-commit at gcc dot gnu.org
2022-01-10 16:06 ` cvs-commit at gcc dot gnu.org
2022-01-10 16:07 ` cvs-commit at gcc dot gnu.org
2022-01-10 16:09 ` ebotcazou at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103465-4-v4LKperQpg@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).