[cfe-dev] Treatment of __restrict__

Roberto Bagnara bagnara at cs.unipr.it
Sat May 22 02:20:08 PDT 2010


void f(const char *__restrict__ out) {
   out++;
}

The above testcase brings to the generation of the
following dump:

void f(char const *restrict out) (CompoundStmt 0x27ce5b0 <d.c:1:38, line:4:1>
   (DeclStmt 0x27be5a0 <line:2:3, col:29>
     0x27d2bc0 "char const *restrict d"
   (BinaryOperator 0x27d2d20 <line:3:3, col:7> 'char const *' '='
     (DeclRefExpr 0x27d2c20 <col:3> 'char const *restrict' Var='d' 0x27d2bc0)
     (ImplicitCastExpr 0x27d2ce0 <col:7> 'char const *restrict' <Unknown>
       (ImplicitCastExpr 0x27d2ca0 <col:7> 'char const *' <NoOp>
         (DeclRefExpr 0x27d2c60 <col:7> 'char const *restrict' ParmVar='out' 0x27cf800)))))

This indicates that:

- two apparently useless implicit casts are generated;
- the BinaryOperator node's type has lost the restrict qualifier.

Are these wanted?
Best regards,

     Roberto

-- 
Prof. Roberto Bagnara
Applied Formal Methods Laboratory
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the cfe-dev mailing list