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

            Bug ID: 90854
           Summary: Gcc fails to compile a code sample for some parameters
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhonghao at pku dot org.cn
  Target Milestone: ---

My gcc is 10.0.0, and the code is:

class A
{
 int m_fn1 (void *);
 int m_fn2 (bool);
};
inline int
A::m_fn2 (bool)
{
 static __attribute__ ((section (""))) int a;
 if (a)
 ;
 return 0;
}

int
A::m_fn1 (void *)
{
 return m_fn2 (0);
}

gcc accepts the code, with some parameters: gcc -Os | gcc -O3 | gcc -O1 | gcc
-Asystem=posix | gcc -Wstrict-prototypes 

Meanwhile, it rejects it with others parameters: g++ -O0 | g++ -Dlinux | g++
-Wwrite-strings | g++ -Amachine=i386 | g++ -Wpointer-arith

The error message is strange:
/tmp/ccIBuqiz.s: Assembler messages:
/tmp/ccIBuqiz.s:4: Error: missing name

Reply via email to