Bug 19774

Summary: VLA's vs SjLj EH unwind
Product: gcc Reporter: Danny Smith <dannysmith>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: aaron, ebotcazou, gcc-bugs, ktietz, Tringi, voidspec
Priority: P2 Keywords: EH, sjlj-eh, wrong-code
Version: 3.4.4   
Target Milestone: ---   
Host: i686-pc-mingw32 Target: i686-pc-mingw32
Build: i686-pc-mingw32 Known to work:
Known to fail: Last reconfirmed: 2005-09-30 05:32:58
Bug Depends on:    
Bug Blocks: 25266    

Description Danny Smith 2005-02-03 08:11:54 UTC
The following testcase fails when using  sjlj EH unwind (mingw32
compiler) but succeeds when using Dwarf2 EH unwind (also mingw with
sources modified to enable Dwarf2).

Is this related to PR 19771?

/* sjlj_vla.cc */
extern "C" void abort(void);

void foo()
{
  int size = 1;
  int a[size];

  a[0] = 0;

  try
    {
      throw 0;
    }
  catch (int i)
    {
    }
  
  if (a[0] != 0)
    abort();
}

int main()
{
  foo();
}
Comment 1 Andrew Pinski 2005-05-05 05:34:12 UTC
Confirmed, also on i686-pc-openbsd3.1 which also uses sjlj exceptions.
Comment 2 Andrew Pinski 2007-03-14 06:06:08 UTC
*** Bug 30196 has been marked as a duplicate of this bug. ***
Comment 3 patchapp@dberlin.org 2007-03-14 18:46:00 UTC
Subject: Bug number PR middle-end/19774

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00946.html
Comment 4 Andrew Pinski 2007-10-23 20:48:43 UTC
*** Bug 33874 has been marked as a duplicate of this bug. ***
Comment 5 Kai Tietz 2012-01-23 23:18:07 UTC
I tested this patch with current trunk (4.7.0) and test passes without issues.  The reported gcc version having this bug is pretty old.  So I close it.