Skip to content

Commit

Permalink
IA-16: bug fix: libcalls' calling convention was computed wrong
Browse files Browse the repository at this point in the history
The bug was introduced in my patch to add the `assume_ds_data'
and `no_assume_ds_data' function attributes (Git commit
4e30c2c).

(Also see #19 .)
  • Loading branch information
tkchia committed Apr 18, 2018
1 parent 7f54e00 commit ba02d95
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions gcc/config/ia16/ia16.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,29 +321,43 @@ ia16_default_ds_abi_function_type_p (const_tree funtype)
static int
ia16_in_ds_data_function_p (void)
{
return cfun && cfun->decl
&& ia16_ds_data_function_type_p (TREE_TYPE (cfun->decl));
if (cfun && cfun->decl)
return ia16_ds_data_function_type_p (TREE_TYPE (cfun->decl));
else
return TARGET_ASSUME_DS_DATA;
}

#define TARGET_DEFAULT_DS_ABI (TARGET_ALLOCABLE_DS_REG \
&& call_used_regs[DS_REG] \
&& TARGET_ASSUME_DS_DATA)

static int
ia16_in_default_ds_abi_function_p (void)
{
return cfun && cfun->decl
&& ia16_default_ds_abi_function_type_p (TREE_TYPE (cfun->decl));
if (cfun && cfun->decl)
return ia16_default_ds_abi_function_type_p (TREE_TYPE (cfun->decl));
else
return TARGET_DEFAULT_DS_ABI;
}

static int
ia16_ds_data_function_rtx_p (rtx addr)
{
tree type = ia16_get_function_type_for_addr (addr);
return type && ia16_ds_data_function_type_p (type);
if (type)
return ia16_ds_data_function_type_p (type);
else
return TARGET_ASSUME_DS_DATA;
}

static int
ia16_default_ds_abi_function_rtx_p (rtx addr)
{
tree type = ia16_get_function_type_for_addr (addr);
return type && ia16_default_ds_abi_function_type_p (type);
if (type)
return ia16_default_ds_abi_function_type_p (type);
else
return TARGET_DEFAULT_DS_ABI;
}

static int
Expand Down

0 comments on commit ba02d95

Please sign in to comment.