+2019-02-22 Aldy Hernandez <aldyh@redhat.com>
+
+ PR middle-end/85598
+ * gimple-ssa-sprintf.c (pass_sprintf_length::execute): Enable loop
+ analysis for pass.
+
2019-02-22 Thiago Macieira <thiago.macieira@intel.com>
PR target/89444
#include "tree-ssa-propagate.h"
#include "calls.h"
#include "cfgloop.h"
+#include "tree-scalar-evolution.h"
+#include "tree-ssa-loop.h"
#include "intl.h"
#include "langhooks.h"
init_target_to_host_charmap ();
calculate_dominance_info (CDI_DOMINATORS);
+ bool use_scev = optimize > 0 && flag_printf_return_value;
+ if (use_scev)
+ {
+ loop_optimizer_init (LOOPS_NORMAL);
+ scev_initialize ();
+ }
sprintf_dom_walker sprintf_dom_walker;
sprintf_dom_walker.walk (ENTRY_BLOCK_PTR_FOR_FN (fun));
+ if (use_scev)
+ {
+ scev_finalize ();
+ loop_optimizer_finalize ();
+ }
+
/* Clean up object size info. */
fini_object_sizes ();
return 0;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void __chk_fail (void);
+extern int snprintf (char *, size_t, const char *, ...);
+
+int main()
+{
+ char temp[100];
+ unsigned int x;
+ char *str = temp;
+ for(x=0; x<256; ++x) {
+ snprintf(str, 4, "%%%02X", x);
+ }
+}