Commit 5c3554b7 by Richard Guenther Committed by Richard Biener

re PR middle-end/36988 (ICE in gimple_rhs_has_side_effects, at gimple.c:2369)

2008-08-01  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/36988
	* tree-ssa-ccp.c (ccp_fold): Conversions of constants only
	do not matter if that doesn't change volatile qualification.

	* gcc.c-torture/compile/pr36988.c: New testcase.

From-SVN: r138512
parent 585df50b
2008-08-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36988
* tree-ssa-ccp.c (ccp_fold): Conversions of constants only
do not matter if that doesn't change volatile qualification.
2008-08-01 Paolo Bonzini <bonzini@gnu.org> 2008-08-01 Paolo Bonzini <bonzini@gnu.org>
* configure.ac: Do not generate libada-mk. Do not subst * configure.ac: Do not generate libada-mk. Do not subst
......
2008-08-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36988
* gcc.c-torture/compile/pr36988.c: New testcase.
2008-08-01 Olivier Hainque <hainque@adacore.com> 2008-08-01 Olivier Hainque <hainque@adacore.com>
* gnat.dg/raise_from_pure.ad[bs], * gnat.dg/raise_from_pure.ad[bs],
......
typedef struct {
unsigned char mbxCommand;
} MAILBOX_t;
void lpfc_sli_brdrestart(void)
{
volatile unsigned int word0;
MAILBOX_t *mb;
mb = (MAILBOX_t *) &word0;
mb->mbxCommand = 0x1A;
__writel((*(unsigned int *) mb));
}
...@@ -989,7 +989,13 @@ ccp_fold (gimple stmt) ...@@ -989,7 +989,13 @@ ccp_fold (gimple stmt)
allowed places. */ allowed places. */
if ((subcode == NOP_EXPR || subcode == CONVERT_EXPR) if ((subcode == NOP_EXPR || subcode == CONVERT_EXPR)
&& ((POINTER_TYPE_P (TREE_TYPE (lhs)) && ((POINTER_TYPE_P (TREE_TYPE (lhs))
&& POINTER_TYPE_P (TREE_TYPE (op0))) && POINTER_TYPE_P (TREE_TYPE (op0))
/* Do not allow differences in volatile qualification
as this might get us confused as to whether a
propagation destination statement is volatile
or not. See PR36988. */
&& (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (lhs)))
== TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (op0)))))
|| useless_type_conversion_p (TREE_TYPE (lhs), || useless_type_conversion_p (TREE_TYPE (lhs),
TREE_TYPE (op0)))) TREE_TYPE (op0))))
return op0; return op0;
......
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