[PATCH] integer overflow checking builtins in constant expressions

Jason Merrill jason@redhat.com
Tue Jun 7 14:32:00 GMT 2016


On 06/06/2016 08:36 AM, Jakub Jelinek wrote:
> @@ -352,6 +352,35 @@ builtin_valid_in_constant_expr_p (const_
>      case BUILT_IN_FUNCTION:
>      case BUILT_IN_LINE:
>
> +      /* The following built-ins are valid in constant expressions
> +	 when their arguments are.  */
> +    case BUILT_IN_ADD_OVERFLOW:
> +    case BUILT_IN_ADD_OVERFLOW_P:
....

Why is this necessary?  builtin_valid_in_constant_expr_p is only needed 
for builtins that can have constant values even if their operands are 
non-constant, which doesn't apply here.

For that matter, I don't see why we needed to add _FUNCTION et al, either.

Jason



More information about the Gcc-patches mailing list