summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Koval <julia.koval@intel.com>2015-09-14 11:18:34 +0300
committerJulia Koval <julia.koval@intel.com>2015-09-16 13:40:02 +0300
commitf12e0195ee507b833b09e7cdfde63c31457ede28 (patch)
tree3273d4a95c2c6ae33b54b3c6b4a07739208d3512
parent31e4f4c1c1cb78e64cdb52446df1551fa456b602 (diff)
downloadgcc-jkoval/interrupt/master.tar.gz
1. Remove red zone supportjkoval/interrupt/master
2. Fix formatting errors
-rw-r--r--gcc/config/i386/i386.c95
-rw-r--r--gcc/testsuite/gcc.target/i386/interrupt-iamcu.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/interrupt-redzone.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/interrupt-switch-abi.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/interrupt.c16
5 files changed, 62 insertions, 87 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 5c486f8b403..57eb7426db4 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4527,24 +4527,20 @@ ix86_conditional_register_usage (void)
if (current_function_decl && ix86_is_interrupt_p ())
{
- for (i = AX_REG; i <= DI_REG; i++)
- {
- call_used_regs[i] = 0;
- fixed_regs[i] = 0;
- }
- for (i = XMM0_REG; i <= XMM7_REG; i++)
- {
- call_used_regs[i] = 0;
- fixed_regs[i] = 0;
- }
- for (i = R8_REG; i <FIRST_PSEUDO_REGISTER; i++)
- {
- call_used_regs[i] = 0;
- fixed_regs[i] = 0;
- }
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ if (!STACK_REGNO_P (i) && !MMX_REGNO_P (i))
+ {
+ if (i == BP_REG || i == SP_REG)
+ continue;
+ if (i >= ARGP_REG && i <= FRAME_REG)
+ continue;
+ call_used_regs[i] = 0;
+ fixed_regs[i] = 0;
+ }
+ }
}
-
/* For 32-bit targets, squash the REX registers. */
if (! TARGET_64BIT)
{
@@ -4556,8 +4552,6 @@ ix86_conditional_register_usage (void)
fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = "";
}
-
-
/* If MMX is disabled, squash the registers. */
if (! TARGET_MMX)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
@@ -5588,7 +5582,6 @@ ix86_function_ok_for_sibcall (tree decl, tree exp)
if (ix86_is_interrupt_p ())
return false;
-
/* If we are generating position-independent code, we cannot sibcall
optimize direct calls to global functions, as the PLT requires
%ebx be live. (Darwin does not have a PLT.) */
@@ -11495,14 +11488,6 @@ ix86_expand_prologue (void)
/* DRAP should not coexist with stack_realign_fp */
gcc_assert (!(crtl->drap_reg && stack_realign_fp));
- if (ix86_is_interrupt_p () && ix86_using_red_zone ())
- {
- emit_insn (gen_adddi3 (
- gen_rtx_REG (DImode, SP_REG),
- gen_rtx_REG (DImode, SP_REG),
- GEN_INT (-128)));
- }
-
memset (&m->fs, 0, sizeof (m->fs));
/* Initialize CFA state for before the prologue. */
@@ -12476,24 +12461,19 @@ ix86_expand_epilogue (int style)
if (ix86_is_interrupt_p ())
{
- if (ix86_using_red_zone ())
- emit_insn (gen_adddi3 (
- gen_rtx_REG (DImode, SP_REG),
- gen_rtx_REG (DImode, SP_REG),
- GEN_INT (128)));
if (ix86_is_exception_p ())
- {
- if (!TARGET_64BIT)
- emit_insn (gen_addsi3 (
- gen_rtx_REG (SImode, SP_REG),
- gen_rtx_REG (SImode, SP_REG),
- GEN_INT (POINTER_SIZE_UNITS)));
- else
- emit_insn (gen_adddi3 (
- gen_rtx_REG (DImode, SP_REG),
- gen_rtx_REG (DImode, SP_REG),
- GEN_INT (POINTER_SIZE_UNITS)));
- }
+ {
+ if (!TARGET_64BIT)
+ emit_insn (gen_addsi3 (
+ gen_rtx_REG (SImode, SP_REG),
+ gen_rtx_REG (SImode, SP_REG),
+ GEN_INT (POINTER_SIZE_UNITS)));
+ else
+ emit_insn (gen_adddi3 (
+ gen_rtx_REG (DImode, SP_REG),
+ gen_rtx_REG (DImode, SP_REG),
+ GEN_INT (POINTER_SIZE_UNITS)));
+ }
emit_jump_insn (gen_simple_return_interrupt ());
}
else if (crtl->args.pops_args && crtl->args.size)
@@ -25816,10 +25796,12 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
unsigned regno;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
{
- if (!call_used_regs[regno] && !fixed_regs[regno] && !STACK_REGNO_P (regno) && !MMX_REGNO_P (regno))
- {
- clobber_reg(&use, gen_rtx_REG (GET_MODE(regno_reg_rtx[regno]), regno));
- }
+ if (!call_used_regs[regno] && !fixed_regs[regno] &&
+ !STACK_REGNO_P (regno) && !MMX_REGNO_P (regno))
+ {
+ clobber_reg (&use, gen_rtx_REG (
+ GET_MODE (regno_reg_rtx[regno]), regno));
+ }
}
}
@@ -42278,19 +42260,18 @@ bool
ix86_is_interrupt_p ()
{
return lookup_attribute ("interrupt",
- DECL_ATTRIBUTES (current_function_decl)) ||
- lookup_attribute ("exception",
- DECL_ATTRIBUTES (current_function_decl));
+ DECL_ATTRIBUTES (current_function_decl)) ||
+ lookup_attribute ("exception",
+ DECL_ATTRIBUTES (current_function_decl));
}
bool
ix86_is_exception_p ()
{
return lookup_attribute ("exception",
- DECL_ATTRIBUTES (current_function_decl));
+ DECL_ATTRIBUTES (current_function_decl));
}
-
/* A subroutine of ix86_modes_tieable_p. Return true if MODE is a
tieable integer mode. */
@@ -43216,12 +43197,12 @@ ix86_handle_fndecl_attribute (tree *node, tree name, tree, int,
static tree
ix86_handle_interrupt_attribute (tree *node, tree name, tree, int,
- bool *no_add_attrs)
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning (OPT_Wattributes, "%qE attribute only applies to functions",
- name);
+ name);
*no_add_attrs = true;
}
@@ -43240,12 +43221,12 @@ ix86_handle_interrupt_attribute (tree *node, tree name, tree, int,
static tree
ix86_handle_exception_attribute (tree *node, tree name, tree, int,
- bool *no_add_attrs)
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning (OPT_Wattributes, "%qE attribute only applies to functions",
- name);
+ name);
*no_add_attrs = true;
}
diff --git a/gcc/testsuite/gcc.target/i386/interrupt-iamcu.c b/gcc/testsuite/gcc.target/i386/interrupt-iamcu.c
index 9c9d266cec2..5ade7073c5e 100644
--- a/gcc/testsuite/gcc.target/i386/interrupt-iamcu.c
+++ b/gcc/testsuite/gcc.target/i386/interrupt-iamcu.c
@@ -7,15 +7,17 @@ extern int bar (int);
void foo ()
{
int a,b,c,d,e,f,i;
- a = bar(5);
- b = bar(a);
- c = bar(b);
- d = bar(c);
- e = bar(d);
- f = bar(e);
+ a = bar (5);
+ b = bar (a);
+ c = bar (b);
+ d = bar (c);
+ e = bar (d);
+ f = bar (e);
for (i = 1; i < 10; i++)
{
- a += bar (a + i) + bar(b + i) + bar(c + i) + bar(d + i) + bar(e + i) + bar(f+i);
+ a += bar (a + i) + bar (b + i) +
+ bar (c + i) + bar (d + i) +
+ bar (e + i) + bar (f+i);
}
}
/* { dg-final { scan-assembler "push.\t%.ax" } }*/
diff --git a/gcc/testsuite/gcc.target/i386/interrupt-redzone.c b/gcc/testsuite/gcc.target/i386/interrupt-redzone.c
deleted file mode 100644
index d59eb663966..00000000000
--- a/gcc/testsuite/gcc.target/i386/interrupt-redzone.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-do compile { target { ! { ia32 } } } } */
-/* { dg-options "-mabi=sysv" } */
-extern int a;
-void __attribute__((interrupt)) bar ()
- {
- a = 4;
- }
-
-/* { dg-final { scan-assembler "addq\t\\\$-?128, %rsp" } } */
-/* { dg-final { scan-assembler "subq\t\\\$-?128, %rsp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/interrupt-switch-abi.c b/gcc/testsuite/gcc.target/i386/interrupt-switch-abi.c
index fe26a38ae2a..8725e3e7406 100644
--- a/gcc/testsuite/gcc.target/i386/interrupt-switch-abi.c
+++ b/gcc/testsuite/gcc.target/i386/interrupt-switch-abi.c
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-extern void bar(int);
+extern void bar (int);
-void f1(){ bar(1); }
+void f1 (){ bar (1); }
__attribute__((interrupt))
-void f2(){ bar(2); }
-void f3(){ bar(3); }
+void f2 (){ bar (2); }
+void f3 (){ bar (3); }
__attribute__((exception))
-void f4(){ bar(4); }
-void f5(){ bar(5); }
+void f4 (){ bar (4); }
+void f5 (){ bar (5); }
/* { dg-final { scan-assembler-times "iret" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/interrupt.c b/gcc/testsuite/gcc.target/i386/interrupt.c
index 9153a521640..e4948470a75 100644
--- a/gcc/testsuite/gcc.target/i386/interrupt.c
+++ b/gcc/testsuite/gcc.target/i386/interrupt.c
@@ -6,15 +6,17 @@ extern int bar (int);
void foo ()
{
int a,b,c,d,e,f,i;
- a = bar(5);
- b = bar(a);
- c = bar(b);
- d = bar(c);
- e = bar(d);
- f = bar(e);
+ a = bar (5);
+ b = bar (a);
+ c = bar (b);
+ d = bar (c);
+ e = bar (d);
+ f = bar (e);
for (i = 1; i < 10; i++)
{
- a += bar (a + i) + bar(b + i) + bar(c + i) + bar(d + i) + bar(e + i) + bar(f+i);
+ a += bar (a + i) + bar (b + i) +
+ bar (c + i) + bar (d + i) +
+ bar (e + i) + bar (f + i);
}
}
/* { dg-final { scan-assembler "push.\t%.ax" } }*/