This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR69606
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Feb 2016 13:35:08 +0100 (CET)
- Subject: [PATCH] Fix PR69606
- Authentication-results: sourceware.org; auth=none
The following fixes yet another bogus range info case.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2016-02-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/69606
* tree-ssa-math-opts.c (bswap_replace): Clear flow sensitive
info on the result before moving a stmt.
* gcc.dg/torture/pr69606.c: New testcase.
Index: gcc/tree-ssa-math-opts.c
===================================================================
*** gcc/tree-ssa-math-opts.c (revision 233067)
--- gcc/tree-ssa-math-opts.c (working copy)
*************** bswap_replace (gimple *cur_stmt, gimple
*** 2622,2627 ****
--- 2622,2629 ----
/* Move cur_stmt just before one of the load of the original
to ensure it has the same VUSE. See PR61517 for what could
go wrong. */
+ if (gimple_bb (cur_stmt) != gimple_bb (src_stmt))
+ reset_flow_sensitive_info (gimple_assign_lhs (cur_stmt));
gsi_move_before (&gsi, &gsi_ins);
gsi = gsi_for_stmt (cur_stmt);
Index: gcc/testsuite/gcc.dg/torture/pr69606.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr69606.c (revision 0)
--- gcc/testsuite/gcc.dg/torture/pr69606.c (working copy)
***************
*** 0 ****
--- 1,20 ----
+ /* { dg-do run } */
+
+ char a;
+ unsigned short b;
+ int c, d;
+ unsigned char e;
+
+ int
+ main ()
+ {
+ int f = 1, g = ~a;
+ if (b > f)
+ {
+ e = b;
+ d = b | e;
+ g = 0;
+ }
+ c = 1 % g;
+ return 0;
+ }