While trying to reduce the PR64835 case for ARM and x86, I noticed that the alignment flags are cleared for x86 when attribute optimized is used. With the attached testcases, the visible effects are twofold : 1) Functions compiled in with attribute optimize (-O2) are not aligned as if they were with the -O2 flag. 2) can_inline_edge_p fails because opts_for_fn (caller->decl) != opts_for_fn (callee->decl)) even-though they are compiled with the same optimization level. indeed we have: