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

            Bug ID: 111278
           Summary: error: call to ‘...’ declared with attribute error:
                    code path is reachable with -Og, but not -O2
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 55835
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55835&action=edit
accel_tcg_cputlb.c.i

Upstream QEMU say this is a compiler bug:
* https://gitlab.com/qemu-project/qemu/-/issues/1848
* https://gitlab.com/qemu-project/qemu/-/issues/1848#note_1540675831

Original report was downstream in Gentoo at https://bugs.gentoo.org/913083.

It builds fine with -O2, but fails with -Og:
```
$ gcc -m64 -mcx16 -O2 -Werror=implicit -Werror=return-type -c
accel_tcg_cputlb.c.i -march=amdfam10

$ gcc -m64 -mcx16 -Og -Werror=implicit -Werror=return-type -c
accel_tcg_cputlb.c.i -march=amdfam10
../accel/tcg/cputlb.c: In function ‘do_ld_mmio_beN’:
../accel/tcg/cputlb.c:2121:13: error: call to ‘qemu_build_not_reached_always’
declared with attribute error: code path is reachable
../accel/tcg/cputlb.c: In function ‘do_st_mmio_leN’:
../accel/tcg/cputlb.c:2764:13: error: call to ‘qemu_build_not_reached_always’
declared with attribute error: code path is reachable
```

This is with 13.2.1 20230902, not tried other versions yet except trunk which
also failed (14.0.0 20230827).

Reply via email to