On Wed, Jun 3, 2009 at 12:41 PM, Bingfeng Mei wrote: > Hello, > I noticed that the restrict doesn't work fully on 4.4.0 (used to work on >  our port based on 4.3 branch). The problem is that tree optimizer can do a > lot of optimization regarding pointer, e.g., at -O3. The alias set property > is not propagated accordingly. > > Is the following RTL expansion correct? Both read and write address are > converted to a restrict pointer, but the both mem rtx have the same alias set (2). > > ;; *(int * restrict) (D.1768 + 4) = *(int * restrict) (D.1770 + 4); restrict only works if there is a restrict qualified pointer decl in your source. I will re-implement restrict support completely for 4.5. You can try the attached hack which might help (but also cause weird effects ...). Richard. > (insn 56 55 57 tst.c:7 (set (reg:SI 124) >        (mem:SI (plus:SI (reg:SI 103 [ D.1770 ]) >                (const_int 4 [0x4])) [2 S4 A32])) -1 (nil)) > > (insn 57 56 0 tst.c:7 (set (mem:SI (plus:SI (reg:SI 104 [ D.1768 ]) >                (const_int 4 [0x4])) [2 S4 A32]) >        (reg:SI 124)) -1 (nil)) > > > The alias set property is copied from tree node: >      type        size >        unit size >        align 32 symtab 0 alias set 2 canonical type 0xf7f122f4 precision 32 min max >        pointer_to_this > > >    arg 0        type >            sizes-gimplified public unsigned restrict SI size unit size >            align 32 symtab 0 alias set -1 canonical type 0xf7fa6870> > >        arg 0 >            arg 0 >            arg 1 >            tst.c:7:5> >        tst.c:7:5> >    tst.c:7:5> > > Is the RTL expansion wrong or the orginal tree node is constructed incorrectly? > > Thanks, > Bingfeng Mei > > Broadcom UK >