Re: [PATCH] Selectively trap if ranger and vr-values disagree on range builtins.

2020-11-02 Thread Aldy Hernandez via Gcc-patches
On 10/29/20 3:39 PM, Aldy Hernandez wrote: On 10/29/20 2:53 PM, Andrew MacLeod wrote: On 10/27/20 11:29 AM, Aldy Hernandez wrote: The UBSAN builtins degrade into PLUS/MINUS/MULT and call extract_range_from_binary_expr, which as the PR shows, can special case some symbolics which the ranger

Re: [PATCH] Selectively trap if ranger and vr-values disagree on range builtins.

2020-10-29 Thread Aldy Hernandez via Gcc-patches
On 10/29/20 2:53 PM, Andrew MacLeod wrote: On 10/27/20 11:29 AM, Aldy Hernandez wrote: The UBSAN builtins degrade into PLUS/MINUS/MULT and call extract_range_from_binary_expr, which as the PR shows, can special case some symbolics which the ranger doesn't currently handle. Looking at vr_valu

Re: [PATCH] Selectively trap if ranger and vr-values disagree on range builtins.

2020-10-29 Thread Andrew MacLeod via Gcc-patches
On 10/27/20 11:29 AM, Aldy Hernandez wrote: The UBSAN builtins degrade into PLUS/MINUS/MULT and call extract_range_from_binary_expr, which as the PR shows, can special case some symbolics which the ranger doesn't currently handle. Looking at vr_values::extract_range_builtin(), I see that every s

Re: [PATCH] Selectively trap if ranger and vr-values disagree on range builtins.

2020-10-27 Thread Aldy Hernandez via Gcc-patches
For the record, this is what I envision the follow-up patch to be (untested). Aldy diff --git a/gcc/vr-values.c b/gcc/vr-values.c index 9f5943a1ab6..3db72a360a6 100644 --- a/gcc/vr-values.c +++ b/gcc/vr-values.c @@ -1159,188 +1159,16 @@ check_for_binary_op_overflow (range_query *query, succes

[PATCH] Selectively trap if ranger and vr-values disagree on range builtins.

2020-10-27 Thread Aldy Hernandez via Gcc-patches
The UBSAN builtins degrade into PLUS/MINUS/MULT and call extract_range_from_binary_expr, which as the PR shows, can special case some symbolics which the ranger doesn't currently handle. Looking at vr_values::extract_range_builtin(), I see that every single place where we ask for a range, we bail