Created attachment 49328 [details] C source code Sometime between 20201007 and 20201008, the attached code has broken. $ /home/dcb/gcc/results/bin/gcc -c -O2 -w /home/dcb/gcc/foundBugs/bug647.c auprocess.c: In function ‘rcm_1’: auprocess.c:1275:17: error: stmt with wrong VUSE # VUSE <.MEM_34(D)> n_39 = el_35(D)->nextSample; expected .MEM_33 during GIMPLE pass: sink auprocess.c:1275:17: internal compiler error: verify_ssa failed 0xf02e86 verify_ssa(bool, bool) ../../trunk.git/gcc/tree-ssa.c:1208 0xbcd9c1 execute_function_todo(function*, void*) ../../trunk.git/gcc/passes.c:1999 0xbcc211 execute_todo(unsigned int) ../../trunk.git/gcc/passes.c:2046 I'll have a go at reducing the code.
Reduced code is: typedef int a; typedef char b; int c; void d(e, f, dst, g, avail, h) int e; b *f, *dst; a g, avail; int h; { b i = *f; if (e) goto j; while (avail) { *dst = i; j: avail -= c; } }
Flags -Werror=implicit-int and -Werror=old-style-definition seem useful. Here is another reduced test case: int a, b, d; char c, e; void f(void) { char g = c; if (b) goto h; while (d) { e = c; h: d -= a; } }
Mine.
Just for the record, started with r11-3705-gdae673abd37d4004.
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:629e0547af33221a925f38757b52a9284148b68a commit r11-3726-g629e0547af33221a925f38757b52a9284148b68a Author: Richard Biener <rguenther@suse.de> Date: Thu Oct 8 13:18:57 2020 +0200 tree-optimization/97330 - fix bad load sinking This fixes bad placement of sunk loads. 2020-10-08 Richard Biener <rguenther@suse.de> PR tree-optimization/97330 * tree-ssa-sink.c (statement_sink_location): Avoid skipping PHIs when they dominate the insert location. * gcc.dg/torture/pr97330-1.c: New testcase. * gcc.dg/torture/pr97330-2.c: Likewise.
Fixed.