Commit de83907a by Martin Sebor Committed by Martin Sebor

PR middle-end/92493 - ICE in get_origin_and_offset at gimple-ssa-sprintf.c

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
parent eef99cd9
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> 2019-11-18 Giuliano Belinassi <giuliano.belinassi@usp.br>
* cfgloop.c (get_loop_body_in_custom_order): New. * cfgloop.c (get_loop_body_in_custom_order): New.
...@@ -2346,7 +2346,6 @@ get_origin_and_offset (tree x, HOST_WIDE_INT *fldoff, HOST_WIDE_INT *off) ...@@ -2346,7 +2346,6 @@ get_origin_and_offset (tree x, HOST_WIDE_INT *fldoff, HOST_WIDE_INT *off)
{ {
*fldoff += index; *fldoff += index;
*off -= 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> 2019-11-18 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/c11-attr-syntax-1.c, gcc.dg/c11-attr-syntax-2.c, * gcc.dg/c11-attr-syntax-1.c, gcc.dg/c11-attr-syntax-2.c,
......
/* 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment