Bug 37387 - [4.4 Regression] ICE in extract_range_from_binary_expr, at tree-vrp.c:2145
Summary: [4.4 Regression] ICE in extract_range_from_binary_expr, at tree-vrp.c:2145
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-09-05 20:05 UTC by Martin Michlmayr
Modified: 2008-09-09 10:07 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-09-08 09:46:11


Attachments
Preprocessed code (17.70 KB, application/octet-stream)
2008-09-05 20:07 UTC, Martin Michlmayr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2008-09-05 20:05:55 UTC
With current trunk (r140043) on powerpc (but not on x86_64):

(sid)2492:tbm@test: ..4.3-2008-09-05-r140043/gcc] ./cc1 -quiet -O2 ~/gap-costab.i
../../src/costab.c: In function 'FuncStandardizeTable2C':
../../src/costab.c:2780: internal compiler error: in extract_range_from_binary_expr, at tree-vrp.c:2145
Please submit a full bug report,
with preprocessed source if appropriate.
Comment 1 Martin Michlmayr 2008-09-05 20:07:36 UTC
Created attachment 16235 [details]
Preprocessed code
Comment 2 Martin Michlmayr 2008-09-05 20:25:40 UTC
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */

typedef long int Int;
typedef Int **Bag;
FuncMakeConsequencesPres (Bag self, Bag list)
{
  Bag objDefs1;
  Bag objDefs2;
  if (!  ( (((Int) 0) + 13) <=
        (((Int) (objDefs1) & 0x01) ? ((Int) 0)
         : (((Int) (objDefs1) & 0x02) ? ((Int) 0)
            : *(*(objDefs1)  )))
        && (((Int) (objDefs1) & 0x01) ? (((Int) 0) )
            : (((Int) (objDefs1) & 0x02) ? (((Int) 0) )
                  : (*(*(objDefs2) - 3) & 0xFFL))) <= 0))
      ErrorQuit ();
}
Comment 3 Andrew Pinski 2008-09-06 21:59:00 UTC
Further reduced testcase:
typedef long int Int;
void FuncMakeConsequencesPres (long *objDefs1)
{
  long a = (long)objDefs1;
  int c = a & 0x01;
  int b = 0;
  if (!  ( 13 <= ( c ? 0 : (((int) objDefs1 & 0x02) ? 0 : *objDefs1  ))
	   && b <= 0))
    ErrorQuit ();
}

--- CUT ---
ifcombine causes the invalid IR to show up:
  D.1597_10 = objDefs1_1(D) & 3B;
objDefs1 is a pointer.

Comment 4 Richard Biener 2008-09-08 09:46:11 UTC
Mine.
Comment 5 Richard Biener 2008-09-09 10:07:13 UTC
Subject: Bug 37387

Author: rguenth
Date: Tue Sep  9 10:05:49 2008
New Revision: 140142

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140142
Log:
2008-09-09  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/37387
	* tree-ssa-ifcombine.c (ifcombine_iforif): Convert the name
	and bits to a common type.

	* gcc.c-torture/compile/pr37387.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37387.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-ifcombine.c

Comment 6 Richard Biener 2008-09-09 10:07:40 UTC
Fixed.