public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "hjl dot tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/36253] Caller-save stack slot may not have proper alignment Date: Sat, 17 May 2008 02:18:00 -0000 [thread overview] Message-ID: <20080517021725.1227.qmail@sourceware.org> (raw) In-Reply-To: <bug-36253-682@http.gcc.gnu.org/bugzilla/> ------- Comment #1 from hjl dot tools at gmail dot com 2008-05-17 02:17 ------- With this patch to verify alignment of caller-save slot: Index: caller-save.c =================================================================== --- caller-save.c (revision 2603) +++ caller-save.c (working copy) @@ -704,6 +704,12 @@ insert_restore (struct insn_chain *chain mem = adjust_address (mem, save_mode[regno], 0); else mem = copy_rtx (mem); + + /* Verify that the alignment of spill space is equal to or greater + than required. */ + if (GET_MODE_ALIGNMENT (GET_MODE (mem)) > MEM_ALIGN (mem)) + gcc_unreachable (); + pat = gen_rtx_SET (VOIDmode, gen_rtx_REG (GET_MODE (mem), regno), mem); @@ -776,6 +782,12 @@ insert_save (struct insn_chain *chain, i mem = adjust_address (mem, save_mode[regno], 0); else mem = copy_rtx (mem); + + /* Verify that the alignment of spill space is equal to or greater + than required. */ + if (GET_MODE_ALIGNMENT (GET_MODE (mem)) > MEM_ALIGN (mem)) + gcc_unreachable (); + pat = gen_rtx_SET (VOIDmode, mem, gen_rtx_REG (GET_MODE (mem), regno)); Index: function.c =================================================================== --- function.c (revision 2603) +++ function.c (working copy) @@ -341,7 +341,7 @@ assign_stack_local (enum machine_mode mo { rtx x, addr; int bigend_correction = 0; - unsigned int alignment; + unsigned int alignment, alignment_in_bits; int frame_off, frame_alignment, frame_phase; if (align == 0) @@ -378,8 +378,10 @@ assign_stack_local (enum machine_mode mo if (alignment * BITS_PER_UNIT > PREFERRED_STACK_BOUNDARY) alignment = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT; - if (crtl->stack_alignment_needed < alignment * BITS_PER_UNIT) - crtl->stack_alignment_needed = alignment * BITS_PER_UNIT; + alignment_in_bits = alignment * BITS_PER_UNIT; + + if (crtl->stack_alignment_needed < alignment_in_bits) + crtl->stack_alignment_needed = alignment_in_bits; /* Calculate how many bytes the start of local variables is off from stack alignment. */ @@ -432,6 +434,7 @@ assign_stack_local (enum machine_mode mo frame_offset += size; x = gen_rtx_MEM (mode, addr); + set_mem_align (x, alignment_in_bits); MEM_NOTRAP_P (x) = 1; stack_slot_list On Linux/Intel64, I got gnu/java/awt/GradientPaintContext.java: In class 'gnu.java.awt.GradientPaintContext': gnu/java/awt/GradientPaintContext.java: In method 'gnu.java.awt.GradientPaintContext.getRaster(int,int,int,int)': In file included from gnu/java/awt/EventModifier.java:105, from gnu/java/awt/EmbeddedWindow.java:137, from gnu/java/awt/ComponentReshapeEvent.java:84, from gnu/java/awt/ComponentDataBlitOp.java:154, from gnu/java/awt/ClasspathToolkit.java:231, from gnu/java/awt/ClasspathGraphicsEnvironment.java:65, from gnu/java/awt/Buffers.java:222, from /export/gnu/src/gcc-expand/gcc/libjava/classpath/gnu/java/awt/BitwiseXORComposite.java:292, from /export/gnu/src/gcc-expand/gcc/libjava/classpath/gnu/java/awt/BitwiseXORComposite.java:202, from gnu/java/awt/BitwiseXORComposite.java:130, from gnu/java/awt/BitMaskExtent.java:77, from /export/gnu/src/gcc-expand/gcc/libjava/classpath/gnu/java/awt/AWTUtilities.java:253, from /export/gnu/src/gcc-expand/gcc/libjava/classpath/gnu/java/awt/AWTUtilities.java:296, from gnu/java/awt/AWTUtilities.java:895, from <built-in>:63: gnu/java/awt/GradientPaintContext.java:153: internal compiler error: in insert_save, at caller-save.c:789 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. make[6]: *** [gnu/java/awt.lo] Error 1 make[6]: *** Waiting for unfinished jobs.... when I was building 32bit libjava. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36253
next prev parent reply other threads:[~2008-05-17 2:18 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-05-17 0:18 [Bug middle-end/36253] New: " hjl dot tools at gmail dot com 2008-05-17 2:18 ` hjl dot tools at gmail dot com [this message] 2008-05-17 15:19 ` [Bug middle-end/36253] " hjl dot tools at gmail dot com 2008-05-17 23:51 ` hjl dot tools at gmail dot com 2008-05-17 23:59 ` hjl at gcc dot gnu dot org 2008-05-26 14:01 ` hjl at gcc dot gnu dot org 2008-05-26 14:29 ` hjl dot tools at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080517021725.1227.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).