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]

Re: Serious or non-serious bug in the C-compiler?


  In message <Pine.GSO.3.96.990728042650.1123A-101000@harpo.csd.uu.se>you write
  > I experience the following problem: I have a file 'options.c' that gives
  > no warning when compiled with mild optimization (-O1), but, erroneously,
  > gives warnings when compiled with more aggresive optimization (-O2). This
  > suggest the semantics of the program might have changed, which is a bit
  > unnerving. Maybe the semantics is changed in other parts of my program
  > without any warnings being generated?
When you specify -O2 you get global cse optimizations using lazy code motion
which confuse the rather simplistic code which issues this warning.

Basically any global motion algorithm can easily confuse the uninitialized
warning analysis.

The analysis code for uninitialized warnings needs to be overhauled to use the
cfg & global dataflow framework to determine when/where variables are live
instead of the simplistic stuff it does now.  That will eliminate *some* of the
false positives, but not all of them.

jeff


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