summaryrefslogtreecommitdiff
path: root/gcc/global.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-15 12:43:35 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-15 12:43:35 +0000
commit25bf8ba363ef7ca3f91fce7433d46b5399562b01 (patch)
tree6deb389e7c733b4c85650e832ec219085b0ff935 /gcc/global.c
parentaa816fb8e73f24a9914a7e42fb49aa2fcaeea602 (diff)
downloadgcc-25bf8ba363ef7ca3f91fce7433d46b5399562b01.tar.gz
PR f/9258
* global.c (struct allocno): Add no_stack_reg. (global_conflicts): Set no_stack_reg. (find_reg): Use it. * convert.c (convert_to_real): Fold - and abs only when profitable. * fold-const.c (fold): Fold truncates in - and abs. * gcc.c-torture/compile/20030115-1.c: New test. * gcc.dg/i386-fpcvt-1.c: New test. * gcc.dg/i386-fpcvt-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61329 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/global.c')
-rw-r--r--gcc/global.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/global.c b/gcc/global.c
index 3b2334fcbf6..4fadc144462 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -132,6 +132,11 @@ struct allocno
/* Set of hard registers that some later allocno has a preference for. */
HARD_REG_SET regs_someone_prefers;
+
+#ifdef STACK_REGS
+ /* Set to true if allocno can't be allocated in the stack register. */
+ bool no_stack_reg;
+#endif
};
static struct allocno *allocno;
@@ -708,8 +713,14 @@ global_conflicts ()
if (e->flags & EDGE_ABNORMAL)
break;
if (e != NULL)
- for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
- record_one_conflict (ax);
+ {
+ EXECUTE_IF_SET_IN_ALLOCNO_SET (allocnos_live, ax,
+ {
+ allocno[ax].no_stack_reg = 1;
+ });
+ for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
+ record_one_conflict (ax);
+ }
}
#endif
}
@@ -1206,6 +1217,10 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
&& ! invalid_mode_change_p (regno, REGNO_REG_CLASS (regno),
mode)
#endif
+#ifdef STACK_REGS
+ && (!allocno[num].no_stack_reg
+ || regno < FIRST_STACK_REG || regno > LAST_STACK_REG)
+#endif
)
{
/* We explicitly evaluate the divide results into temporary