On Sun, 20 Sep 2015, Manuel López-Ibáñez wrote: > In do_warn_aggressive_loop_optimizations, we convert to a tree just to print a > widest_int. Apart from overly complicated, this results in printing '3u' > instead of just '3'. > > Unfortunately, adding a printf-like conversion specifier would require making > pretty-print.c link with wide-int.cc, which will include a lot of new > dependencies into several other programs (gcov-tool for example). It would be > possible to add the conversion specifier to every FE pretty-printer, but this > still would require updating c-format.c, which is far from trivial. A simpler > approach is to convert to a string rather than to a tree.
I'd add the pretty printer overloads to wide-int-print.[ch], but yes it would require a change in c-format.c. > In addition, "iteration 3 invokes undefined behavior within this loop" > seems to me clearer than "iteration 3 invokes undefined behavior; > containing loop". > > Boot&tested in x86_64-linux-gnu > > OK? Ok. Let's remember this case and if more of these pop up try working on a "proper" solution. Thanks, Richard. > gcc/testsuite/ChangeLog: > > 2015-09-20 Manuel López-Ibáñez <m...@gcc.gnu.org> > > PR middle-end/60832 > * gcc.dg/pr53265.c: Update. > > gcc/ChangeLog: > > 2015-09-20 Manuel López-Ibáñez <m...@gcc.gnu.org> > > PR middle-end/60832 > * tree-ssa-loop-niter.c (do_warn_aggressive_loop_optimizations): > Print i_bound without converting it to a tree. > -- Richard Biener <rguent...@suse.de> SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)