public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR55882
@ 2013-01-09 12:00 Richard Biener
  2013-01-09 20:47 ` Eric Botcazou
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Biener @ 2013-01-09 12:00 UTC (permalink / raw)
  To: gcc-patches; +Cc: ebotcazou


This fixes PR55882 - set_mem_attributes_minus_bitpos misses to
account for the to-be applied bitpos when computing MEM_ALIGN.
It extracts alignment from 't' instead of &t - bitpos.

Bootstrapped and tested on x86_64-unknown-linux-gnu, bootstrap
and regtest running on mips.

Does this look sensible?

Thanks,
Richard.

2013-01-09  Richard Biener  <rguenther@suse.de>

	PR middle-end/55882
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Correctly
	account for the to-be applied bitpos when computing alignment.

Index: gcc/emit-rtl.c
===================================================================
--- gcc/emit-rtl.c	(revision 195014)
+++ gcc/emit-rtl.c	(working copy)
@@ -1839,7 +1839,12 @@ set_mem_attributes_minus_bitpos (rtx ref
 
       if (!align_computed)
 	{
-	  unsigned int obj_align = get_object_alignment (t);
+	  unsigned int obj_align;
+	  unsigned HOST_WIDE_INT obj_bitpos;
+	  get_object_alignment_1 (t, &obj_align, &obj_bitpos);
+	  obj_bitpos = (obj_bitpos - apply_bitpos) & (obj_align - 1);
+	  if (obj_bitpos != 0)
+	    obj_align = (obj_bitpos & -obj_bitpos);
 	  attrs.align = MAX (attrs.align, obj_align);
 	}
     }

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-01-16  9:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-09 12:00 [PATCH] Fix PR55882 Richard Biener
2013-01-09 20:47 ` Eric Botcazou
2013-01-10  9:18   ` Richard Biener
2013-01-10 10:05     ` Richard Biener
2013-01-10 10:54       ` Richard Biener
2013-01-10 12:23       ` Eric Botcazou
2013-01-10 13:24         ` Michael Matz
2013-01-10 13:55           ` Richard Biener
2013-01-10 18:53           ` Eric Botcazou
2013-01-11 10:25             ` Richard Biener
2013-01-15 12:49               ` Richard Biener
2013-01-15 14:44                 ` Eric Botcazou
2013-01-15 14:50                   ` Richard Biener
2013-01-15 23:35                     ` Eric Botcazou
2013-01-16  9:27                       ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).