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
This commit is contained in:
Sandra Loosemore 2009-05-15 10:20:55 -04:00 committed by Sandra Loosemore
parent dc34db56f1
commit 1bd74ad980
2 changed files with 11 additions and 4 deletions

View file

@ -1,7 +1,11 @@
2009-05-15 Sandra Loosemore <sandra@codesourcery.com>
* optabs.c (prepare_float_lib_cmp): Test that the comparison,
swapped, and reversed optabs exist before trying to use them.
2009-05-15 Paul Brook <paul@codesourcery.com>
Sandra Loosemore <sandra@codesourcery.com>
gcc/
* config/arm/arm.c (neon_vector_mem_operand): Handle element/structure
loads. Allow PRE_DEC.
(output_move_neon): Handle PRE_DEC.

View file

@ -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;