This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ubsan PATCH] Don't instrument static initializers (PR sanitizer/67279)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 4 Sep 2015 14:35:27 +0200
- Subject: Re: [ubsan PATCH] Don't instrument static initializers (PR sanitizer/67279)
- Authentication-results: sourceware.org; auth=none
- References: <20150904112838 dot GD2813 at redhat dot com> <20150904113109 dot GH1847 at tucnak dot redhat dot com>
On Fri, Sep 04, 2015 at 01:31:09PM +0200, Jakub Jelinek wrote:
> On Fri, Sep 04, 2015 at 01:28:38PM +0200, Marek Polacek wrote:
> > I think it really doesn't make sense to instrument static initializers; we
> > wouldn't be able to error at run-time anyway. Besides, it causes a compile-time
> > error. Generally, I think *compiling* with -fsanitize=undefined shouldn't add
> > any new compile-time errors. Yes, I know it does in some other cases; this is
> > just an incremental improvement.
> >
> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
> >
> > 2015-09-04 Marek Polacek <polacek@redhat.com>
> >
> > PR sanitizer/67279
> > * c-typeck.c (build_binary_op): Don't instrument static initializers.
> >
> > * gcc.dg/ubsan/pr67279.c: New test.
>
> Ok, but please make sure it is handled similarly in the C++ FE too (perhaps
> incrementally).
cc1plus doesn't reject this particular testcase, so I didn't touch the C++ FE
this time.
Thanks.
Marek