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/34793] New: [Regression 4.1/4.3] warning: 'areg' may be used uninitialized in this function


After reading all other PRs about uninitialized variable warnings, I
believe this one is a different situtation.

PR 20968 -- is about inlining, which is not involved here
PR 21733 -- is about two concatenated blocks rather than nested ones
PR 31707 -- is about setjmp
PR 20644 -- is also about unreachable code

In this testcase, it is really obvious to the observer that the switch
statement explicitly handles all the cases where it could be reached
from the outer if statement, and thus always assigns a value to
variable areg.  GCC 3.x did not warn about it.

I verified the warning is still generated with SVN revision 131533.

(The code is taken from a project called simulavr, and has been cut
down to the minimal test case reproducing the warning.)


-- 
           Summary: [Regression 4.1/4.3] warning: 'areg' may be used
                    uninitialized in this function
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: j at uriah dot heep dot sax dot de


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


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