http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51117
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-12-08
17:24:27 UTC ---
Created attachment 26025
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26025
gcc47-pr51117.patch
Untested fix. This improves e.g.:
struct A { char buf[64]; };
void bar (A *);
void
foo ()
{
{
A a;
bar (&a);
if (a.buf[13])
throw 1;
}
{
A b;
bar (&b);
if (b.buf[13])
throw 2;
}
}
back to 4.6 generated code quality, but it doesn't already e.g.:
struct A
{
char buf[64];
};
void bar (A *);
void
foo ()
{
A c;
bar (&c);
try
{
{
A a;
bar (&a);
if (a.buf[13])
throw 1;
else if (a.buf[52])
throw 3;
}
{
A b;
bar (&b);
if (b.buf[13])
throw 2;
}
}
catch ( ...)
{
throw;
}
}
I think it should be safe to move the clobbers to the EH destination of the
!stmt_can_throw_external (stmt) GIMPLE_RESX for that, but am not 100% sure
about that yet and would prefer to do it incrementally anyway.