Commit d4cba6d4 by Eric Botcazou Committed by Eric Botcazou

stor-layout.c (layout_decl): Do not bump the alignment of a bit-field to more…

stor-layout.c (layout_decl): Do not bump the alignment of a bit-field to more than byte alignment if...

	* stor-layout.c (layout_decl): Do not bump the alignment of a
	bit-field to more than byte alignment if it is packed.

From-SVN: r132614
parent 9dd39a15
2008-02-25 Eric Botcazou <ebotcazou@adacore.com>
* stor-layout.c (layout_decl): Do not bump the alignment of a
bit-field to more than byte alignment if it is packed.
2008-02-24 David Edelsohn <edelsohn@gnu.org> 2008-02-24 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.c (processor_costs): Add cache costs for * config/rs6000/rs6000.c (processor_costs): Add cache costs for
......
...@@ -388,13 +388,13 @@ layout_decl (tree decl, unsigned int known_align) ...@@ -388,13 +388,13 @@ layout_decl (tree decl, unsigned int known_align)
{ {
enum machine_mode xmode enum machine_mode xmode
= mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1); = mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1);
unsigned int xalign = GET_MODE_ALIGNMENT (xmode);
if (xmode != BLKmode if (xmode != BLKmode
&& (known_align == 0 && !(xalign > BITS_PER_UNIT && DECL_PACKED (decl))
|| known_align >= GET_MODE_ALIGNMENT (xmode))) && (known_align == 0 || known_align >= xalign))
{ {
DECL_ALIGN (decl) = MAX (GET_MODE_ALIGNMENT (xmode), DECL_ALIGN (decl) = MAX (xalign, DECL_ALIGN (decl));
DECL_ALIGN (decl));
DECL_MODE (decl) = xmode; DECL_MODE (decl) = xmode;
DECL_BIT_FIELD (decl) = 0; DECL_BIT_FIELD (decl) = 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