This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GCC does not support *mmintrin.h with function specific opts
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, Diego Novillo <dnovillo at google dot com>, David Li <davidxl at google dot com>
- Date: Sat, 18 May 2013 08:21:36 +0200
- Subject: Re: GCC does not support *mmintrin.h with function specific opts
- References: <CAMe9rOomjVGV5rpqRkLqPB530uEPYMcVGU6hAScbjs2eeW-etg at mail dot gmail dot com> <CAFULd4YNGAfhwao+ZKVuHTE1uvqiB04qrdX5FeZxBcVw0Yr1TQ at mail dot gmail dot com> <20130514083913 dot GJ1377 at tucnak dot redhat dot com> <20130514100419 dot GM1377 at tucnak dot redhat dot com> <CAAs8Hmz3mkGchO8p3DZ9G18ASj91mgR69MrhKRL1F7ORCG8a4A at mail dot gmail dot com> <CAAs8HmzWkgmzyh0neX1UH8kydUejpTqUnLBjv25=A56jk3-DWw at mail dot gmail dot com> <alpine dot DEB dot 2 dot 02 dot 1305170045260 dot 3955 at laptop-mg dot saclay dot inria dot fr> <CAAs8HmyqOMr=kiVXisKQ0BMy6-7vBpvsh7vYhwG2RoOcxu3h=w at mail dot gmail dot com> <20130517054931 dot GM1377 at tucnak dot redhat dot com> <CAAs8HmwAVJqNe+e1C17Vnq5PcEvYuaBfw-jhGU1mRLLDMpsSvw at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, May 17, 2013 at 09:00:21PM -0700, Sriraman Tallam wrote:
> --- ipa-inline.c (revision 198950)
> +++ ipa-inline.c (working copy)
> @@ -374,7 +374,33 @@ can_early_inline_edge_p (struct cgraph_edge *e)
> return false;
> }
> if (!can_inline_edge_p (e, true))
> - return false;
> + {
> + enum availability avail;
> + struct cgraph_node *callee
> + = cgraph_function_or_thunk_node (e->callee, &avail);
> + /* Flag an error when the inlining cannot happen because of target option
> + mismatch but the callee is marked as "always_inline". In -O0 mode
> + this will go undetected because the error flagged in
> + "expand_call_inline" in tree-inline.c might not execute and the
> + inlining will not happen. Then, the linker could complain about a
> + missing body for the callee if it turned out that the callee was
> + also marked "gnu_inline" with extern inline keyword as bodies of such
> + functions are not generated. */
> + if ((!optimize
> + || flag_no_inline)
This should be if ((!optimize || flag_no_inline) on one line.
I'd prefer also the testcase for the ICEs, something like:
/* Test case to check if AVX intrinsics and function specific target
optimizations work together. Check by including x86intrin.h */
/* { dg-do compile } */
/* { dg-options "-O2 -mno-sse -mno-avx" } */
#include <x86intrin.h>
__m256 a, b, c;
void __attribute__((target ("avx")))
foo (void)
{
a = _mm256_and_ps (b, c);
}
and another testcase that does:
/* { dg-do compile } */
#pragma GCC target ("mavx") /* { dg-error "whatever" } */
Otherwise it looks good to me, but I'd prefer the i?86 maintainers to review
it too (and Honza for ipa-inline.c?).
Jakub