summaryrefslogtreecommitdiff
path: root/gcc/config/i386
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-18 22:32:56 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-18 22:32:56 +0000
commit69ddc71a33bfa34b3d70d8a569ac77c39c8ec6e3 (patch)
tree6bc1912643d3e680f0d78aa2e29d414b810d9e80 /gcc/config/i386
parent0c032b466756b9f8bf6e4304e25d72a24de573c6 (diff)
downloadgcc-69ddc71a33bfa34b3d70d8a569ac77c39c8ec6e3.tar.gz
PR target/32389
* config/i386/i386.h (enum ix86_stack_slot): Add SLOT_VIRTUAL. * config/i386/i386.c (assign_386_stack_local): Assert that SLOT_VIRTUAL is valid only before virtual regs are instantiated. (ix86_expand_builtin) [IX86_BUILTIN_LDMXCSR, IX86_BUILTIN_STMXCSR]: Use SLOT_VIRTUAL stack slot instead of SLOT_TEMP. * config/i386/i386.md (truncdfsf2, truncxf<mode>2): Ditto. testsuite/ChangeLog: PR target/32389 * gcc.target/i386/pr32389.c New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125830 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386')
-rw-r--r--gcc/config/i386/i386.c7
-rw-r--r--gcc/config/i386/i386.h3
-rw-r--r--gcc/config/i386/i386.md4
3 files changed, 9 insertions, 5 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index ef3d7b3b5aa..72e281ec173 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -15614,6 +15614,9 @@ assign_386_stack_local (enum machine_mode mode, enum ix86_stack_slot n)
gcc_assert (n < MAX_386_STACK_LOCALS);
+ /* Virtual slot is valid only before vregs are instantiated. */
+ gcc_assert ((n == SLOT_VIRTUAL) == !virtuals_instantiated);
+
for (s = ix86_stack_locals; s; s = s->next)
if (s->mode == mode && s->n == n)
return copy_rtx (s->rtl);
@@ -19209,13 +19212,13 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
case IX86_BUILTIN_LDMXCSR:
op0 = expand_normal (CALL_EXPR_ARG (exp, 0));
- target = assign_386_stack_local (SImode, SLOT_TEMP);
+ target = assign_386_stack_local (SImode, SLOT_VIRTUAL);
emit_move_insn (target, op0);
emit_insn (gen_sse_ldmxcsr (target));
return 0;
case IX86_BUILTIN_STMXCSR:
- target = assign_386_stack_local (SImode, SLOT_TEMP);
+ target = assign_386_stack_local (SImode, SLOT_VIRTUAL);
emit_insn (gen_sse_stmxcsr (target));
return copy_to_mode_reg (SImode, target);
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index ee1fbbc2765..31a434ac287 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2334,7 +2334,8 @@ enum ix86_entity
enum ix86_stack_slot
{
- SLOT_TEMP = 0,
+ SLOT_VIRTUAL = 0,
+ SLOT_TEMP,
SLOT_CW_STORED,
SLOT_CW_TRUNC,
SLOT_CW_FLOOR,
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 3f8f97b46cb..c8bff3e0062 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3855,7 +3855,7 @@
;
else
{
- rtx temp = assign_386_stack_local (SFmode, SLOT_TEMP);
+ rtx temp = assign_386_stack_local (SFmode, SLOT_VIRTUAL);
emit_insn (gen_truncdfsf2_with_temp (operands[0], operands[1], temp));
DONE;
}
@@ -3994,7 +3994,7 @@
DONE;
}
else
- operands[2] = assign_386_stack_local (<MODE>mode, SLOT_TEMP);
+ operands[2] = assign_386_stack_local (<MODE>mode, SLOT_VIRTUAL);
})
(define_insn "*truncxfsf2_mixed"