Commit c974c96e by Bill Schmidt Committed by William Schmidt

re PR middle-end/70457 (ICE (segfault) in gimple_expand_builtin_pow on powerpc64le-linux-gnu)

[gcc]

2016-04-04  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
	    Jakub Jelinek <jakub@redhat.com>

	PR middle-end/70457
	* tree-inline.c (estimate_num_insn): Use gimple_call_builtin_p
	to ensure a call statement is compatible with a built-in's
	prototype.
	* tree-ssa-math-opts.c (pass_optimize_windening_mul::execute):
	Likewise.

[gcc/testsuite]

2016-04-04  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
	    Jakub Jelinek <jakub@redhat.com>

	PR middle-end/70457
	* gcc.dg/torture/pr70457.c: New.


Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r234716
parent 7a85da89
2016-04-04 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Jakub Jelinek <jakub@redhat.com>
PR middle-end/70457
* tree-inline.c (estimate_num_insn): Use gimple_call_builtin_p
to ensure a call statement is compatible with a built-in's
prototype.
* tree-ssa-math-opts.c (pass_optimize_windening_mul::execute):
Likewise.
2016-04-04 Richard Biener <rguenther@suse.de>
PR rtl-optimization/70484
......
2016-04-04 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Jakub Jelinek <jakub@redhat.com>
PR middle-end/70457
* gcc.dg/torture/pr70457.c: New.
2016-04-04 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/67538
......
/* { dg-do compile } */
/* This formerly ICEd when trying to expand pow as a built-in with
the wrong number of arguments. */
extern double pow (double, double) __attribute__ ((__nothrow__ , __leaf__));
typedef struct {
long long data;
int tag;
} Object;
extern Object Make_Flonum (double);
extern Object P_Pow (Object, Object);
Object General_Function (Object x, Object y, double (*fun)()) {
double d, ret;
d = 1.0;
if (y.tag >> 1)
ret = (*fun) (d);
else
ret = (*fun) (d, 0.0);
return Make_Flonum (ret);
}
Object P_Pow (Object x, Object y) { return General_Function (x, y, pow); }
......@@ -4065,7 +4065,7 @@ estimate_num_insns (gimple *stmt, eni_weights *weights)
return 0;
else if (is_inexpensive_builtin (decl))
return weights->target_builtin_call_cost;
else if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
else if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
{
/* We canonicalize x * x to pow (x, 2.0) with -ffast-math, so
specialize the cheap expansion we do here.
......
......@@ -3827,7 +3827,7 @@ pass_optimize_widening_mul::execute (function *fun)
{
tree fndecl = gimple_call_fndecl (stmt);
if (fndecl
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
&& gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
{
switch (DECL_FUNCTION_CODE (fndecl))
{
......
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