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
This commit is contained in:
parent
061cae1fa9
commit
5a1f395394
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2004-06-24 Ulrich Weigand <uweigand@de.ibm.com>
|
||||||
|
|
||||||
* c-decl.c (finish_function): Do not check for DEFAULT_MAIN_RETURN.
|
* c-decl.c (finish_function): Do not check for DEFAULT_MAIN_RETURN.
|
||||||
|
|
10
gcc/calls.c
10
gcc/calls.c
|
@ -1920,9 +1920,17 @@ shift_returned_value (tree type, rtx *value)
|
||||||
- BITS_PER_UNIT * int_size_in_bytes (type));
|
- BITS_PER_UNIT * int_size_in_bytes (type));
|
||||||
if (shift > 0)
|
if (shift > 0)
|
||||||
{
|
{
|
||||||
|
/* Shift the value into the low part of the register. */
|
||||||
*value = expand_binop (GET_MODE (*value), lshr_optab, *value,
|
*value = expand_binop (GET_MODE (*value), lshr_optab, *value,
|
||||||
GEN_INT (shift), 0, 1, OPTAB_WIDEN);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
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>
|
2004-06-24 Giovanni Bajo <giovannibajo@gcc.gnu.org>
|
||||||
|
|
||||||
* g++.dg/tree-ssa/tree-ssa.exp: Remove. dg.exp already handles
|
* g++.dg/tree-ssa/tree-ssa.exp: Remove. dg.exp already handles
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
struct s { float f[1]; };
|
||||||
|
struct s foo();
|
||||||
|
float bar() { return foo().f[0]; }
|
Loading…
Reference in New Issue