https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89497

--- Comment #25 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #24)
> (In reply to Jakub Jelinek from comment #23)
> > Created attachment 45926 [details]
> > rh1686696.c
> > 
> > r269302 also fixed the following testcase that has been miscompiled on
> > s390x-linux with -march=zEC12 -O2 -fno-strict-aliasing at least (or
> > -march=zEC12 -O2, -fno-strict-aliasing just because the testcase isn't
> > completely kosher, as it initializes malloced memory through long long array
> > and then accesses it as a struct containing long long and long long array
> > fields).
> > Is it worth adding this into the testsuite?
> 
> Hmm, the patch doesn't contain a wrong-code fix - at least not that I know
> of.
> As we've seen it may change generated code so are you sure the reason the
> testcase was miscompiled didn't go latent?

I'm not sure.  The testcase uses a weird technique where poor man's flexible
array member structure is nested in a poor man's flexible array member of
another structure, so not even sure how valid it is.  See the foo function
which is give me pointer to next structure.
Anyway, what I see in the dumps, thread3 is still the same, but dom3 is
significantly different, r269301 to r269302 diff shows:
-Removing basic block 12
-Removing basic block 13
-Removing basic block 14
...
+h_5 -> { h_16 }
 _10 -> { _13 }
 c_12 -> { c_27 }
 f_14 -> { f_50 }
-c_15 -> { c_27 }
+_15 -> { _13 }
 e_17 -> { e_33 }
-_18 -> { _13 }
+d_18 -> { d_11 }
 h_19 -> { h_16 }
+c_28 -> { c_27 }
+e_42 -> { e_33 }
 d_53 -> { d_11 }
 Incremental SSA update started at block: 2
-Number of blocks in CFG: 14
-Number of blocks to update: 8 ( 57%)
+Number of blocks in CFG: 17
+Number of blocks to update: 9 ( 53%)


+Merging blocks 6 and 16
+Removing basic block 12
+Removing basic block 14
...
@@ -216,7 +219,12 @@ bar (const struct V * x)

   <bb 6> [local count: 105119324]:
   # _54 = PHI <_40(5)>
-  goto <bb 13>; [100.00%]
+  c_12 = MEM[(const struct U *)_40].u1;
+  _10 = d_45 * 2;
+  if (c_12 == 2)
+    goto <bb 13>; [34.00%]
+  else
+    goto <bb 8>; [66.00%]

   <bb 7> [local count: 12992277]:
   # f_50 = PHI <_36(4)>
...
(and various other changes), but I think the above hunk looks most important,
it simply

Reply via email to