http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55018



Andrew Pinski <pinskia at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

             Status|UNCONFIRMED                 |NEW

      Known to work|                            |4.4.5

           Keywords|                            |wrong-code

   Last reconfirmed|                            |2012-10-22

                 CC|                            |pinskia at gcc dot gnu.org

     Ever Confirmed|0                           |1

            Summary|CDDCE pass is too           |[4.7/4.8 Regression] CDDCE

                   |aggressive sometimes with   |pass is too aggressive

                   |infinite loops and with     |sometimes with infinite

                   |some builtin functions      |loops and with some

                   |                            |functions

   Target Milestone|---                         |4.7.3

      Known to fail|                            |4.7.0, 4.8.0



--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-10-22 
08:54:43 UTC ---

(In reply to comment #5)

> It does if it takes occurrence as a parameter:



ok, I can now make a testcase which should exit but currently does not.

A Runtime testcase which works at -O1, -O2, and -O0 but goes into an infinite

loop at -O3:

void myFunc(int) __attribute__((noinline,noclone));

void myFunc(int a)

{

  if (a==100)

    __builtin_exit(0);

}



void Sender_signal(int Connect) __attribute__((noinline,noclone));

void Sender_signal(int Connect)

{

    int State = 3;

    int occurrence = 0;



    if (Connect) {

        State = 0;

    }



 start:



    if (Connect) {

        goto start;

    } 

    occurrence++;



    if(State != 2){

        myFunc(occurrence);

    }

    goto start;



}



int main(void)

{

  Sender_signal(0);

  return 0;

}

Reply via email to