Bug 53582 - [4.6 regression] ICE on valid code
Summary: [4.6 regression] ICE on valid code
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.3
: P3 normal
Target Milestone: 4.6.4
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-05 17:33 UTC by Andy Lutomirski
Modified: 2012-06-06 09:19 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work: 4.6.4
Known to fail: 4.6.3
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Lutomirski 2012-06-05 17:33:00 UTC
g++ -O2 segfaults on this code.  Tested on gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2).  4.7 and trunk work.  4.5 seems okay as well.

struct A {
  A();
};

unsigned f1();

void f2() {
  while(true) {
    unsigned x;
    try {
      f1();
    } catch(char) {
      x = (unsigned)-1;
    }
    if (x != 1) {
      new A;
      continue;
    }
  }
}
Comment 1 Richard Biener 2012-06-06 09:19:13 UTC
Confirmed for 4.6.3, works on the 4.6 branch head.  Probably a dup.