Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2015-02-11 Thread Mike Stump
On Feb 11, 2015, at 4:24 AM, Marek Polacek pola...@redhat.com wrote: The following patch splits the test into C and C++ test cases, so hopefully fixing the issue. Ok for trunk? 2015-02-11 Marek Polacek pola...@redhat.com * g++.dg/ubsan/shift-1.C: New test. *

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2015-02-11 Thread Marek Polacek
On Wed, Feb 11, 2015 at 09:44:24AM -0800, Mike Stump wrote: On Feb 11, 2015, at 4:24 AM, Marek Polacek pola...@redhat.com wrote: The following patch splits the test into C and C++ test cases, so hopefully fixing the issue. Ok for trunk? 2015-02-11 Marek Polacek pola...@redhat.com

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2015-02-11 Thread Marek Polacek
On Sun, Jan 25, 2015 at 12:07:46PM -0800, Mike Stump wrote: On Dec 1, 2014, at 2:52 AM, Marek Polacek pola...@redhat.com wrote: On Sun, Nov 30, 2014 at 11:00:12PM -0500, Jason Merrill wrote: On 11/27/2014 08:57 AM, Marek Polacek wrote: -/* { dg-error is not a constant expression { target

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2015-01-25 Thread Mike Stump
On Dec 1, 2014, at 2:52 AM, Marek Polacek pola...@redhat.com wrote: On Sun, Nov 30, 2014 at 11:00:12PM -0500, Jason Merrill wrote: On 11/27/2014 08:57 AM, Marek Polacek wrote: -/* { dg-error is not a constant expression { target c++ } 12 } */ +/* { dg-error { xfail { *-*-* } } 11 } */

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2014-12-01 Thread Marek Polacek
On Sun, Nov 30, 2014 at 11:00:12PM -0500, Jason Merrill wrote: On 11/27/2014 08:57 AM, Marek Polacek wrote: -/* { dg-error is not a constant expression { target c++ } 12 } */ +/* { dg-error { xfail { *-*-* } } 11 } */ Please keep the expected message. Done in the below. 2014-12-01

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2014-12-01 Thread Jason Merrill
OK, thanks. Jason

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2014-11-30 Thread Jason Merrill
On 11/27/2014 08:57 AM, Marek Polacek wrote: -/* { dg-error is not a constant expression { target c++ } 12 } */ +/* { dg-error { xfail { *-*-* } } 11 } */ Please keep the expected message. Jason

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2014-11-27 Thread Marek Polacek
On Wed, Nov 26, 2014 at 12:03:45PM -0500, Jason Merrill wrote: On 11/20/2014 02:04 PM, Marek Polacek wrote: + if (fun == NULL_TREE) +switch (CALL_EXPR_IFN (t)) + { + case IFN_UBSAN_NULL: + case IFN_UBSAN_BOUNDS: +return void_node; + default: +break; +

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2014-11-26 Thread Jason Merrill
On 11/20/2014 02:04 PM, Marek Polacek wrote: + if (fun == NULL_TREE) +switch (CALL_EXPR_IFN (t)) + { + case IFN_UBSAN_NULL: + case IFN_UBSAN_BOUNDS: + return void_node; + default: + break; + } Other IFNs should make the call non-constant. -/* {

[PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2014-11-20 Thread Marek Polacek
This patch fixes a bunch of ICEs related to C++14 constexprs and -fsanitize=undefined. We should ignore ubsan internal functions and ubsan builtins in constexpr functions in cxx_eval_call_expression. Also add proper printing of internal functions into the C++ printer. Bootstrapped/regtested on

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2014-11-20 Thread Jakub Jelinek
On Thu, Nov 20, 2014 at 06:14:52PM +0100, Marek Polacek wrote: This patch fixes a bunch of ICEs related to C++14 constexprs and -fsanitize=undefined. We should ignore ubsan internal functions and ubsan builtins in constexpr functions in cxx_eval_call_expression. Also add proper printing of

Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)

2014-11-20 Thread Marek Polacek
On Thu, Nov 20, 2014 at 06:27:25PM +0100, Jakub Jelinek wrote: On Thu, Nov 20, 2014 at 06:14:52PM +0100, Marek Polacek wrote: + if (!current_function_decl is_ubsan_builtin_p (fun)) +return void_node; + I don't understand the !current_function_decl here. That is because I only