From 1bd74ad9803518db3978dade5031dab2a481cc3a Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Fri, 15 May 2009 10:20:55 -0400 Subject: optabs.c (prepare_float_lib_cmp): Test that the comparison... 2009-05-15 Sandra Loosemore gcc/ * optabs.c (prepare_float_lib_cmp): Test that the comparison, swapped, and reversed optabs exist before trying to use them. From-SVN: r147578 --- gcc/optabs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gcc/optabs.c') 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; -- cgit v1.1