Commit 5a1f3953 by Richard Sandiford Committed by Richard Sandiford

calls.c (shift_returned_value): Fix handling of non-integer TYPE_MODEs.

	* calls.c (shift_returned_value): Fix handling of non-integer
	TYPE_MODEs.

From-SVN: r83595
parent 061cae1f
2004-06-24 Richard Sandiford <rsandifo@redhat.com>
* calls.c (shift_returned_value): Fix handling of non-integer
TYPE_MODEs.
2004-06-24 Ulrich Weigand <uweigand@de.ibm.com>
* c-decl.c (finish_function): Do not check for DEFAULT_MAIN_RETURN.
......
......@@ -1920,9 +1920,17 @@ shift_returned_value (tree type, rtx *value)
- BITS_PER_UNIT * int_size_in_bytes (type));
if (shift > 0)
{
/* Shift the value into the low part of the register. */
*value = expand_binop (GET_MODE (*value), lshr_optab, *value,
GEN_INT (shift), 0, 1, OPTAB_WIDEN);
*value = convert_to_mode (TYPE_MODE (type), *value, 0);
/* Truncate it to the type's mode, or its integer equivalent.
This is subject to TRULY_NOOP_TRUNCATION. */
*value = convert_to_mode (int_mode_for_mode (TYPE_MODE (type)),
*value, 0);
/* Now convert it to the final form. */
*value = gen_lowpart (TYPE_MODE (type), *value);
return true;
}
}
......
2004-06-24 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/compile/20040624-1.c: New test.
2004-06-24 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* g++.dg/tree-ssa/tree-ssa.exp: Remove. dg.exp already handles
......
struct s { float f[1]; };
struct s foo();
float bar() { return foo().f[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