summaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-27 09:08:20 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-27 09:08:20 +0000
commit131f3644ef87d5406722ee42b0989cb5783156fa (patch)
tree6f9c3016cb1696987ba7b0cc8c1b8c5400c6157d /gcc/calls.c
parent851ccf1afd9b0e045e7dda2539a3dfa30c16bb64 (diff)
downloadgcc-131f3644ef87d5406722ee42b0989cb5783156fa.tar.gz
2015-05-27 Basile Starynkevitch <basile@starynkevitch.net>
{{merged with almost GCC 5. i.e. trunk r222129 from 2015-04-15, using svn merge -r219880:222129 svn+ssh://bstarynk@gcc.gnu.org/svn/gcc/trunk }} [gcc/] 2015-05-27 Basile Starynkevitch <basile@starynkevitch.net> {{merged with GCC 5, so}} * melt-runtime.h (melt_fatal_error, melt_fatal_error_at_line): Pass UNKNOWN_LOCATION for GCC 5. Re-indented with command: astyle --style=gnu -s2 * melt-runtime.cc: Re-indented with command: astyle --style=gnu -s2 (melt_branch_process_arguments, melt_ggcstart_callback) (melt_reserved_allocation_failure): Use melt_fatal_error instead of fatal_error. * melt/generated/meltrunsup-inc.cc: Manually edited for fatal_error. * melt/generated/warmelt-first.cc: Ditto. * melt/warmelt-first.melt (melt_assert_failure_fun): Ditto. * melt/warmelt-modes.melt (generate_runtypesupport_scanning): Ditto, in the emitted code. * Makefile.in: mention s-gtype instead of gt-melt-runtime.h in dependencies. (TEXI_GCCINT_FILES): Add meltgendoc.texi. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@223739 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c49
1 files changed, 37 insertions, 12 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index ec44624d7c9..32ea4eb1f54 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1321,6 +1321,15 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
&& TREE_CODE (base) != SSA_NAME
&& (!DECL_P (base) || MEM_P (DECL_RTL (base)))))
{
+ /* We may have turned the parameter value into an SSA name.
+ Go back to the original parameter so we can take the
+ address. */
+ if (TREE_CODE (args[i].tree_value) == SSA_NAME)
+ {
+ gcc_assert (SSA_NAME_IS_DEFAULT_DEF (args[i].tree_value));
+ args[i].tree_value = SSA_NAME_VAR (args[i].tree_value);
+ gcc_assert (TREE_CODE (args[i].tree_value) == PARM_DECL);
+ }
/* Argument setup code may have copied the value to register. We
revert that optimization now because the tail call code must
use the original location. */
@@ -2090,6 +2099,26 @@ load_register_parameters (struct arg_data *args, int num_actuals,
(XEXP (args[i].value, 0), size)))
*sibcall_failure = 1;
+ if (size % UNITS_PER_WORD == 0
+ || MEM_ALIGN (mem) % BITS_PER_WORD == 0)
+ move_block_to_reg (REGNO (reg), mem, nregs, args[i].mode);
+ else
+ {
+ if (nregs > 1)
+ move_block_to_reg (REGNO (reg), mem, nregs - 1,
+ args[i].mode);
+ rtx dest = gen_rtx_REG (word_mode, REGNO (reg) + nregs - 1);
+ unsigned int bitoff = (nregs - 1) * BITS_PER_WORD;
+ unsigned int bitsize = size * BITS_PER_UNIT - bitoff;
+ rtx x = extract_bit_field (mem, bitsize, bitoff, 1,
+ dest, word_mode, word_mode);
+ if (BYTES_BIG_ENDIAN)
+ x = expand_shift (LSHIFT_EXPR, word_mode, x,
+ BITS_PER_WORD - bitsize, dest, 1);
+ if (x != dest)
+ emit_move_insn (dest, x);
+ }
+
/* Handle a BLKmode that needs shifting. */
if (nregs == 1 && size < UNITS_PER_WORD
#ifdef BLOCK_REG_PADDING
@@ -2097,22 +2126,18 @@ load_register_parameters (struct arg_data *args, int num_actuals,
#else
&& BYTES_BIG_ENDIAN
#endif
- )
+ )
{
- rtx tem = operand_subword_force (mem, 0, args[i].mode);
- rtx ri = gen_rtx_REG (word_mode, REGNO (reg));
- rtx x = gen_reg_rtx (word_mode);
+ rtx dest = gen_rtx_REG (word_mode, REGNO (reg));
int shift = (UNITS_PER_WORD - size) * BITS_PER_UNIT;
- enum tree_code dir = BYTES_BIG_ENDIAN ? RSHIFT_EXPR
- : LSHIFT_EXPR;
+ enum tree_code dir = (BYTES_BIG_ENDIAN
+ ? RSHIFT_EXPR : LSHIFT_EXPR);
+ rtx x;
- emit_move_insn (x, tem);
- x = expand_shift (dir, word_mode, x, shift, ri, 1);
- if (x != ri)
- emit_move_insn (ri, x);
+ x = expand_shift (dir, word_mode, dest, shift, dest, 1);
+ if (x != dest)
+ emit_move_insn (dest, x);
}
- else
- move_block_to_reg (REGNO (reg), mem, nregs, args[i].mode);
}
/* When a parameter is a block, and perhaps in other cases, it is