User account creation filtered due to spam.

Bug 14564 - [tree-ssa] warning does not say a return value is what is uninitialized
Summary: [tree-ssa] warning does not say a return value is what is uninitialized
Status: RESOLVED DUPLICATE of bug 16036
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: tree-ssa
: P2 minor
Target Milestone: 4.0.0
Assignee: Richard Henderson
URL:
Keywords: diagnostic
Depends on: 16036
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-12 23:36 UTC by Falk Hueffner
Modified: 2004-06-17 20:49 UTC (History)
2 users (show)

See Also:
Host: alphaev68-unknown-linux-gnu
Target: alphaev68-unknown-linux-gnu
Build: alphaev68-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2004-03-15 21:59:18


Attachments
test case (93.93 KB, application/x-bzip2)
2004-03-12 23:39 UTC, Falk Hueffner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Falk Hueffner 2004-03-12 23:36:27 UTC
g++ (GCC) 3.5-tree-ssa 20040311 (merged 20040307)

rettmp.10834 is probably some internal SSA name. It shouldn't occur in a
message. Loosely related to bug 14329.

% g++ -Wuninitialized -O2 arrange_profiles.ii -c
arrange_profiles.cpp: In function `profile_sample_files&
<unnamed>::find_profile_sample_files(__gnu_norm::list<profile_sample_files,
std::allocator<profile_sample_files> >&, const parsed_filename&)':
arrange_profiles.cpp:428: warning: 'rettmp.10834' may be used uninitialized in
this function
arrange_profiles.cpp:428: warning: 'rettmp.10794' may be used uninitialized in
this function

Will attach preprocessed source.
Comment 1 Falk Hueffner 2004-03-12 23:39:02 UTC
Created attachment 5911 [details]
test case
Comment 2 Richard Henderson 2004-03-15 21:59:14 UTC
You should in fact note that the original source is busted.  It returns without
value.  I'll admit that we could do better for the warning though.
Comment 3 John Levon 2004-05-20 17:49:11 UTC
rth, I can't see the return without value in the code. I'm probably missing
something obvious

    425 profile_sample_files &
    426 find_profile_sample_files(list<profile_sample_files> & files,
    427     parsed_filename const & parsed)
    428 {
    429         list<profile_sample_files>::iterator it;
    430         list<profile_sample_files>::iterator const end = files.end();
    431         for (it = files.begin(); it != end; ++it) {
    432                 if (!it->sample_filename.empty()) {
    433                         parsed_filename psample_filename =
    434                                 parse_filename(it->sample_filename);
    435                         if (psample_filename.lib_image ==
parsed.lib_image &&
    436                             psample_filename.image == parsed.image &&
    437                             psample_filename.profile_spec_equal(parsed))
    438                                 return *it;
    439                 }
    440
    441                 list<string>::const_iterator cit;
    442                 list<string>::const_iterator const cend =
it->cg_files.end();
    443                 for (cit = it->cg_files.begin(); cit != cend; ++cit) {
    444                         parsed_filename pcg_filename = parse_filename(*cit);
    445                         if (pcg_filename.lib_image == parsed.lib_image &&
    446                             pcg_filename.image == parsed.image &&
    447                             pcg_filename.profile_spec_equal(parsed))
    448                                 return *it;
    449                 }
    450         }
    451
    452         // not found create a new once.
    453         files.push_back(profile_sample_files());
    454         return files.back();
    455 }
Comment 4 Andrew Pinski 2004-05-20 18:34:26 UTC
Actually the value is not uninitialized at all, the problem comes inlining ~parsed_filename which has 
exceptions which cause this warning to happen.
Comment 5 Andrew Pinski 2004-06-10 19:47:54 UTC
I wll note that I get a warning still:
arrange_profiles.cpp:438: warning: 'T.1365' may be used uninitialized in this function

But then a seg fault while trying to expand the function to RTL which is most likely the same as bug 
15794.
Comment 6 Andrew Pinski 2004-06-17 19:58:15 UTC
This is most likely the same as PR 16036.
Comment 7 Andrew Pinski 2004-06-17 20:49:52 UTC
This is a dup of bug 16036, the problems comes from exceptions and abnormal edges.

*** This bug has been marked as a duplicate of 16036 ***