Hi,
  
  The command options can stop the open64 from deleting the unused code, but 
they are eliminated in the whirl2c fhase.
  I compared the different the differnt command options,and got the assembly 
code as follow, the red line means: "i = 6; k = 9;" the test case :
  1)just opencc hello.c -o a.out
08048394 <main>:
 8048394: 83 c4 fc              add    $0xfffffffc,%esp
 8048397: d9 3c 24              fnstcw (%esp)
 804839a: 66 81 24 24 ff fc     andw   $0xfcff,(%esp)
 80483a0: 66 81 0c 24 00 03     orw    $0x300,(%esp)
 80483a6: d9 2c 24              fldcw  (%esp)
 80483a9: 83 c4 04              add    $0x4,%esp
 80483ac: 55                    push   %ebp
 80483ad: 53                    push   %ebx
 80483ae: 31 c0                 xor    %eax,%eax
 80483b0: 5b                    pop    %ebx
 80483b1: 5d                    pop    %ebp
 80483b2: c3                    ret
 80483b3: 90                    nop
2) opencc -Wunused -IPA:cprop=off -IPA:dce=off -WOPT:ivar_pre=off 
-WOPT:icopy=off:copy=off  -Wb,-tt32:0x00000400  -O0 --vv   hello.c

08048434 <main>:
 8048434: 83 c4 fc              add    $0xfffffffc,%esp
 8048437: d9 3c 24              fnstcw (%esp)
 804843a: 66 81 24 24 ff fc     andw   $0xfcff,(%esp)
 8048440: 66 81 0c 24 00 03     orw    $0x300,(%esp)
 8048446: d9 2c 24              fldcw  (%esp)
 8048449: 83 c4 04              add    $0x4,%esp
 804844c: 55                    push   %ebp
 804844d: 89 e5                 mov    %esp,%ebp
 804844f: 83 c4 f0              add    $0xfffffff0,%esp
 8048452: ba 09 00 00 00        mov    $0x9,%edx
 8048457: 89 55 f8              mov    %edx,0xfffffff8(%ebp)
 804845a: b9 06 00 00 00        mov    $0x6,%ecx
 804845f: 89 4d f4              mov    %ecx,0xfffffff4(%ebp)

    So I have to check if I can do something in the whirl2c phase ?!

Thanks!

Eric
  ----- Original Message ----- 
  From: eirc.lew 
  To: Chandrasekhar Murthy ; Shin-Ming Liu 
  Cc: open64-devel@lists.sourceforge.net 
  Sent: Thursday, June 09, 2011 10:52 AM
  Subject: Re: [Open64-devel] How can I stop open64 delete unused code


  Hi,

  compiling command is:
  opencc -Wunused -IPA:cprop=off -IPA:dce=off -WOPT:ivar_pre=off 
-WOPT:icopy=off:copy=off  -Wb,-tt32:0x00000400  -O0 --vv   hello.c

  The input is:

  #include<stdio.h>
  #define N 100

  int main()
  {
    int i, j, k;
    i = 0;
    k = 0;
    int a[N];
    for( j = 0; j < N; j++)
      a[j] = j + 4;
    return 0;
  }


  The output is:(there were no i and k)
  #include "hello.w2c.h"


  extern _INT32 main()
  {

    _INT32 j;
    _INT32 a[100LL];

    j = 0;
    while(j <= 99)
    {
      _514 :;
      (a)[j] = j + 4;
      j = j + 1;
      _258 :;
    }
    goto _770;
    _770 :;
    return 0;
  } /* main */


    ----- Original Message ----- 
    From: Chandrasekhar Murthy 
    To: Shin-Ming Liu ; eirc.lew 
    Cc: open64-devel@lists.sourceforge.net 
    Sent: Thursday, June 09, 2011 4:34 AM
    Subject: RE: [Open64-devel] How can I stop open64 delete unused code


    In the MIPSpro compilers they would be removed in the frontend.
    You might want to check where it gets removed starting from the frontend.

    Murthy


    From: Shin-Ming Liu [mailto:shinm...@gmail.com] 
    Sent: Wednesday, June 08, 2011 8:46 AM
    To: eirc.lew
    Cc: open64-devel@lists.sourceforge.net
    Subject: Re: [Open64-devel] How can I stop open64 delete unused code

    Do you mean the compiler does not reserve space on the stack?  The place to 
look at is the data layout component in CG.  Should be simple to keep them with 
simple change.

    Shin
    On Wed, Jun 8, 2011 at 6:11 AM, eirc.lew <eirc....@gmail.com> wrote:
    Hi, all

      a example(main.c) as follow:

    int main()
    {
      int sum;
      int i, j, k;
      for( i = 0; i < 100; i++ )
        sum = i + 9;

      return 0;
     }

     when I compile it: opencc -CLIST:: main.c

     In the file main.w2c.c, there are no j and k, but I need them.Does someone 
know how to do?

    Thanks!

    Eric

    
------------------------------------------------------------------------------
    EditLive Enterprise is the world's most technically advanced content
    authoring tool. Experience the power of Track Changes, Inline Image
    Editing and ensure content is compliant with Accessibility Checking.
    http://p.sf.net/sfu/ephox-dev2dev
    _______________________________________________
    Open64-devel mailing list
    Open64-devel@lists.sourceforge.net
    https://lists.sourceforge.net/lists/listinfo/open64-devel

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to