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: [PATCH] adjust strnlen to convert MIN_EXPR to the same type (PR 87112)


On 08/27/2018 04:57 PM, Martin Sebor wrote:
> The assertion I added in the fix for PR 87059 to help find
> mismatched MIN/MAX_EXPR operands has exposed another instance
> of such a mismatch, this one in expand_builtin_strnlen().
> 
> The attached patch adjusts the function to convert the signed
> result of c_strlen() to the unsigned type of the second strnlen
> argument.
> 
> Martin
> 
> gcc-87112.diff
> 
> 
> PR tree-optimization/87112 - ICE in fold_binary_loc on strnlen of mixed integer types
> 
> gcc/ChangeLog:
> 
> 	PR tree-optimization/87112
> 	* builtins.c (expand_builtin_strnlen): Convert c_strlen result to
> 	the type of the bound argument.
> 
> gcc/testsuite/ChangeLog:
> 
> 	PR tree-optimization/87112
> 	* gcc.dg/pr87112.c: New test.
OK.
jeff


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