This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]