Re: [PATCH] Fix ICE in __builtin_snprintf folding (PR middle-end/66345)

2015-06-01 Thread Richard Biener
On Sun, May 31, 2015 at 9:53 AM, Marek Polacek wrote: > The code here was assuming that get_maxval_strlen returns an INTEGER_CST. > As the testcase demonstrates, that is not always true, so check for that > before calling compare_tree_int. E.g. gimple_fold_builtin_strncpy already > has this check

[PATCH] Fix ICE in __builtin_snprintf folding (PR middle-end/66345)

2015-05-31 Thread Marek Polacek
The code here was assuming that get_maxval_strlen returns an INTEGER_CST. As the testcase demonstrates, that is not always true, so check for that before calling compare_tree_int. E.g. gimple_fold_builtin_strncpy already has this check. Bootstrapped/regtested on x86_64-linux, ok for trunk and 5?