This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/79588] [7 Regression] ICE in warn_for_restrict with -Wrestrict
- From: "prathamesh3492 at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 20 Feb 2017 11:53:29 +0000
- Subject: [Bug c++/79588] [7 Regression] ICE in warn_for_restrict with -Wrestrict
- Auto-submitted: auto-generated
- References: <bug-79588-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79588
--- Comment #5 from prathamesh3492 at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #4)
> Indeed, consider e.g.
> // PR c++/79588
> // { dg-do compile }
> // { dg-options "-Wrestrict" }
>
> void foo (char *__restrict, char *__restrict = __null);
>
> template <int N>
> void
> bar (char **p)
> {
> foo (p[0], p[0]); // { dg-warning "to restrict-qualified parameter aliases
> with" }
> foo (p[0], p[N]); // { dg-warning "to restrict-qualified parameter aliases
> with" }
> }
>
> void
> baz (char **p)
> {
> bar<0> (p);
> }
>
> where there is no warning in the second foo invocation, because it is done
> too early.
Ah, thanks for pointing out! I didn't realize the issue with templates.
Um, should the warning then be moved to middle-end instead (maybe as early
gimple pass) ?
Thanks,
Prathamesh