diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/generic-match-head.cc | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr108237.c | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/generic-match-head.cc b/gcc/generic-match-head.cc index e11a736..749587e 100644 --- a/gcc/generic-match-head.cc +++ b/gcc/generic-match-head.cc @@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see #include "optabs-tree.h" #include "dbgcnt.h" #include "tm.h" +#include "tree-pass.h" /* Routine to determine if the types T1 and T2 are effectively the same for GENERIC. If T1 or T2 is not a type, the test @@ -69,7 +70,7 @@ single_use (tree t ATTRIBUTE_UNUSED) static inline bool canonicalize_math_p () { - return true; + return !cfun || (cfun->curr_properties & PROP_gimple_opt_math) == 0; } /* Return true if math operations that are beneficial only after @@ -88,7 +89,7 @@ canonicalize_math_after_vectorization_p () static inline bool optimize_vectors_before_lowering_p () { - return true; + return !cfun || (cfun->curr_properties & PROP_gimple_lvec) == 0; } /* Return true if successive divisions can be optimized. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr108237.c b/gcc/testsuite/gcc.c-torture/compile/pr108237.c new file mode 100644 index 0000000..52b7f9d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr108237.c @@ -0,0 +1,14 @@ +/* PR middle-end/108237 */ + +typedef unsigned char __attribute__((__vector_size__ (1))) U; +typedef unsigned long long __attribute__((__vector_size__ (16))) V; + +U u; +V v; + +V +foo (void) +{ + V w = v != ((unsigned char) ((unsigned char) u == u) & v); + return w; +} |