[Bug tree-optimization/91470] [10 Regression] bogus uninitialized warning in trans-intrinsic.c
rguenther at suse dot de
gcc-bugzilla@gcc.gnu.org
Tue Aug 27 12:44:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91470
--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 27 Aug 2019, marxin at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91470
>
> Martin Liška <marxin at gcc dot gnu.org> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> Keywords|needs-reduction |
> Status|UNCONFIRMED |NEW
> Last reconfirmed| |2019-08-27
> CC| |marxin at gcc dot gnu.org
> Ever confirmed|0 |1
>
> --- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
> There's a reduced test-case:
>
> $ cat pr91470.ii
> int input_location, global_trees_0, gfc_conv_intrinsic_findloc_body,
> gfc_conv_intrinsic_findloc_loopblock, gfc_conv_intrinsic_findloc_tmp,
> gfc_conv_intrinsic_findloc_found, gfc_conv_intrinsic_findloc_loop;
> enum tree_code { COND_EXPR };
> struct A {};
> struct B {
> int pre;
> int expr;
> };
> void fn1(B *, B *);
> void fn2(int *, int *);
> int *fn3(int *);
> void fn4(int, tree_code, int *, int *, int *, int);
> void fn5(B *, int *);
> void fn6() {
> A array_arg, value_arg, dim_arg, mask_arg, kind_arg, back_arg;
> int *forward_branch;
> B arrayse, valuese, maskse, backse;
> int i;
> value_arg = array_arg;
> mask_arg = dim_arg;
> back_arg = kind_arg;
> for (i = 0; i < 2; i++) {
> fn5(&maskse, &gfc_conv_intrinsic_findloc_loop);
> fn1(&arrayse, __null);
> fn2(&gfc_conv_intrinsic_findloc_body, &valuese.pre);
> fn4(input_location, COND_EXPR, &global_trees_0,
> &gfc_conv_intrinsic_findloc_tmp, &gfc_conv_intrinsic_findloc_found, 0);
> if (i == 0)
> forward_branch = fn3(&gfc_conv_intrinsic_findloc_loopblock);
> }
> fn4(input_location, COND_EXPR, &global_trees_0, &backse.expr, forward_branch,
> 0);
> }
So this is basically
int x;
for (int i = 0; i < 2; ++i)
if (i == 0) x = bar();
baz(x);
with making sure we do _not_ thread / header copy / unroll this.
The uninit pass warns about the default def flowing into the loop PHI
node here.
More information about the Gcc-bugs
mailing list