Hello. I've been working on a patch that would cope with target and optimization (read PerFunction) in a proper way. I came to following test-case (slightly modified ./gcc/testsuite/gcc.c-torture/execute/alias-1.c): int val; int *ptr = &val; float *ptr2 = &val; static __attribute__((always_inline, optimize ("-fno-strict-aliasing"))) typepun () { *ptr2=0; } main() { *ptr=1; typepun (); if (*ptr) __builtin_abort (); } $ gcc -O2 /tmp/always-inline.c -fdump-tree-all-details && ./a.out Aborted (core dumped) Problem is that einline does: Inlining typepun into main (always_inline). Estimating body: typepun/3 Known to be false: not inlined size:2 time:2 Dropping flag_strict_aliasing on main:4 <<---- here is strict_aliasing drop Accounting size:2.00, time:2.00 on predicate:(true) However fre1 does not still check for flag_strict_aliasing. Is it bug or not? I did an experimental fix, but I guess there will me multiple places where the flag is checked. Second question: Current ipa-inline.c code contains question sophisticated check_{match,maybe_up,maybe_down} and it's following by: /* When user added an attribute to the callee honor it. */ else if (lookup_attribute ("optimize", DECL_ATTRIBUTES (callee->decl)) && opts_for_fn (caller->decl) != opts_for_fn (callee->decl)) { e->inline_failed = CIF_OPTIMIZATION_MISMATCH; inlinable = false; } I think it's very strict, as when one uses __attribute__((optimize)) with a param that matches with command line arguments, it will return false. What if we remove the hunk? Thanks, Martin