This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/85598] [7/8/9 Regression] Incorrect warning only at -O2 and -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: Thu, 22 Nov 2018 15:18:49 +0000
- Subject: [Bug middle-end/85598] [7/8/9 Regression] Incorrect warning only at -O2 and -O3
- Auto-submitted: auto-generated
- References: <bug-85598-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85598
--- Comment #9 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 22 Nov 2018, jakub at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85598
>
> --- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> Created attachment 45070
> --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45070&action=edit
> gcc9-pr85598.patch
>
> Hack that works for me, but perhaps it is too specialized. Can gather
> statistics how many ranges it improved during bootstrap/regtest...
I'd rather have you at _least_ use value_range_base::union_ and friends
for this rather than open-coding it. Note there's also
register_edge_assert_for which you conveniently can use to extract
"ranges" from conditions, see
evrp_range_analyzer::record_ranges_from_incoming_edge.
But yeah, it looks quite "special" :/