This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/72813] [6/7 Regression] atomic header cannot be compiled into translation unit with -fkeep-inline-functions


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 40485
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40485&action=edit
gcc7-pr72813.patch

I guess the resolution of this PR depends on what exactly should happen when
creating PCH files.
On -x c-header or -x c++-header, with -E we just preprocess, nothing
unexpected.
For -S without -o it has been broken for many years, only partially "fixed" in
r237955, but that change only affected the non-save-temps path, with
-save-temps -S still fails:
error: output filename specified twice
For -S with -o, or -save-temps and say -c or none of -E/-S/-c, we produced some
assembly.

Now, the sources say:
/* This is the point to write out a PCH if we're doing that.
   In that case we do not want to do anything else.  */
and bails out early from those functions, but actually in the caller the
compilation happily continues.

So, either the comment is wrong and we just want to produce full assembly
(sometimes thrown away, because it is written into a temporary file, sometimes
user visible), then we need something like the attached untested patch (plus
perhaps the fixes for the -S -save-temps case).  This choice means creating of
*.gch files might be slightly slower than now, but not significantly, because
most of the work is done anyway, and also means that if there are some
post-parsing reported errors, they will be diagnosed.

Or, we do what the comment says and e.g. set flag_syntax_only at that point
before the early return, which means that even callers would do nothing else. 
Compilation of PCH files would be faster, the assembly written would need to be
declared to be unusable for anything, and perhaps some diagnostics would not be
emitted if it would normally happen after the spot where we write the PCH file.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]