Bug 39226 - [4.4/4.5 Regression] gcc_assert (verify_initial_elim_offsets ()); ICE
Summary: [4.4/4.5 Regression] gcc_assert (verify_initial_elim_offsets ()); ICE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.4.0
: P2 normal
Target Milestone: 4.4.0
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2009-02-18 07:55 UTC by Jakub Jelinek
Modified: 2009-04-01 18:24 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc64-linux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-02-18 19:34:53


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2009-02-18 07:55:43 UTC
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -mtune=cell -mminimal-toc" { target { powerpc*-*-* && lp64 } } } */

struct A
{
  char *a;
  unsigned int b : 1;
  unsigned int c : 31;
};

struct B
{
  struct A *d;
};

void
foo (struct B *x, unsigned long y)
{
  if (x->d[y].c)
    return;
  if (x->d[y].b)
    x->d[y].a = 0;
}

ICEs with -m64 -O2 -mtune=cell -mminimal-toc, as elimination offsets change.
Comment 1 pinskia@gmail.com 2009-02-18 10:30:09 UTC
Subject: Re:   New: [4.4 Regression] gcc_assert (verify_initial_elim_offsets ()); ICE

This is mostly likely due to my no micro code patch. I see what causes  
it tommorow.

Sent from my iPhone

On Feb 17, 2009, at 11:55 PM, "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> /* { dg-do compile } */
> /* { dg-options "-O2" } */
> /* { dg-options "-O2 -mtune=cell -mminimal-toc" { target { powerpc*- 
> *-* && lp64
> } } } */
>
> struct A
> {
>  char *a;
>  unsigned int b : 1;
>  unsigned int c : 31;
> };
>
> struct B
> {
>  struct A *d;
> };
>
> void
> foo (struct B *x, unsigned long y)
> {
>  if (x->d[y].c)
>    return;
>  if (x->d[y].b)
>    x->d[y].a = 0;
> }
>
> ICEs with -m64 -O2 -mtune=cell -mminimal-toc, as elimination offsets  
> change.
>
>
> -- 
>           Summary: [4.4 Regression] gcc_assert  
> (verify_initial_elim_offsets
>                    ()); ICE
>           Product: gcc
>           Version: 4.4.0
>            Status: UNCONFIRMED
>          Keywords: ice-on-valid-code
>          Severity: normal
>          Priority: P3
>         Component: target
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: jakub at gcc dot gnu dot org
> GCC target triplet: powerpc64-linux
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39226
>
Comment 2 Jakub Jelinek 2009-02-18 12:28:25 UTC
Yeah.  Unlike anddi3_internal3_mc insn, anddi3_internal3_nomc only has an alternative with "t" for the and64_2_operand that is not slightly disparaged (?s), so for masks that match mask_operand or mask64_operand reload decides
to reload the DImode constant into register, which needs to be put into memory and needs a TOC register etc.
Comment 3 Andrew Pinski 2009-02-18 19:34:53 UTC
Hmm, for the PS3 toolchain, I think I just removed anddi3_internal3_mc.
Mine.
Comment 4 Jakub Jelinek 2009-02-18 19:40:42 UTC
You mean anddi3_internal3_nomc, right?  If so, I guess anddi3_internal2_nomc should be removed too.
Comment 5 Andrew Pinski 2009-02-18 19:41:56 UTC
(In reply to comment #4)
> You mean anddi3_internal3_nomc, right?  If so, I guess anddi3_internal2_nomc
> should be removed too.

I will have to look at what I did, I know I ran into a case where a constant was being generated but really does not need to be generated ...
Comment 6 Jakub Jelinek 2009-03-03 14:25:00 UTC
http://gcc.gnu.org/ml/gcc-patches/2009-03/msg00148.html patch posted.
Comment 7 Jakub Jelinek 2009-04-01 16:19:03 UTC
Subject: Bug 39226

Author: jakub
Date: Wed Apr  1 16:18:46 2009
New Revision: 145411

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145411
Log:
	PR target/39226
	* config/rs6000/rs6000.md (andsi3_internal5_nomc,
	anddi3_internal2_nomc, anddi3_internal3_nomc): Removed.
	(booldi3_internal3): Use boolean_or_operator instead of
	boolean_operator.

	* gcc.dg/pr39226.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr39226.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/rs6000.md
    trunk/gcc/testsuite/ChangeLog

Comment 8 Jakub Jelinek 2009-04-01 16:22:31 UTC
Subject: Bug 39226

Author: jakub
Date: Wed Apr  1 16:22:17 2009
New Revision: 145412

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145412
Log:
	PR target/39226
	* config/rs6000/rs6000.md (andsi3_internal5_nomc,
	anddi3_internal2_nomc, anddi3_internal3_nomc): Removed.
	(booldi3_internal3): Use boolean_or_operator instead of
	boolean_operator.

	* gcc.dg/pr39226.c: New test.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr39226.c
      - copied unchanged from r145411, trunk/gcc/testsuite/gcc.dg/pr39226.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/config/rs6000/rs6000.md
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog

Comment 9 Jakub Jelinek 2009-04-01 18:24:33 UTC
Fixed.
Comment 10 Jakub Jelinek 2009-04-01 18:24:50 UTC
So closing.