Bug 50587 - ICE init_range_entry, at tree-ssa-reassoc.c:1698 caused by recent change
Summary: ICE init_range_entry, at tree-ssa-reassoc.c:1698 caused by recent change
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: unknown
: P3 major
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-01 14:31 UTC by Andi Kleen
Modified: 2011-10-03 11:55 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-10-03 00:00:00


Attachments
gcc47-pr50587.patch (341 bytes, patch)
2011-10-03 07:57 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andi Kleen 2011-10-01 14:31:31 UTC
Jakub, your recent change

        PR tree-optimization/46309
        * fold-const.c (make_range, merge_ranges): Remove prototypes.
        (make_range_step): New function.
        (make_range): Use it.
        * tree.h (make_range_step): New prototypes.
        * Makefile.in (tree-ssa-reassoc.o): Depend on $(DIAGNOSTIC_CORE_H).
        * tree-ssa-reassoc.c: Include diagnostic-core.h.
        (struct range_entry): New type.
        (init_range_entry, range_entry_cmp, update_range_test,
        optimize_range_tests): New functions.
        (reassociate_bb): Call optimize_range_tests.

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

breaks my LTO kernel builds.

I get a lot of

internal compiler error: in init_range_entry, at tree-ssa-reassoc.c:1698

in different files. With the patch reverted things are fine
Comment 1 Markus Trippelsdorf 2011-10-02 13:18:00 UTC
It also breaks LTO build of Firefox with the same ICE.
Comment 2 Jakub Jelinek 2011-10-03 07:57:27 UTC
Created attachment 25402 [details]
gcc47-pr50587.patch

Does this patch fix it?  I've reproduce it only on invalid code:
extern int c[64];

int
foo (int a)
{
  int x = a > 1;
  int y = &c[60] < (int *) 0x12345678UL;
  return x | y;
}
Comment 3 Markus Trippelsdorf 2011-10-03 08:44:09 UTC
(In reply to comment #2)
> Created attachment 25402 [details]
> gcc47-pr50587.patch
> 
> Does this patch fix it?

Yes it fixes both the LTO kernel and Firefox builds.
Thanks.
Comment 4 Jakub Jelinek 2011-10-03 09:06:43 UTC
Author: jakub
Date: Mon Oct  3 09:06:38 2011
New Revision: 179447

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179447
Log:
	PR tree-optimization/50587
	* tree-ssa-reassoc.c (init_range_entry): Stop iterating when
	arg0 is not a SSA_NAME.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-reassoc.c
Comment 5 Jakub Jelinek 2011-10-03 11:55:30 UTC
Fixed.