This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49279] [4.5/4.6/4.7 Regression] Optimization incorrectly presuming constant variable inside loop in g++ 4.5 and 4.6 with -O2 and -O3 for x86_64 targets
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 05 Oct 2011 14:38:40 +0000
- Subject: [Bug tree-optimization/49279] [4.5/4.6/4.7 Regression] Optimization incorrectly presuming constant variable inside loop in g++ 4.5 and 4.6 with -O2 and -O3 for x86_64 targets
- Auto-submitted: auto-generated
- References: <bug-49279-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49279
--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-05 14:38:40 UTC ---
After talking about this for some time another idea came up. Basically, assign
the restrict tags for parameters at gimplification time by gimplifying
foo (int * restrict p)
{
to
foo (int * restrict p)
{
p = RESTRICT <p, tag>;
with tag coming from allocate_decl_uid (). We would use these copies
as restrict tag sources using the specified UID. Thus every inline
copy (and clone) would share them.
We could even expose this as __builtin_restrict (p, tag) (with a mapping
from user tags to uids) much similar to __builtin_assume_aligned.
The fortran frontend could use this instead of restrict qualification
for the descriptor->data loads.