This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Serious or non-serious bug in the C-compiler?
- To: Niklas Een <een at csd dot uu dot se>
- Subject: Re: Serious or non-serious bug in the C-compiler?
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 27 Jul 1999 21:51:22 -0600
- cc: gcc-bugs at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
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