This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)
- From: Jason Merrill <jason at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 26 Nov 2014 12:03:45 -0500
- Subject: Re: [PATCH] Fix ubsan and C++14 constexpr ICEs (PR sanitizer/63956)
- Authentication-results: sourceware.org; auth=none
- References: <20141120171452 dot GG29446 at redhat dot com> <20141120172725 dot GT1745 at tucnak dot redhat dot com> <20141120190404 dot GH29446 at redhat dot com>
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.
-/* { dg-error "is not a constant expression" "" { target c++ } 12 } */
+/* { dg-warning "right shift count is negative" "" { target c++ } 12 } */
This should be an xfail (pending the delayed folding work) instead of a
different test.
+constexpr int n3 = fn7 ((const int *) 0, 8); // { dg-error "is not a constant expression|constexpr call flows off" }
The "flows off the end" error is a bug and should not be tested for.
I'm going to check in a fix.
Jason