https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102659
Bug ID: 102659
Summary: [false diagnosis] extra warning info after O2
vectorization for gcc.dg/torture/pr69760.c
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: crazylht at gmail dot com
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: x86_64-*-* i?86-*-*
options:
../gcc/xgcc -B ../gcc -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects
../../../gcc/intel-innersource/O2_vectorization/gcc/testsuite/gcc.dg/torture/pr69760.c
-m32 -march=cascadelake
../../../gcc/intel-innersource/O2_vectorization/gcc/testsuite/gcc.dg/torture/pr69760.c:
In function ‘test_func’:
../../../gcc/intel-innersource/O2_vectorization/gcc/testsuite/gcc.dg/torture/pr69760.c:16:10:
warning: iteration 54 invokes undefined behavior
[-Waggressive-loop-optimizations]
16 | a[L * k] = 0.0;
| ^
../../../gcc/intel-innersource/O2_vectorization/gcc/testsuite/gcc.dg/torture/pr69760.c:12:17:
note: within this loop
12 | for (i = 0; i < N; i++)
| ^
dump is quite the same as adding -fno-tree-vectorize
@@ -6,44 +6,44 @@ Removing basic block 8
__attribute__((noclone, noinline))
void test_func (double * a, int L, int m, int n, int N)
{
+ unsigned int ivtmp.9;
unsigned int ivtmp.8;
- unsigned int ivtmp.7;
- unsigned int _14;
- int _26;
- unsigned int _31;
- unsigned int _32;
- double * _33;
- unsigned int _34;
- unsigned int _38;
- void * _39;
+ unsigned int _4;
+ unsigned int _5;
+ double * _6;
+ unsigned int _7;
+ unsigned int _25;
+ unsigned int _26;
+ int _27;
+ void * _40;
<bb 2> [local count: 118111600]:
- _26 = -m_13(D);
- ivtmp.7_1 = (unsigned int) _26;
- _31 = (unsigned int) m_13(D);
- _32 = _31 * 4214967296;
- _33 = a_17(D) + _32;
- ivtmp.8_30 = (unsigned int) _33;
- _34 = (unsigned int) a_17(D);
- _14 = _34 + 1935228928;
- _38 = _14 + _32;
+ _27 = -m_13(D);
+ ivtmp.8_8 = (unsigned int) _27;
+ _4 = (unsigned int) m_13(D);
+ _5 = _4 * 4214967296;
+ _6 = a_17(D) + _5;
+ ivtmp.9_21 = (unsigned int) _6;
+ _7 = (unsigned int) a_17(D);
+ _26 = _7 + 1935228928;
+ _25 = _5 + _26;
<bb 3> [local count: 955630225]:
- # ivtmp.7_3 = PHI <ivtmp.7_2(5), ivtmp.7_1(2)>
- # ivtmp.8_28 = PHI <ivtmp.8_29(5), ivtmp.8_30(2)>
- if (ivtmp.7_3 <= 3)
+ # ivtmp.8_3 = PHI <ivtmp.8_8(2), ivtmp.8_38(5)>
+ # ivtmp.9_24 = PHI <ivtmp.9_21(2), ivtmp.9_14(5)>
+ if (ivtmp.8_3 <= 3)
goto <bb 4>; [50.00%]
else
goto <bb 5>; [50.00%]
<bb 4> [local count: 477815112]:
- _39 = (void *) ivtmp.8_28;
- MEM[(double *)_39] = 0.0;
+ _40 = (void *) ivtmp.9_24;
+ MEM[(double *)_40] = 0.0;
<bb 5> [local count: 955630225]:
- ivtmp.7_2 = ivtmp.7_3 + 1;
- ivtmp.8_29 = ivtmp.8_28 + 80000000;
- if (ivtmp.8_29 != _38)
+ ivtmp.8_38 = ivtmp.8_3 + 1;
+ ivtmp.9_14 = ivtmp.9_24 + 80000000;
+ if (ivtmp.9_14 != _25)
goto <bb 3>; [87.64%]
else
goto <bb 6>; [12.36%]