This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/61409] [6 regression] -Wmaybe-uninitialized false-positive with -O2
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Dec 2017 23:41:29 +0000
- Subject: [Bug middle-end/61409] [6 regression] -Wmaybe-uninitialized false-positive with -O2
- Auto-submitted: auto-generated
- References: <bug-61409-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61409
--- Comment #28 from Jeffrey A. Law <law at redhat dot com> ---
So this is "fixed" on the trunk.
The trunk now has the ability to track statements that will likely become dead
code as a result of jump threading. That's enough to get the provided samples
under the code growth limitations.
Of course, all you have to do to is insert a couple more statements that can
not be removed as a result of jump threading and the warning is back.
So I'm leaving state as-is.
For reference, this testcase ought to trigger the problem now. If growth
limitations are ever changed the test may need further tweaking.
void *init(void);
struct window
{
int line_height;
int pixel_width;
int pixel_height;
int column_width;
int text_cols;
int internal_border_width;
int left_fringe_width, right_fringe_width;
} *rw;
void bar() __attribute__((noreturn));
void f(int i, int j) {
void *ptr;
if (i)
{
if (j)
return; /* bar(); */
ptr = init();
}
rw->pixel_width = ((rw->text_cols * (rw->column_width))
+ (rw->left_fringe_width + (rw->right_fringe_width)) + 2
* (rw->internal_border_width));
rw->pixel_height = ((rw->text_cols * (rw->line_height)));
foo ();
foo ();
foo ();
foo ();
if (i)
{
rw=ptr;
}
}