http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48439

           Summary: gcc fails to resume the normal treatment when -isystem
                    has finished
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: driver
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: denis.excoff...@airbus.com


A command line with both `-fbranch-target-load-optimize' and
`-fbranch-target-load-optimize2' is typically a mistake. This mistake should
not be reported when found from within a directory included using -isystem (it
is not).

However, it should be reported when found from within the main file. See below:
the fourth (and last) command line should produce the same message as for the
second one.

%
% cat a.cc
#if defined(INCLUDED)
#include <c1.h>
#endif
void a() {}
%
% cat c1.h
class c1 {
  ~c1(void);
};
c1::~c1(void) {}
%
% gcc --version | head -1
gcc (GCC) 4.6.0
%
% set o = "-O -Werror -fbranch-target-load-optimize
-fbranch-target-load-optimize2"
%
% gcc -o a.o -UINCLUDED -I . $o -c a.cc
a.cc: In function 'void a()':
a.cc:4:11: error: branch target register load optimization is not intended to
be run twice [-Werror]
cc1plus: all warnings being treated as errors

% gcc -o a.o -UINCLUDED -isystem . $o -c a.cc
a.cc: In function 'void a()':
a.cc:4:11: error: branch target register load optimization is not intended to
be run twice [-Werror]
cc1plus: all warnings being treated as errors

% gcc -o a.o -DINCLUDED -I . $o -c a.cc
In file included from a.cc:2:0:
./c1.h: In destructor 'c1::~c1()':
./c1.h:4:16: error: branch target register load optimization is not intended to
be run twice [-Werror]
cc1plus: all warnings being treated as errors

% gcc -o a.o -DINCLUDED -isystem . $o -c a.cc
% ls a.o
a.o
%

I'm not so proud of this bug, sorry for it.

Reply via email to