* gimplify.c (gimplify_expr) <case TRUTH_NOT_EXPR>: If *expr_p type
is not bool, boolify the whole *expr_p and convert to the desired type.
* gcc.c-torture/execute/
20080529-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136434
138bc75d-0d04-0410-961f-
82ee72b054a4
2008-06-06 Jakub Jelinek <jakub@redhat.com>
+ PR target/36362
+ * gimplify.c (gimplify_expr) <case TRUTH_NOT_EXPR>: If *expr_p type
+ is not bool, boolify the whole *expr_p and convert to the desired type.
+
+2008-06-06 Jakub Jelinek <jakub@redhat.com>
+
* c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP value to
200805.
* langhooks.h (struct lang_hooks_for_decls): Add omp_finish_clause.
break;
case TRUTH_NOT_EXPR:
- TREE_OPERAND (*expr_p, 0)
- = gimple_boolify (TREE_OPERAND (*expr_p, 0));
+ if (TREE_CODE (TREE_TYPE (*expr_p)) != BOOLEAN_TYPE)
+ {
+ tree type = TREE_TYPE (*expr_p);
+ *expr_p = fold_convert (type, gimple_boolify (*expr_p));
+ ret = GS_OK;
+ break;
+ }
+
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
is_gimple_val, fb_rvalue);
recalculate_side_effects (*expr_p);
2008-06-06 Jakub Jelinek <jakub@redhat.com>
+ PR target/36362
+ * gcc.c-torture/execute/20080529-1.c: New test.
+
+2008-06-06 Jakub Jelinek <jakub@redhat.com>
+
* gcc.dg/gomp/collapse-1.c: New test.
* gcc.dg/gomp/nesting-1.c: New test.
* g++.dg/gomp/task-1.C: New test.
--- /dev/null
+/* PR target/36362 */
+
+extern void abort (void);
+
+int
+test (float c)
+{
+ return !!c * 7LL == 0;
+}
+
+int
+main (void)
+{
+ if (test (1.0f) != 0)
+ abort ();
+ return 0;
+}