public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/61320] [4.10 regression] ICE in jcf-parse.c:1622 (parse_class_file
Date: Fri, 25 Jul 2014 13:16:00 -0000	[thread overview]
Message-ID: <bug-61320-4-km8DaFF3XV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61320-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61320

--- Comment #61 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Ok, I suppose
> 
>         lduh    [%g3], %g4      ! MEM[base: ptr_110, offset: 0B], min_line
> 
> is not an instruction that works with unaligned %g3.

Right, every load must be aligned.

> ;; min_line_106 = (int) _215;
> 
> (insn 921 920 922 (set (reg:HI 482)
>         (mem:HI (reg/v/f:SI 185 [ ptr ]) [0 MEM[base: ptr_110, offset: 0B]+0
> S2 A8])) /vol/gcc/src/hg/trunk/local/gcc/java/jcf-parse.c:1622 -1
>      (nil))
> 
> a (mem:HI ...) with A8.  I wonder if we should ICE somewhere if such kind
> of MEM is in the RTL instruction stream on a STRICT_ALIGNMENT platform?

No, it's undefined behavior at run time only.

> Ah, so the issue is that may_be_unaligned does
> 
> 1706      unsigned int align = TYPE_ALIGN (TREE_TYPE (ref));
> 1707
> 1708      unsigned HOST_WIDE_INT bitpos;
> 1709      unsigned int ref_align;
> 1710      get_object_alignment_1 (ref, &ref_align, &bitpos);
> 1711      if (ref_align < align
> 1712          || (bitpos % align) != 0
> 1713          || (bitpos % BITS_PER_UNIT) != 0)
> 1714        return true;
> 
> thus it queries TYPE_ALIGN (TREE_TYPE (ref)) which is 8 - and _not_
> mode alignment which is what matters on STRICT_ALIGNMENT targets.

Yes, and that's what the original implementation actually did, see:
  https://gcc.gnu.org/ml/gcc-patches/2014-01/msg00717.html

> Fix:
> 
> Index: gcc/tree-ssa-loop-ivopts.c
> ===================================================================
> --- gcc/tree-ssa-loop-ivopts.c  (revision 213050)
> +++ gcc/tree-ssa-loop-ivopts.c  (working copy)
> @@ -1704,6 +1704,8 @@ may_be_unaligned_p (tree ref, tree step)
>      return false;
>  
>    unsigned int align = TYPE_ALIGN (TREE_TYPE (ref));
> +  if (GET_MODE_ALIGNMENT (TYPE_MODE (TREE_TYPE (ref))) > align)
> +    align = GET_MODE_ALIGNMENT (TYPE_MODE (TREE_TYPE (ref)));
>  
>    unsigned HOST_WIDE_INT bitpos;
>    unsigned int ref_align;
> 
> can you test and apply that patch?

I think that it needs to be applied on both mainline and 4.9 branch then.


  parent reply	other threads:[~2014-07-25 13:16 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-61320-4@http.gcc.gnu.org/bugzilla/>
2014-05-26 13:31 ` ro at gcc dot gnu.org
2014-05-26 13:47 ` rguenth at gcc dot gnu.org
2014-05-26 13:48 ` rguenth at gcc dot gnu.org
2014-05-26 14:06 ` ebotcazou at gcc dot gnu.org
2014-05-27  8:15 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-05-27  8:18 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-05-27  8:36 ` thomas.preudhomme at arm dot com
2014-05-30 20:27 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-05-31 14:13 ` ebotcazou at gcc dot gnu.org
2014-06-03  2:26 ` thomas.preudhomme at arm dot com
2014-06-03 10:17 ` thomas.preudhomme at arm dot com
2014-06-03 10:26 ` ebotcazou at gcc dot gnu.org
2014-06-03 11:20 ` rguenth at gcc dot gnu.org
2014-06-03 11:21 ` rguenth at gcc dot gnu.org
2014-06-03 11:23 ` rguenth at gcc dot gnu.org
2014-06-03 11:48 ` rguenth at gcc dot gnu.org
2014-06-03 19:27 ` ebotcazou at gcc dot gnu.org
2014-06-04  1:27 ` thomas.preudhomme at arm dot com
2014-06-04  1:48 ` thomas.preudhomme at arm dot com
2014-06-04  8:10 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-04  8:14 ` ebotcazou at gcc dot gnu.org
2014-06-04  8:16 ` thomas.preudhomme at arm dot com
2014-06-04  8:52 ` thomas.preudhomme at arm dot com
2014-06-04  8:56 ` thomas.preudhomme at arm dot com
2014-06-04  8:59 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-04  9:01 ` thomas.preudhomme at arm dot com
2014-06-04  9:43 ` rguenth at gcc dot gnu.org
2014-06-05 10:50 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-05 10:55 ` thomas.preudhomme at arm dot com
2014-06-06  9:03 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-06  9:25 ` thomas.preudhomme at arm dot com
2014-06-06 10:51 ` thomas.preudhomme at arm dot com
2014-06-12  2:49 ` thopre01 at gcc dot gnu.org
2014-06-12 10:32 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-12 13:11 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-13  5:40 ` thopre01 at gcc dot gnu.org
2014-06-13  5:45 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-18 10:50 ` thopre01 at gcc dot gnu.org
2014-06-18 10:55 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-24 17:04 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-25  3:37 ` thopre01 at gcc dot gnu.org
2014-06-25 13:20 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-06-30  3:20 ` thopre01 at gcc dot gnu.org
2014-06-30  7:17 ` thopre01 at gcc dot gnu.org
2014-07-17 11:49 ` ro at gcc dot gnu.org
2014-07-17 12:02 ` rguenth at gcc dot gnu.org
2014-07-17 12:30 ` thopre01 at gcc dot gnu.org
2014-07-17 12:35 ` rguenth at gcc dot gnu.org
2014-07-17 15:50 ` ebotcazou at gcc dot gnu.org
2014-07-17 16:13 ` thopre01 at gcc dot gnu.org
2014-07-17 19:20 ` rguenther at suse dot de
2014-07-23  9:59 ` rguenth at gcc dot gnu.org
2014-07-24 12:58 ` rguenth at gcc dot gnu.org
2014-07-24 14:39 ` ro at gcc dot gnu.org
2014-07-24 14:41 ` ro at gcc dot gnu.org
2014-07-25 10:11 ` rguenth at gcc dot gnu.org
2014-07-25 13:16 ` ebotcazou at gcc dot gnu.org [this message]
2014-07-29  8:11 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-08-06  6:15 ` tony.wang at arm dot com
2014-08-06 11:25 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-08-06 11:41 ` rguenth at gcc dot gnu.org
2014-08-06 11:42 ` rguenth at gcc dot gnu.org
2014-08-06 11:43 ` rguenth at gcc dot gnu.org
2014-09-03 12:27 ` pinskia at gcc dot gnu.org

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=bug-61320-4-km8DaFF3XV@http.gcc.gnu.org/bugzilla/ \
    --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: link
Be 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).