This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATH] PR/49139 fix always_inline failures diagnostics
- From: Christian Bruel <christian dot bruel at st dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 31 May 2011 09:54:38 +0200
- Subject: [PATH] PR/49139 fix always_inline failures diagnostics
Hello,
The attached patch fixes a few diagnostic discrepancies for
always_inline failures.
Illustrated by the fail_always_inline[12].c attached cases, the current
behavior is one of:
- success (with and without -Winline), silently not honoring always_inline
gcc fail_always_inline1.c -S -Winline -O0 -fpic
gcc fail_always_inline1.c -S -O2 -fpic
- error: with -Winline but not without
gcc fail_always_inline1.c -S -Winline -O2 -fpic
- error: without -Winline
gcc fail_always_inline2.c -S -fno-early-inlining -O2
or the original c++ attachment in this defect
note that -Winline never warns, as stated in the documentation
This simple patch consistently emits a warning (changing the sorry
unimplemented message) whenever the attribute is not honored.
My first will was to generate and error instead of the warning, but
since it is possible that inlines is only performed at LTO time, an
error would be inapropriate (Note that today this is not possible with
-Winline that would abort).
Another alternative I considered would be to emit the warning under
-Winline rather than unconditionally, but this more a user misuse of the
attribute, so should always be warned anyway. Or maybe a new
-Winline-always that would be activated under -Wall ? Other opinion
welcomed.
Tested with standard bootstrap and regression on x86.
Comments, and/or OK for trunk ?
Many thanks,
Christian
2010-05-25 Christian Bruel <christian.bruel@st.com>
PR 49139
* ipa-inline-transform.c (inline_transform):force call to
optimize_inline_calls error if function is always_inline.
* tree-inline.c (tree_inlinable_function_p): always warn.
(expand_call_inline): Likewise.
2010-05-25 Christian Bruel <christian.bruel@st.com>
* gcc.db/always_inline.c: Removed -Winline. Update checks
* gcc.db/always_inline2.c: Likewise.
* gcc.db/always_inline3.c: Likewise.
* gcc.db/fail_always_inline1.c: New test.
* gcc.db/fail_always_inline2.c: New test.
Attachment:
fail_always_inline1.c
Description: Text document
Attachment:
fail_always_inline2.c
Description: Text document
Attachment:
always_inline_warn.patch
Description: Text document