-fuse-caller-save - Enable for i386
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 May 2014 11:39:49 +0000 (11:39 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 May 2014 11:39:49 +0000 (11:39 +0000)
2014-05-30  Tom de Vries  <tom@codesourcery.com>

* config/i386/i386.c (TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS):
Redefine as true.

* gcc.target/i386/fuse-caller-save.c: New test.
* gcc.dg/ira-shrinkwrap-prep-1.c: Run with -fno-use-caller-save.
* gcc.dg/ira-shrinkwrap-prep-2.c: Same.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211078 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c
gcc/testsuite/gcc.target/i386/fuse-caller-save.c [new file with mode: 0644]

index 4dc8b7a..c7b2af3 100644 (file)
@@ -1,5 +1,10 @@
 2014-05-30  Tom de Vries  <tom@codesourcery.com>
 
+       * config/i386/i386.c (TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS):
+       Redefine as true.
+
+2014-05-30  Tom de Vries  <tom@codesourcery.com>
+
        * lra-int.h (struct lra_reg): Add field actual_call_used_reg_set.
        * lra.c (initialize_lra_reg_info_element): Add init of
        actual_call_used_reg_set field.
index 8827256..83d3ba3 100644 (file)
@@ -47272,6 +47272,9 @@ ix86_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
 #undef TARGET_MODE_PRIORITY
 #define TARGET_MODE_PRIORITY ix86_mode_priority
 
+#undef TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS
+#define TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS true
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 #include "gt-i386.h"
index 1ed6aed..1d846dc 100644 (file)
@@ -1,3 +1,9 @@
+2014-05-30  Tom de Vries  <tom@codesourcery.com>
+
+       * gcc.target/i386/fuse-caller-save.c: New test.
+       * gcc.dg/ira-shrinkwrap-prep-1.c: Run with -fno-use-caller-save.
+       * gcc.dg/ira-shrinkwrap-prep-2.c: Same.
+
 2014-04-30  Alan Lawrence  <alan.lawrence@arm.com>
 
        gcc.target/arm/simd/vrev16p8_1.c: New file.
index 171a2bd..fc7b142 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { { x86_64-*-* && lp64 } || { powerpc*-*-* && lp64 } } } } */
-/* { dg-options "-O3 -fdump-rtl-ira -fdump-rtl-pro_and_epilogue"  } */
+/* { dg-options "-O3 -fdump-rtl-ira -fdump-rtl-pro_and_epilogue -fno-use-caller-save"  } */
 
 long __attribute__((noinline, noclone))
 foo (long a)
index ed08494..2e5a9cf 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { { x86_64-*-* && lp64 } || { powerpc*-*-* && lp64 } } } } */
-/* { dg-options "-O3 -fdump-rtl-ira -fdump-rtl-pro_and_epilogue"  } */
+/* { dg-options "-O3 -fdump-rtl-ira -fdump-rtl-pro_and_epilogue -fno-use-caller-save"  } */
 
 long __attribute__((noinline, noclone))
 foo (long a)
diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save.c
new file mode 100644 (file)
index 0000000..ff77d81
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fuse-caller-save" } */
+/* Testing -fuse-caller-save optimization option.  */
+
+static int __attribute__((noinline))
+bar (int x)
+{
+  return x + 3;
+}
+
+int __attribute__((noinline))
+foo (int y)
+{
+  return y + bar (y);
+}
+
+int
+main (void)
+{
+  return !(foo (5) == 13);
+}
+
+/* { dg-final { scan-assembler-not "\.cfi_def_cfa_offset"  } } */
+/* { dg-final { scan-assembler-not "\.cfi_offset"  } } */
+