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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234716
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
--- /dev/null
+/* { 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); }
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.
{
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))
{