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

chrbr at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |chrbr at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #6 from chrbr at gcc dot gnu.org 2011-05-27 14:34:05 UTC ---
Created attachment 24372
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24372
always generates an error on always_inline failure

The attached testcases illustrate the current diagnostics on always_inline
failures"

- success with and without -Winline, although always_inline is not honored
   gcc fail_always_inline1.c -S -Winline -O0 -fpic 
   gcc fail_always_inline1.c -S -O2 -fpic 

- error: "sorry, unimplemented:" with -Winline only
   gcc fail_always_inline1.c -S  -Winline -O2 -fpic

-  error: "sorry, unimplemented" without -Winline
   gcc fail_always_inline2.c -S -fno-early-inlining -O2
   or the original c++ attachment in this defect

The attached patch always emits an error (and change sorry into error). In
particular it fixes the case where the inlining was not honored and not
detected. 
note that the error is emitted even if -Winline is not specified. Since this
reflects a misuse of the attribute and it is close to the actual behavior

Note that I stepped back on my initial proposal to emit a hint message
suggesting to use the "inline" keyword (if not defined in a C++ class), because
there are cases where even with "inline" the function would not be inlined.

Tested with standard bootstrap and regression testing on x86 (with tests
modification the diagnostic checks). I also double checked for legacy issues
with a full rebuild of a linux distribution.

Thanks,

Reply via email to