Commit 4768dbdd by Jakub Jelinek Committed by Jakub Jelinek

simplify-rtx.c (simplify_plus_minus): Negate constant iff its neg field is…

simplify-rtx.c (simplify_plus_minus): Negate constant iff its neg field is different to previous argument's neg field.

	* simplify-rtx.c (simplify_plus_minus): Negate constant iff its neg
	field is different to previous argument's neg field.

	* gcc.c-torture/execute/20011019-1.c: New test.

From-SVN: r46356
parent c5adc06a
2001-10-19 Jakub Jelinek <jakub@redhat.com>
* simplify-rtx.c (simplify_plus_minus): Negate constant iff its neg
field is different to previous argument's neg field.
Fri Oct 19 15:24:39 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Fri Oct 19 15:24:39 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* final.c (get_decl_from_op): New function. * final.c (get_decl_from_op): New function.
......
...@@ -1882,7 +1882,7 @@ simplify_plus_minus (code, mode, op0, op1) ...@@ -1882,7 +1882,7 @@ simplify_plus_minus (code, mode, op0, op1)
&& CONSTANT_P (ops[n_ops - 2].op)) && CONSTANT_P (ops[n_ops - 2].op))
{ {
HOST_WIDE_INT value = INTVAL (ops[n_ops - 1].op); HOST_WIDE_INT value = INTVAL (ops[n_ops - 1].op);
if (ops[n_ops - 1].neg) if (ops[n_ops - 1].neg ^ ops[n_ops - 2].neg)
value = -value; value = -value;
ops[n_ops - 2].op = plus_constant (ops[n_ops - 2].op, value); ops[n_ops - 2].op = plus_constant (ops[n_ops - 2].op, value);
n_ops--; n_ops--;
......
2001-10-19 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/20011019-1.c: New test.
2001-10-19 NIIBE Yutaka <gniibe@m17n.org> 2001-10-19 NIIBE Yutaka <gniibe@m17n.org>
* gcc.c-torture/execute/ieee/ieee.exp: Change sh-*-* to sh*-*-*. * gcc.c-torture/execute/ieee/ieee.exp: Change sh-*-* to sh*-*-*.
......
extern void exit (int);
extern void abort (void);
struct { int a; int b[5]; } x;
int *y;
int foo (void)
{
return y - x.b;
}
int main (void)
{
y = x.b;
if (foo ())
abort ();
exit (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