Bug 54022 - [4.8 regression] ICE in hoist_edge_and_branch_if_true
Summary: [4.8 regression] ICE in hoist_edge_and_branch_if_true
Status: RESOLVED DUPLICATE of bug 53881
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 21:02 UTC by Eric Botcazou
Modified: 2012-07-22 21:29 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-07-19 00:00:00


Attachments
Reduced testcase (330 bytes, text/plain)
2012-07-18 21:02 UTC, Eric Botcazou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Botcazou 2012-07-18 21:02:00 UTC
Created attachment 27826 [details]
Reduced testcase

Visible on x86-64/Linux at least at -O2:

eric@hermes:~/build/gcc/native> gcc/xgcc -Bgcc -S discr2.ads -O2
+===========================GNAT BUG DETECTED==============================+
| 4.8.0 20120716 (experimental) [trunk revision 189525] (x86_64-suse-linux) GCC error:|
| in hoist_edge_and_branch_if_true, at tree-switch-conversion.c:80         |
| Error detected around discr2.ads:6:1|

The testcase can be added to the testsuite as gnat.dg/specs/discr2.ads.
Comment 1 Eric Botcazou 2012-07-19 10:21:20 UTC
Something peculiar here is that the default and another case jumps to the same basic block:

  switch (D.4089_3) <default: L0, case 0 ... 7: <L3>, case 8: <L0>>

[...]

  # R86s_8 = PHI <0(2), 0(3), 0(6), 1(14)>
L0:
<L3>:
  D.4087_7 = D.4084_1 ^ 1;
  D.4086_9 = D.4087_7 & R86s_8;
  if (D.4086_9 != 0)
    goto <bb 8>;
  else
    goto <bb 9>;
Comment 2 Steven Bosscher 2012-07-19 11:04:32 UTC
(In reply to comment #1)
> Something peculiar here is that the default and another case jumps to the same
> basic block:

Just like in PR53887 so this is very peculiar -- I thought I had already fixed this.  Will look into it tonight.
Comment 3 Steven Bosscher 2012-07-22 21:29:42 UTC
.

*** This bug has been marked as a duplicate of bug 53881 ***