Commit eada851c by Richard Biener Committed by Richard Biener

re PR tree-optimization/67741 (Invalid built-in usage should not cause…

re PR tree-optimization/67741 (Invalid built-in usage should not cause segmentation fault in compiler)

2015-09-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/67741
	* tree-ssa-math-opts.c (pass_cse_sincos::execute): Only recognize
	builtin calls with correct signature.

	* gcc.dg/torture/pr67741.c: New testcase.

From-SVN: r228243
parent ce535a96
2015-09-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/67741
* tree-ssa-math-opts.c (pass_cse_sincos::execute): Only recognize
builtin calls with correct signature.
2015-09-29 Ilya Enkovich <enkovich.gnu@gmail.com> 2015-09-29 Ilya Enkovich <enkovich.gnu@gmail.com>
PR target/65105 PR target/65105
2015-09-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/67741
* gcc.dg/torture/pr67741.c: New testcase.
2015-09-29 Uros Bizjak <ubizjak@gmail.com> 2015-09-29 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/tg-tests.h (foo_1) [UNSAFE]: Also check if f and ld are * gcc.dg/tg-tests.h (foo_1) [UNSAFE]: Also check if f and ld are
......
/* { dg-do compile } */
struct singlecomplex { float real, imag ; } ;
struct doublecomplex { double real, imag ; } ;
struct extendedcomplex { long double real, imag ; } ;
extern double cabs();
float cabsf(fc)
struct singlecomplex fc; /* { dg-warning "doesn't match" } */
{
struct doublecomplex dc ;
dc.real=fc.real; dc.imag=fc.imag;
return (float) cabs(dc);
}
...@@ -1738,15 +1738,14 @@ pass_cse_sincos::execute (function *fun) ...@@ -1738,15 +1738,14 @@ pass_cse_sincos::execute (function *fun)
of a basic block. */ of a basic block. */
cleanup_eh = false; cleanup_eh = false;
if (is_gimple_call (stmt) if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL)
&& gimple_call_lhs (stmt) && gimple_call_lhs (stmt))
&& (fndecl = gimple_call_fndecl (stmt))
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
{ {
tree arg, arg0, arg1, result; tree arg, arg0, arg1, result;
HOST_WIDE_INT n; HOST_WIDE_INT n;
location_t loc; location_t loc;
fndecl = gimple_call_fndecl (stmt);
switch (DECL_FUNCTION_CODE (fndecl)) switch (DECL_FUNCTION_CODE (fndecl))
{ {
CASE_FLT_FN (BUILT_IN_COS): CASE_FLT_FN (BUILT_IN_COS):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment