calls.c (expand_call): Recognize calls to "sqrt" and create corresponding notes.
* calls.c (expand_call): Recognize calls to "sqrt" and create corresponding notes. * g++.dg/bprob/bprob.exp: Load target-supports.exp * g77.dg/bprob/bprob.exp: Likewise. * gcc.misc-tests/bprob.exp: Likewise. * gcc.dg/builtins-18.c: Use builtins-config.h. Do not test float variants on systems where the library does not provide that functionality. * gcc.dg/builtins-20.c: Use builtins-config.h. * gcc.dg/builtins-config.h: New file. From-SVN: r75003
This commit is contained in:
parent
ac5fe3fe51
commit
8f23fc8185
|
@ -1,3 +1,8 @@
|
|||
2003-12-23 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* calls.c (expand_call): Recognize calls to "sqrt" and create
|
||||
corresponding notes.
|
||||
|
||||
2003-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* config/mips/mips.c (override_options): Use `inform' instead
|
||||
|
|
33
gcc/calls.c
33
gcc/calls.c
|
@ -3150,22 +3150,33 @@ expand_call (tree exp, rtx target, int ignore)
|
|||
mark_reg_pointer (temp,
|
||||
TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
|
||||
|
||||
/* Construct an "equal form" for the value which mentions all the
|
||||
arguments in order as well as the function name. */
|
||||
for (i = 0; i < num_actuals; i++)
|
||||
note = gen_rtx_EXPR_LIST (VOIDmode,
|
||||
args[i].initial_value, note);
|
||||
note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
|
||||
|
||||
end_sequence ();
|
||||
|
||||
if (flags & ECF_PURE)
|
||||
note = gen_rtx_EXPR_LIST (VOIDmode,
|
||||
if (flag_unsafe_math_optimizations
|
||||
&& fndecl
|
||||
&& DECL_BUILT_IN (fndecl)
|
||||
&& (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRT
|
||||
|| DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTF
|
||||
|| DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTL))
|
||||
note = gen_rtx_fmt_e (SQRT,
|
||||
GET_MODE (temp),
|
||||
args[0].initial_value);
|
||||
else
|
||||
{
|
||||
/* Construct an "equal form" for the value which
|
||||
mentions all the arguments in order as well as
|
||||
the function name. */
|
||||
for (i = 0; i < num_actuals; i++)
|
||||
note = gen_rtx_EXPR_LIST (VOIDmode,
|
||||
args[i].initial_value, note);
|
||||
note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
|
||||
|
||||
if (flags & ECF_PURE)
|
||||
note = gen_rtx_EXPR_LIST (VOIDmode,
|
||||
gen_rtx_USE (VOIDmode,
|
||||
gen_rtx_MEM (BLKmode,
|
||||
gen_rtx_SCRATCH (VOIDmode))),
|
||||
note);
|
||||
|
||||
}
|
||||
emit_libcall_block (insns, temp, valreg, note);
|
||||
|
||||
valreg = temp;
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
2003-12-23 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* g++.dg/bprob/bprob.exp: Load target-supports.exp
|
||||
* g77.dg/bprob/bprob.exp: Likewise.
|
||||
* gcc.misc-tests/bprob.exp: Likewise.
|
||||
* gcc.dg/builtins-18.c: Use builtins-config.h. Do not test float
|
||||
variants on systems where the library does not provide that
|
||||
functionality.
|
||||
* gcc.dg/builtins-20.c: Use builtins-config.h.
|
||||
* gcc.dg/builtins-config.h: New file.
|
||||
|
||||
2003-12-23 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* lib/gcc-dg.exp (dg-require-profiling): New function.
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
# Test the functionality of programs compiled with profile-directed block
|
||||
# ordering using -fprofile-arcs followed by -fbranch-probabilities.
|
||||
|
||||
load_lib target-supports.exp
|
||||
|
||||
# Some targets don't have any implementation of __bb_init_func or are
|
||||
# missing other needed machinery.
|
||||
if { ![check_profiling_available] } {
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
# Test the functionality of programs compiled with profile-directed block
|
||||
# ordering using -fprofile-arcs followed by -fbranch-probabilities.
|
||||
|
||||
load_lib target-supports.exp
|
||||
|
||||
# Some targets don't have any implementation of __bb_init_func or are
|
||||
# missing other needed machinery.
|
||||
if { ![check_profiling_available] } {
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
/* { dg-do link } */
|
||||
/* { dg-options "-O2 -ffast-math" } */
|
||||
|
||||
|
||||
/* Solaris doesn't have the entire C99 runtime. */
|
||||
#if !defined(sun)
|
||||
#define HAVE_C99_RUNTIME
|
||||
#endif
|
||||
#include "builtins-config.h"
|
||||
|
||||
extern void link_error(void);
|
||||
|
||||
|
@ -29,6 +25,7 @@ main (void)
|
|||
double _Complex dc = 3.0 + 4.0i;
|
||||
long double _Complex ldc = 3.0L + 4.0iL;
|
||||
|
||||
#ifdef HAVE_C99_RUNTIME
|
||||
/* Test floats. */
|
||||
if (cabsf (fc) != 5.0F)
|
||||
link_error ();
|
||||
|
@ -38,6 +35,7 @@ main (void)
|
|||
link_failure ();
|
||||
if (__builtin_cabsf (3.0F + 4.0iF) != 5.0F)
|
||||
link_failure ();
|
||||
#endif
|
||||
|
||||
/* Test doubles. */
|
||||
if (cabs (dc) != 5.0)
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
/* { dg-do link } */
|
||||
/* { dg-options "-O2 -ffast-math" } */
|
||||
|
||||
|
||||
/* Solaris doesn't have the entire C99 runtime. */
|
||||
#if !defined(sun)
|
||||
#define HAVE_C99_RUNTIME
|
||||
#endif
|
||||
#include "builtins-config.h"
|
||||
|
||||
extern void link_error(void);
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/* Copyright (C) 2003 Free Software Foundation.
|
||||
|
||||
Define macros useful in tests for bulitin functions. */
|
||||
|
||||
/* Define HAVE_C99_RUNTIME if the entire C99 runtime is available on
|
||||
the target system. The value of HAVE_C99_RUNTIME should be the
|
||||
same as the value of TARGET_C99_FUNCTIONS in the GCC machine
|
||||
description. (Perhaps GCC should predefine a special macro
|
||||
indicating whether or not TARGET_C99_FUNCTIONS is set, but it does
|
||||
not presently do that.) */
|
||||
|
||||
#if defined(sun)
|
||||
/* Solaris doesn't have the entire C99 runtime. */
|
||||
#else
|
||||
/* Newlib has the "f" variants of the math functions, but not the "l"
|
||||
variants. TARGET_C99_FUNCTIONS is only defined if all C99
|
||||
functions are present. Therefore, on systems using newlib, tests
|
||||
of builtins will fail for both the "f" and the "l" variants, and we
|
||||
should therefore not define HAVE_C99_RUNTIME. Including <limits.h>
|
||||
gives us a way of seeing if _NEWLIB_VERSION is defined. Include
|
||||
<math.h> would work too, but the GLIBC math inlines cause us to
|
||||
generate inferior code, which causes the test to fail, so it is
|
||||
not safe to include <math.h>. */
|
||||
#include <limits.h>
|
||||
#ifdef _NEWLIB_VERSION
|
||||
#else
|
||||
#define HAVE_C99_RUNTIME
|
||||
#endif
|
||||
#endif
|
|
@ -17,6 +17,8 @@
|
|||
# Test the functionality of programs compiled with profile-directed block
|
||||
# ordering using -fprofile-arcs followed by -fbranch-probabilities.
|
||||
|
||||
load_lib target-supports.exp
|
||||
|
||||
# Some targets don't have any implementation of __bb_init_func or are
|
||||
# missing other needed machinery.
|
||||
if { ![check_profiling_available] } {
|
||||
|
|
Loading…
Reference in New Issue