This commit was manufactured by cvs2svn to create branch

'gcc-3_1-branch'.

From-SVN: r50059
This commit is contained in:
No Author 2002-02-26 21:13:19 +00:00
parent 557bfaaf39
commit 443be906bf
2 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,17 @@
/* PR debug/5770
This testcase failed at -O -g because the following constants
were optimized away since they were never referenced, but
since they are variables with initializers, rtl_for_decl_location
run expand_expr on their initializers and returned it.
This lead to references to constants which were deferred and thus
never emitted. */
/* { dg-do link } */
static const char foo[] = "foo string";
static const char bar[30] = "bar string";
static const wchar_t baz[] = L"baz string";
int
main ()
{
}

View File

@ -0,0 +1,60 @@
/* { dg-do compile } */
/* Here's the deal: f3 is not inlined because it's too big, but f2 and
f1 are inlined into it. We used to fail to emit debugging info for
t1, because it was moved inside the (inlined) block of f1, marked
as abstract, then we'd crash. */
#define UNUSED __attribute__((unused))
#define EXT __extension__
int undef(void);
inline static void
f1 (int i UNUSED)
{
}
inline static void
f2 (void)
{
f1 (EXT ({ int t1 UNUSED; undef (); }));
}
inline static void
f3 (void)
{
int v1 UNUSED;
int v2 UNUSED;
EXT ({ int t2 UNUSED; if (0) undef (); 0; })
&& EXT ({ int t3 UNUSED; if (0) undef (); 0; });
if (1)
{
undef ();
if (1)
f2 ();
}
{
undef ();
}
}
inline static void
f4 (void)
{
EXT ({ undef (); 1; }) && EXT ({ int t4 UNUSED = ({ 1; }); 1; });
{ }
EXT ({ int t5 UNUSED; if (0) undef (); 0; });
f4 ();
undef ();
f3 ();
return;
}