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

            Bug ID: 92858
           Summary: [10 regression] spurious backslashes around switch
                    string in warning messages
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: minor
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ebotcazou at gcc dot gnu.org
  Target Milestone: ---

The switch string is printed between a pair of backslashes in warning messages,
which doesn't seem to be a progress.  Consider the following C file:

int A[128];

inline void
fill (int *a, int n)
{
  for (int i = 0; i < n; i++)
    a[i] = i * 2 - n;
}

int get (int i)
{
  fill (A, 128);
  return A[i];
}

compiled at -O -fno-early-inlining --param max-inline-insns-single=0 -Winline:

t.c: In function 'get':
t.c:4:1: warning: inlining failed in call to 'fill': --param
max-inline-insns-single limit reached [\-Winline\]
    4 | fill (int *a, int n)
      | ^~~~
t.c:12:3: note: called from here
   12 |   fill (A, 128);
      |   ^~~~~~~~~~~~~

With the GCC 9 compiler, the message is:

t.c: In function 'get':
t.c:4:1: warning: inlining failed in call to 'fill': --param
max-inline-insns-single limit reached [-Winline]
    4 | fill (int *a, int n)
      | ^~~~
t.c:12:3: note: called from here
   12 |   fill (A, 128);
      |   ^~~~~~~~~~~~~

which looks fine.

Reply via email to