summaryrefslogtreecommitdiff
path: root/gcc/global.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-01-15 13:43:35 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2003-01-15 12:43:35 +0000
commitb1a6f8db645316b579bf6d42fdfadaea03e44a03 (patch)
tree6deb389e7c733b4c85650e832ec219085b0ff935 /gcc/global.c
parentd18c7e595f818f688d073496d64fae9c00b594d6 (diff)
downloadgcc-b1a6f8db645316b579bf6d42fdfadaea03e44a03.tar.gz
re PR rtl-optimization/9258 (ICE in compensate_edge, at reg-stack.c:2589)
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. From-SVN: r61329
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