Commit 8f420307 by Eric Botcazou Committed by Eric Botcazou

gimple-fold.c (gimple_fold_stmt_to_constant_1): Also check the TYPE_MODE to…

gimple-fold.c (gimple_fold_stmt_to_constant_1): Also check the TYPE_MODE to recognize useless pointer conversions.

	* gimple-fold.c (gimple_fold_stmt_to_constant_1) <GIMPLE_UNARY_RHS>:
	Also check the TYPE_MODE to recognize useless pointer conversions.

From-SVN: r182178
parent 6d1c2bd3
2011-12-09 Eric Botcazou <ebotcazou@adacore.com>
* gimple-fold.c (gimple_fold_stmt_to_constant_1) <GIMPLE_UNARY_RHS>:
Also check the TYPE_MODE to recognize useless pointer conversions.
2011-12-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51117
......@@ -2517,8 +2517,10 @@ gimple_fold_stmt_to_constant_1 (gimple stmt, tree (*valueize) (tree))
if (CONVERT_EXPR_CODE_P (subcode)
&& POINTER_TYPE_P (TREE_TYPE (lhs))
&& POINTER_TYPE_P (TREE_TYPE (op0))
&& (TYPE_ADDR_SPACE (TREE_TYPE (lhs))
== TYPE_ADDR_SPACE (TREE_TYPE (op0))))
&& TYPE_ADDR_SPACE (TREE_TYPE (lhs))
== TYPE_ADDR_SPACE (TREE_TYPE (op0))
&& TYPE_MODE (TREE_TYPE (lhs))
== TYPE_MODE (TREE_TYPE (op0)))
return op0;
return
......
2011-12-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/compile/20111209-1.c: New test.
2011-12-09 Jason Merrill <jason@redhat.com>
PR c++/51151
......
/* { dg-do compile { target s390x-*-* *-*-*vms* } } */
typedef char* char_ptr32 __attribute__ ((mode(SI)));
char_ptr32 getenv (const char *name);
unsigned long strlen (const char *str);
void
__gnat_getenv (char *name, int *len, char **value)
{
*value = getenv (name);
*len = strlen (*value);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment