Commit 44fabee4 by Richard Guenther Committed by Richard Biener

re PR c/53937 (Pack'ing struct causes gcc to not recognize that an field's address is aligned)

2012-07-13  Richard Guenther  <rguenther@suse.de>

	PR middle-end/53937
	* builtins.c (get_pointer_alignment_1): Handle constant
	pointers.

From-SVN: r189458
parent 57cee56a
2012-07-13 Richard Guenther <rguenther@suse.de>
PR middle-end/53937
* builtins.c (get_pointer_alignment_1): Handle constant
pointers.
2012-07-13 Richard Sandiford <rdsandiford@googlemail.com>
Steven Bosscher <steven@gcc.gnu.org>
Bernd Schmidt <bernds@codesourcery.com>
......
......@@ -536,6 +536,13 @@ get_pointer_alignment_1 (tree exp, unsigned int *alignp,
return false;
}
}
else if (TREE_CODE (exp) == INTEGER_CST)
{
*alignp = BIGGEST_ALIGNMENT;
*bitposp = ((TREE_INT_CST_LOW (exp) * BITS_PER_UNIT)
& (BIGGEST_ALIGNMENT - 1));
return true;
}
*bitposp = 0;
*alignp = BITS_PER_UNIT;
......
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