Skip to content

Commit

Permalink
PR c++/84444
Browse files Browse the repository at this point in the history
	* builtins.c (builtin_mathfn_code): Don't check if CALL_EXPR_FN (t)
	is ADDR_EXPR.

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


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257822 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
jakub committed Feb 19, 2018
1 parent d3b46eb commit d44e371
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions gcc/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions gcc/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
11 changes: 11 additions & 0 deletions gcc/testsuite/g++.dg/cpp1z/launder8.C
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit d44e371

Please sign in to comment.