Commit a9dc868f by Jakub Jelinek Committed by Jakub Jelinek

simplify-rtx.c (simplifi_binary_operation): If DIV has narrower mode than op0,…

simplify-rtx.c (simplifi_binary_operation): If DIV has narrower mode than op0, only return the bits in DIV's mode.

	* simplify-rtx.c (simplifi_binary_operation) [DIV]: If DIV has
	narrower mode than op0, only return the bits in DIV's mode.

	* gcc.c-torture/compile/20011219-2.c: New test.

From-SVN: r48199
parent 2a3b43b6
2001-12-20 Jakub Jelinek <jakub@redhat.com>
* simplify-rtx.c (simplifi_binary_operation) [DIV]: If DIV has
narrower mode than op0, only return the bits in DIV's mode.
2001-12-20 Jakub Jelinek <jakub@redhat.com>
* combine.c (distribute_notes): Avoid adding REG_LABEL notes
to JUMP_INSNs with JUMP_LABEL.
......
......@@ -1412,7 +1412,10 @@ simplify_binary_operation (code, mode, op0, op1)
case DIV:
if (trueop1 == CONST1_RTX (mode))
return op0;
{
rtx x = gen_lowpart_common (mode, op0);
return x ? x : op0;
}
/* In IEEE floating point, 0/x is not always 0. */
if ((TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
......
2001-12-20 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/compile/20011219-2.c: New test.
* gcc.c-torture/execute/20011219-1.c: New test.
2001-12-19 David Billinghurst <David.Billinghurst@riotinto.com>
......
/* This testcase failed on Alpha at -O2 when simplifying conditional
expressions. */
struct S {
unsigned long a;
double b, c;
};
extern double bar (double, double);
int
foo (unsigned long x, unsigned int y, struct S *z)
{
unsigned int a = z->a;
int b = y / z->a > 1 ? y / z->a : 1;
a = y / b < z->a ? y / b : z->a;
z->c = z->b * bar ((double) a, (double) x);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment