This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: "restrict" implementation bug ?
"Joseph S. Myers" <jsm28@cam.ac.uk> writes:
> On Sun, 1 Apr 2001, Dan Nicolaescu wrote:
>
> > According to http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n897.pdf
> > (pointed to by a link from http://gcc.gnu.org/readings.html)
> > (and BTW there is a n937.pdf file in the same place that seems to be
> > a newer version)
> > global variables with a restrict qualifier should act "as if it were
> > declared as an array".
> >
> > It seems that there is a bug when using both a restricted global var
> > and a pointer obtained from "malloc" call.
> > As shown in the example bellow when using either of them individualy
> > "restrict" works correctly.
>
> Can you please send actual bug reports (as opposed to questions) for
> non-bootstrap bugs to our GNATS bug tracking database, rather than to the
> gcc list, so they are properly tracked for when someone looks at the
> problem, quite likely months later?
I did that, the bug ID is c/2462.
I wasn't sure that this was a bug in the implementation, that is why I
was asking a question. Now I am quite convinced it is. (or a missing
feature, given that "restrict" is a pure optimization with no effects
on correctness).
> Also, when dealing with subtle areas of the language, it would be helpful
> to reference the actual standard wording (with subclause and paragraph
> numbers) rather than the draft Rationale. Especially here, where I don't
> think the Rationale has been effectively updated for the changes in
> "restrict" between the public C9X drafts and the FDIS and final standard.
Sorry, but I don't have a copy of the standard, I didn't even know
that there is a difference between the Rationale, FDIS and the standard,
given that yesterday was the first time when I read the Rationale...
> I think category "c", class "pessimizes-code" would be appropriate for the
> PR. Note 6.7.3.1 paragraph 6 and 6.7.3 paragraph 7: a conforming C99
> implementation could entirely ignore "restrict" apart from checking type
> compatibility rules.
Thanks for the advice, I did that.