* [PATCH] Fix PR80181
@ 2017-03-27 13:08 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2017-03-27 13:08 UTC (permalink / raw)
To: gcc-patches
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2017-03-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/80181
* tree-ssa-ccp.c (likely_value): UNDEFINED ^ X is UNDEFINED.
* gcc.dg/torture/pr80181.c: New testcase.
Index: gcc/tree-ssa-ccp.c
===================================================================
*** gcc/tree-ssa-ccp.c (revision 246490)
--- gcc/tree-ssa-ccp.c (working copy)
*************** likely_value (gimple *stmt)
*** 741,749 ****
case PLUS_EXPR:
case MINUS_EXPR:
case POINTER_PLUS_EXPR:
/* Not MIN_EXPR, MAX_EXPR. One VARYING operand may be selected.
Not bitwise operators, one VARYING operand may specify the
! result completely. Not logical operators for the same reason.
Not COMPLEX_EXPR as one VARYING operand makes the result partly
not UNDEFINED. Not *DIV_EXPR, comparisons and shifts because
the undefined operand may be promoted. */
--- 741,751 ----
case PLUS_EXPR:
case MINUS_EXPR:
case POINTER_PLUS_EXPR:
+ case BIT_XOR_EXPR:
/* Not MIN_EXPR, MAX_EXPR. One VARYING operand may be selected.
Not bitwise operators, one VARYING operand may specify the
! result completely.
! Not logical operators for the same reason, apart from XOR.
Not COMPLEX_EXPR as one VARYING operand makes the result partly
not UNDEFINED. Not *DIV_EXPR, comparisons and shifts because
the undefined operand may be promoted. */
Index: gcc/testsuite/gcc.dg/torture/pr80181.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr80181.c (nonexistent)
--- gcc/testsuite/gcc.dg/torture/pr80181.c (working copy)
***************
*** 0 ****
--- 1,19 ----
+ /* { dg-do compile } */
+
+ int
+ nr (void)
+ {
+ }
+
+ void
+ it (int dl)
+ {
+ int vp = 0;
+
+ for (;;)
+ {
+ dl = vp ^ nr ();
+ dl ^= vp;
+ vp = 1;
+ }
+ }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-27 12:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 13:08 [PATCH] Fix PR80181 Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).