This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/66422] [5 Regression] -Warray-bounds false positive with -O3
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 12 Jun 2015 05:40:48 +0000
- Subject: [Bug tree-optimization/66422] [5 Regression] -Warray-bounds false positive with -O3
- Auto-submitted: auto-generated
- References: <bug-66422-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66422
--- Comment #9 from rguenther at suse dot de <rguenther at suse dot de> ---
On June 12, 2015 12:01:36 AM GMT+02:00, hubicka at ucw dot cz
<gcc-bugzilla@gcc.gnu.org> wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66422
>
>--- Comment #8 from Jan Hubicka <hubicka at ucw dot cz> ---
>>
>> run_foo ()
>> {
>> ...
>> <bb 10>:
>> _33 = myfoo_28->buf[3];
>> if (_33 != 1)
>> goto <bb 13>;
>> else
>> goto <bb 11>;
>>
>> <bb 11>:
>> _34 = (int) _27;
>> if (_34 > 4)
>> goto <bb 12>;
>> else
>> goto <bb 13>;
>>
>> <bb 12>:
>> __builtin_unreachable ();
>> _35 = myfoo_28->buf[4];
>>
>> <bb 13>:
>> # _36 = PHI <0(2), 1(3), 0(4), 1(5), 0(6), 1(7), 0(8), 1(9), 0(10),
>1(11),
>> 0(12)>
>> if (_36 != 0)
>> goto <bb 15>;
>> else
>> goto <bb 14>;
>>
>> <bb 14>:
>> i_37 = 1;
>>
>> <bb 15>:
>> # _2 = PHI <0(13), -1(14)>
>> return _2;
>>
>> and the unreachable () remains in the CFG.
>>
>> Honza - it seems that remove_exits_and_undefined_stmts inserts these
>> unreachable calls but fails to split the BBs.
>>
>> I have a patch.
>
>Hmm, Indeed. I have expected cleanup_cfg to get rid of _35 =
>myfoo_28->buf[4];.
>I suppose this changed with your compile time work for GCC 5?
Yes. It no longer scans the whole basic block but just tge last statements.
Richard.
>Honza