This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/50188] New: Optimizer doesn't take into account, that longjmp could lead to loops, which causes illegal code transformations.


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

             Bug #: 50188
           Summary: Optimizer doesn't take into account, that longjmp
                    could lead to loops, which causes illegal code
                    transformations.
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: michael.v.zolotukhin@gmail.com


Created attachment 25104
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25104
Bug reproducer.

Setjmp/longjmp could form loops, like following:
  int i = 0;
  (void) setjmp (env);
  i++;
  if (i < 10)
    longjmp (env, 0);

Optimizer removes check 'if(i<10)' and 'i++' (seemingly, as a dead code). In
this example after such transformations the loop becomes infinite.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]