re PR c++/84444 (ICE with __builtin_launder and cast)

PR c++/84444
	* builtins.c (builtin_mathfn_code): Don't check if CALL_EXPR_FN (t)
	is ADDR_EXPR.

	* g++.dg/cpp1z/launder8.C: New test.

From-SVN: r257822
This commit is contained in:
Jakub Jelinek 2018-02-19 20:36:41 +01:00 committed by Jakub Jelinek
parent 4382537df8
commit 5f92d10993
4 changed files with 19 additions and 2 deletions

View File

@ -1,5 +1,9 @@
2018-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/84444
* builtins.c (builtin_mathfn_code): Don't check if CALL_EXPR_FN (t)
is ADDR_EXPR.
PR tree-optimization/84452
* tree-vect-patterns.c (vect_recog_pow_pattern): Don't call
expand_simd_clones if targetm.simd_clone.compute_vecsize_and_simdlen

View File

@ -7836,8 +7836,7 @@ builtin_mathfn_code (const_tree t)
const_tree argtype, parmtype;
const_call_expr_arg_iterator iter;
if (TREE_CODE (t) != CALL_EXPR
|| TREE_CODE (CALL_EXPR_FN (t)) != ADDR_EXPR)
if (TREE_CODE (t) != CALL_EXPR)
return END_BUILTINS;
fndecl = get_callee_fndecl (t);

View File

@ -1,5 +1,8 @@
2018-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/84444
* g++.dg/cpp1z/launder8.C: New test.
PR c++/84448
* g++.dg/gomp/pr84448.C: New test.

View File

@ -0,0 +1,11 @@
// PR c++/84444
// { dg-do compile }
// { dg-options "-O2" }
struct A {};
__UINTPTR_TYPE__
foo (A *p)
{
return (__UINTPTR_TYPE__) __builtin_launder (p);
}