This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Minor optabs.c bugfix
- To: gcc-patches at gcc dot gnu dot org
- Subject: Minor optabs.c bugfix
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Mon, 22 May 00 16:59:03 EDT
unsignedp is listed as being either zero or nonzero, but some functions
assume the only nonzero value is one. While that's true in practice,
that's not how the functions are specified and not what's done elsewhere.
This fixes it:
Mon May 22 13:14:03 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* optabs.c (can_extend_p): Allow unsignedp to have any nonzero value.
(gen_extend_insn, can_fix_p, can_float_p): Likewise.
*** optabs.c 2000/05/14 21:18:13 1.73
--- optabs.c 2000/05/22 20:29:21
*************** can_extend_p (to_mode, from_mode, unsign
*** 3808,3812 ****
int unsignedp;
{
! return extendtab[(int) to_mode][(int) from_mode][unsignedp];
}
--- 3808,3812 ----
int unsignedp;
{
! return extendtab[(int) to_mode][(int) from_mode][unsignedp != 0];
}
*************** gen_extend_insn (x, y, mto, mfrom, unsig
*** 3820,3824 ****
int unsignedp;
{
! return (GEN_FCN (extendtab[(int) mto][(int) mfrom][unsignedp]) (x, y));
}
--- 3820,3824 ----
int unsignedp;
{
! return (GEN_FCN (extendtab[(int) mto][(int) mfrom][unsignedp != 0]) (x, y));
}
*************** can_fix_p (fixmode, fltmode, unsignedp,
*** 3839,3849 ****
{
*truncp_ptr = 0;
! if (fixtrunctab[(int) fltmode][(int) fixmode][unsignedp] != CODE_FOR_nothing)
! return fixtrunctab[(int) fltmode][(int) fixmode][unsignedp];
if (ftrunc_optab->handlers[(int) fltmode].insn_code != CODE_FOR_nothing)
{
*truncp_ptr = 1;
! return fixtab[(int) fltmode][(int) fixmode][unsignedp];
}
return CODE_FOR_nothing;
--- 3839,3850 ----
{
*truncp_ptr = 0;
! if (fixtrunctab[(int) fltmode][(int) fixmode][unsignedp != 0]
! != CODE_FOR_nothing)
! return fixtrunctab[(int) fltmode][(int) fixmode][unsignedp != 0];
if (ftrunc_optab->handlers[(int) fltmode].insn_code != CODE_FOR_nothing)
{
*truncp_ptr = 1;
! return fixtab[(int) fltmode][(int) fixmode][unsignedp != 0];
}
return CODE_FOR_nothing;
*************** can_float_p (fltmode, fixmode, unsignedp
*** 3855,3859 ****
int unsignedp;
{
! return floattab[(int) fltmode][(int) fixmode][unsignedp];
}
--- 3856,3860 ----
int unsignedp;
{
! return floattab[(int) fltmode][(int) fixmode][unsignedp != 0];
}