[Bug testsuite/92955] [10 regression] gcc.dg/vect/pr60505.c fails starting with r279392
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 16 17:32:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92955
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2019-12-16
Ever confirmed|0 |1
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
I cannot reproduce the warnings with my powerpc64le cross compiler, either at
-O2 or -O3 when the loop is fully unrolled, or with any other options I tried
(e.g., -mcpu=power8 and -mcpu=power9), but I did manage to reproduce it with a
powerpc64-linux cross. The -maltivec option makes a difference.
Below are parts of the dump of the function the warning sees and that cause the
some of the warnings. The warning is working correctly -- the out-of-bounds
accesses are in the IL. It looks like they are introduced by jump threading.
Suppressing the new warning by -Wno-stringop-truncation doesn't seem
appropriate because the test was added to verify no warning (originally
-Warray-bounds) is issued for such accesses. I don't know why they only show
up with the powerpc64 back end and not others.
foo (char * in, char * out, int num)
{
...
char ovec[16];
...
<bb 2> [local count: 118111600]:
ovec = "\x00";
if (num_13(D) > 0)
goto <bb 3>; [89.00%]
else
goto <bb 38>; [11.00%]
<bb 3> [local count: 105119324]:
_10 = (unsigned int) num_13(D);
_9 = _10 + 4294967295;
addr2int0_27 = (signed long) out_14(D);
andmask_21 = addr2int0_27 & 15;
_26 = _9 > 14;
_22 = andmask_21 == 0;
_30 = in_17(D) + 1;
_31 = out_14(D) - _30;
_32 = (sizetype) _31;
_33 = _32 > 14;
_76 = _33 & _22;
_34 = _76 & _26;
if (_34 != 0)
goto <bb 4>; [80.00%]
else
goto <bb 20>; [20.00%]
<bb 4> [local count: 84095460]:
bnd.6_56 = _10 >> 4;
in_60 = in_17(D) & -16B;
vect__3.9_61 = MEM <vector(16) char> [(char *)in_60];
vect__3.12_62 = __builtin_altivec_mask_for_load (in_17(D));
vectp_in.15_64 = in_17(D) + 15;
vectp_in.14_67 = vectp_in.15_64 & -16B;
vect__3.16_68 = MEM <vector(16) char> [(char *)vectp_in.14_67];
vect__3.17_69 = REALIGN_LOAD <vect__3.9_61, vect__3.16_68, vect__3.12_62>;
MEM <vector(16) char> [(char *)&ovec] = vect__3.17_69;
MEM <vector(16) char> [(char *)out_14(D)] = vect__3.17_69;
vectp_in.14_66 = vectp_in.15_64 + 16;
vectp_out.20_74 = out_14(D) + 16;
niters_vector_mult_vf.7_57 = bnd.6_56 << 4;
tmp.8_58 = (int) niters_vector_mult_vf.7_57;
if (_10 == niters_vector_mult_vf.7_57)
goto <bb 36>; [6.25%]
else
goto <bb 5>; [93.75%]
<bb 5> [local count: 78839493]:
_205 = (sizetype) tmp.8_58;
_206 = in_17(D) + 16;
_207 = *_206;
ovec[tmp.8_58] = _207;
_209 = vectp_out.20_74;
MEM[(char *)vectp_out.20_74] = _207;
i_211 = tmp.8_58 + 1;
if (num_13(D) > 17)
goto <bb 6>; [89.00%]
else
goto <bb 36>; [11.00%]
<bb 6> [local count: 70167152]:
_214 = 17;
_215 = in_17(D) + 17;
_216 = *_215;
ovec[17] = _216; <<< index value 17 is out of the bounds of char[16]
_218 = out_14(D) + 17;
*_218 = _216;
i_220 = 18;
if (num_13(D) > 18)
goto <bb 7>; [89.00%]
else
goto <bb 36>; [11.00%]
...
<bb 19> [local count: 15424248]:
_48 = 30;
_49 = in_17(D) + 30;
_50 = *_49;
ovec[30] = _50; <<< index value 30 is out of the bounds of char[16]
_52 = out_14(D) + 30;
*_52 = _50;
i_54 = 31;
goto <bb 36>; [100.00%]
...
More information about the Gcc-bugs
mailing list