[Bug tree-optimization/78586] [7 Regression] Wrong code caused by printf-return-value

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 30 23:12:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78586

--- Comment #14 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #13)
> (In reply to Martin Sebor from comment #11)
> > 	PR tree-optimization/78586
> > 	* gcc.dg/tree-ssa/builtin-sprintf-2.c: New test cases.
> > 
> > 
> > Modified:
> >     trunk/gcc/testsuite/ChangeLog
> >     trunk/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c
> 
>  RNG (4,  4, 32, "%lu", (unsigned)u)
> 
> Isn't this UB?  Did you mean (unsigned long)u) ?

You're right, it is undefined.  It shouldn't matter though because the purpose
of the test is to verify that undefined or unspecified or otherwise unsuitable
calls to sprintf (including those with unknown arguments) are not subject to
either return value constant propagation (the EQL tests) or the range
propagation optimization (the RNG tests).

> 
> As for closing this PR, I have no problem with that, just remember that
> PR78622 doesn't cover all the issues discussed here and still unresolved.

I'll go through the rest of your comments and open new bugs for any distinct
issues.  Since you fixed this bug I'll let you close it unless you want me to. 
If you find new issues please open new bugs.


More information about the Gcc-bugs mailing list