gcc/ChangeLog:
PR tree-optimization/92493
* gimple-ssa-sprintf.c (get_origin_and_offset): Remove spurious
assignment.
gcc/testsuite/ChangeLog:
PR tree-optimization/92493
* gcc.dg/pr92493.c: New test.
From-SVN: r278423
+2019-11-18 Martin Sebor <msebor@redhat.com>
+
+ PR tree-optimization/92493
+ * gimple-ssa-sprintf.c (get_origin_and_offset): Remove spurious
+ assignment.
+
2019-11-18 Giuliano Belinassi <giuliano.belinassi@usp.br>
* cfgloop.c (get_loop_body_in_custom_order): New.
{
*fldoff += index;
*off -= index;
- fldoff = NULL;
}
}
+2019-11-18 Martin Sebor <msebor@redhat.com>
+
+ PR tree-optimization/92493
+ * gcc.dg/pr92493.c: New test.
+
2019-11-18 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/c11-attr-syntax-1.c, gcc.dg/c11-attr-syntax-2.c,
--- /dev/null
+/* PR middle-end/92493 - ICE in get_origin_and_offset at gimple-ssa-sprintf.c
+ { dg-do compile }
+ { dg-options "-O3 -Wall" } */
+
+struct A
+{
+ int i;
+ char a[2];
+} *p;
+
+struct B
+{
+ short j;
+ struct A a;
+} b;
+
+void warn (int j)
+{
+ struct A *q = &b.a;
+ p = q + j;
+ __builtin_snprintf (p->a, 8, "%s", p->a); // { dg-warning "\\\[-Wrestrict" }
+}
+
+void nowarn (char *d, int j)
+{
+ struct A *q = &b.a;
+ p = q + j;
+ __builtin_snprintf (d, 8, "%s", p->a);
+}