Bug 43966 - redundant predicated checks not removed by VRP or jump-threading
Summary: redundant predicated checks not removed by VRP or jump-threading
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.5.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on:
Blocks:
 
Reported: 2010-05-03 06:17 UTC by Hartmut Schirmer
Modified: 2021-07-26 08:22 UTC (History)
1 user (show)

See Also:
Host: i686-pc-mingw32
Target: i686-pc-mingw32
Build: i686-pc-mingw32
Known to work:
Known to fail:
Last reconfirmed: 2021-07-26 00:00:00


Attachments
Test case (355 bytes, text/plain)
2010-05-03 06:19 UTC, Hartmut Schirmer
Details
Assembler listing (1.77 KB, text/plain)
2010-05-03 06:19 UTC, Hartmut Schirmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hartmut Schirmer 2010-05-03 06:17:54 UTC
On attached test case GCC keeps the index range checks in
Vector::getValue although they're always true due to loop conditions

 # GNU C++ (GCC) version 4.5.0 (mingw32)
 # options passed:  -fpreprocessed yy5.ii -march=atom -mtune=atom -O2 -Wall
Comment 1 Hartmut Schirmer 2010-05-03 06:19:26 UTC
Created attachment 20538 [details]
Test case

foo() uses a get method without checks and is ok, checks not optimized away in bar()
Comment 2 Hartmut Schirmer 2010-05-03 06:19:44 UTC
Created attachment 20539 [details]
Assembler listing
Comment 3 Richard Biener 2010-05-03 09:59:47 UTC
Well, this is another case where the predication by if (mData) makes this
hard to optimize.  Not impossible, but hard.