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 middle-end/24239] spurious warning about clobbered variables w.r.t. longjmp



------- Comment #2 from dvilleneuve at kronos dot com  2005-10-11 12:28 -------
Indeed, in gcc-4.0.1, the previous code chunk does not elicit a warning.
However, a slightly modified version still gets a warning (tested
on RHEL-4, with <gcc version 4.0.1 20050727 (Red Hat 4.0.1-4.EL4.2)>).

<c-code>
#include <setjmp.h>

extern int f(void);
extern int g(int);
extern jmp_buf jb;
extern int i;

int f(void)
{
  int j;

  if( i > 10 ) j = i;
  else j = i + 10;

  if( !setjmp(jb) ) {
    g(j);
  }
  else {
    j = -1;
  }

  return j;
}
</c-code>


-- 

dvilleneuve at kronos dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.4.4                       |4.0.1


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


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