This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't ICE with huge alignment (PR middle-end/60226)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 3 Jul 2014 12:13:31 +0200
- Subject: Re: [PATCH] Don't ICE with huge alignment (PR middle-end/60226)
- Authentication-results: sourceware.org; auth=none
- References: <20140304164029 dot GN16545 at redhat dot com> <53B1BF74 dot 2060801 at redhat dot com>
On Mon, Jun 30, 2014 at 01:50:12PM -0600, Jeff Law wrote:
> On 03/04/14 09:40, Marek Polacek wrote:
> >This should fix ICE on insane alignment. Normally, check_user_alignment
> >detects e.g. alignment 1 << 32, but not 1 << 28. However, record_align
> >is in bits, so it's actually 8 * (1 << 28) and that's greater than
> >INT_MAX. This patch rejects such code.
> >
> >In the middle hunk, we should give up when an error occurs, we don't
> >want to call finalize_type_size in that case -- we'd ICE in there.
> >
> >Regtested/bootstrapped on x86_64-linux, ok for trunk?
> >
> >2014-03-04 Marek Polacek <polacek@redhat.com>
> >
> > PR middle-end/60226
> > * stor-layout.c (layout_type): Return if alignment of array elements
> > is greater than element size. Error out if requested alignment is too
> > large.
> >cp/
> > * class.c (layout_class_type): Error out if requested alignment is too
> > large.
> >testsuite/
> > * c-c++-common/pr60226.c: New test.
> Is this still applicable after the wide-int changes? I haven't looked
> closely.
Yeah, it applies cleanly. But I tried the int -> unsigned change
which Mike suggested and that cures the ICE. I'll send a patch
momentarily.
Marek