Commit 33766b66 by Richard Guenther Committed by Richard Biener

re PR c/44555 (Pointer evalutions, is that expected ?)

2010-06-16  Richard Guenther  <rguenther@suse.de>

	PR c/44555
	* c-common.c (c_common_truthvalue_conversion): Remove
	premature and wrong optimization concering ADDR_EXPRs.

	* gcc.c-torture/execute/pr44555.c: New testcase.

From-SVN: r160836
parent 3e15518b
2010-06-16 Richard Guenther <rguenther@suse.de>
PR c/44555
* c-common.c (c_common_truthvalue_conversion): Remove
premature and wrong optimization concering ADDR_EXPRs.
2010-06-15 Arnaud Charlet <charlet@adacore.com> 2010-06-15 Arnaud Charlet <charlet@adacore.com>
* c-ada-spec.c (dump_sloc): Remove column info. * c-ada-spec.c (dump_sloc): Remove column info.
......
...@@ -3825,23 +3825,7 @@ c_common_truthvalue_conversion (location_t location, tree expr) ...@@ -3825,23 +3825,7 @@ c_common_truthvalue_conversion (location_t location, tree expr)
inner); inner);
return truthvalue_true_node; return truthvalue_true_node;
} }
break;
/* If we still have a decl, it is possible for its address to
be NULL, so we cannot optimize. */
if (DECL_P (inner))
{
gcc_assert (DECL_WEAK (inner));
break;
}
if (TREE_SIDE_EFFECTS (inner))
{
expr = build2 (COMPOUND_EXPR, truthvalue_type_node,
inner, truthvalue_true_node);
goto ret;
}
else
return truthvalue_true_node;
} }
case COMPLEX_EXPR: case COMPLEX_EXPR:
......
2010-06-16 Richard Guenther <rguenther@suse.de>
PR c/44555
* gcc.c-torture/execute/pr44555.c: New testcase.
2010-06-16 Janus Weil <janus@gcc.gnu.org> 2010-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/44549 PR fortran/44549
......
struct a {
char b[100];
};
int foo(struct a *a)
{
if (&a->b)
return 1;
return 0;
}
extern void abort (void);
int main()
{
if (foo((struct a *)0) != 0)
abort ();
return 0;
}
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