OSDN Git Service

PR debug/54694
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Jan 2014 19:22:08 +0000 (19:22 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Jan 2014 19:22:08 +0000 (19:22 +0000)
* gcc.target/i386/pr9771-1.c (main): Rename to...
(real_main): ... this.  Add __asm name "main".
(ASMNAME, ASMNAME2, STRING): Define.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@206681 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr9771-1.c

index 23c358b..c009bf8 100644 (file)
@@ -1,3 +1,10 @@
+2014-01-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/54694
+       * gcc.target/i386/pr9771-1.c (main): Rename to...
+       (real_main): ... this.  Add __asm name "main".
+       (ASMNAME, ASMNAME2, STRING): Define.
+
 2014-01-16  Marek Polacek  <polacek@redhat.com>
 
        Backport from mainline
index 38586fe..daad319 100644 (file)
@@ -45,7 +45,17 @@ void test(void)
   exit(0);
 }
 
-int main()
+/* main usually performs dynamic realignment of the stack in case
+   _start would fail to properly align the stack, but for dynamic
+   stack realignment we need frame pointer which is incompatible
+   with -ffixed-ebp and the global register var.  So, cheat here
+   and hide from the compiler that main is really main.  */
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x)    #x
+int real_main() __asm (ASMNAME ("main"));
+
+int real_main()
 {
   test();
   return 0;