This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ubsan PATCH] Don't instrument static initializers (PR sanitizer/67279)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]