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

            Bug ID: 103465
           Summary: Invalid note with -fno-reorder-blocks-and-partition
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tomas.kalibera at gmail dot com
  Target Milestone: ---

With GCC 10.3.0 and 11.2.0, compiling this example with

-O2 -fno-reorder-blocks-and-partition

for Windows emits a note

uwi.c:3:9: note: '-freorder-blocks-and-partition' does not support unwind info
on this architecture
    3 | #pragma GCC optimize ("unroll-loops")
      |         ^~~
uwi.c:5:1: note: '-freorder-blocks-and-partition' does not support unwind info
on this architecture
    5 | int main(int argc, char **argv) {
      | ^~~

(even though asking GCC to _not_ perform that optimization)

#include<stdio.h>

#pragma GCC optimize ("unroll-loops")

int main(int argc, char **argv) {
  printf("Hello 1\n");
  printf("Hello 2\n");
  printf("Hello 3\n");
  return 0;
}

This note is emitted twice for this example and many times for bigger examples,
also for other GCC optimization options pragmas. The outputs can become large
(e.g. building R CRAN packages increased log file from about 1G to 12G).

The note is also emitted when -freorder-blocks-and-partition is given
(explicitly), which is probably intended, but it is not emitted when the
optimization is used implicitly as part of -O2.

The same problem exists with g++, except the wording of the note is "does not
work with exceptions on this architecture"

With "12.0" (5e5f880d0452ef2cffb94f4a686d56833c9f4215), the note is not emitted
with -fno-reorder-blocks-and-partition, however, the other problem remains. The
note is still not emitted when the optimization is enabled implicitly via -O2.

Related to Bug 103274; the reason for using -fno-reorder-blocks-and-partition
was to get valid unwind information for long jumps to work.

Reply via email to