diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2009-05-15 10:20:55 -0400 |
---|---|---|
committer | Sandra Loosemore <sandra@gcc.gnu.org> | 2009-05-15 10:20:55 -0400 |
commit | 1bd74ad9803518db3978dade5031dab2a481cc3a (patch) | |
tree | a4e17d6e5cc9b040396bbab73e36efd218a6a7be /gcc/optabs.c | |
parent | dc34db56f182d392612a054dcd43497b79b31449 (diff) | |
download | gcc-1bd74ad9803518db3978dade5031dab2a481cc3a.zip gcc-1bd74ad9803518db3978dade5031dab2a481cc3a.tar.gz gcc-1bd74ad9803518db3978dade5031dab2a481cc3a.tar.bz2 |
optabs.c (prepare_float_lib_cmp): Test that the comparison...
2009-05-15 Sandra Loosemore <sandra@codesourcery.com>
gcc/
* optabs.c (prepare_float_lib_cmp): Test that the comparison,
swapped, and reversed optabs exist before trying to use them.
From-SVN: r147578
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 9c8cb86..3a13ead 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -4322,10 +4322,12 @@ prepare_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison, mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) { - if ((libfunc = optab_libfunc (code_to_optab[comparison], mode))) + if (code_to_optab[comparison] + && (libfunc = optab_libfunc (code_to_optab[comparison], mode))) break; - if ((libfunc = optab_libfunc (code_to_optab[swapped] , mode))) + if (code_to_optab[swapped] + && (libfunc = optab_libfunc (code_to_optab[swapped], mode))) { rtx tmp; tmp = x; x = y; y = tmp; @@ -4333,7 +4335,8 @@ prepare_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison, break; } - if ((libfunc = optab_libfunc (code_to_optab[reversed], mode)) + if (code_to_optab[reversed] + && (libfunc = optab_libfunc (code_to_optab[reversed], mode)) && FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, reversed)) { comparison = reversed; |