public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/6860: [3.2/3.3/3.4 regression] [arm-thumb] pre_insert_copy_insn
@ 2003-04-01 5:26 David Welch
0 siblings, 0 replies; only message in thread
From: David Welch @ 2003-04-01 5:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR optimization/6860; it has been noted by GNATS.
From: David Welch <dwelch@dwelch.com>
To: dwelch@zianet.com,gcc-gnats@gcc.gnu.org,gcc-bugs@gcc.gnu.org,
nobody@gcc.gnu.org,gcc-prs@gcc.gnu.org
Cc:
Subject: Re: optimization/6860: [3.2/3.3/3.4 regression] [arm-thumb]
pre_insert_copy_insn
Date: Mon, 31 Mar 2003 22:19:05 -0700
http://gcc.gnu.org/cgi-bin/gnatsweb.pl
This bug can be minimized to the following code (didnt try very hard to get
this far, perhaps it could
be minimized further).
if you uncomment the #ifdef NOSTRUCTASSIGN block you will get the error,
leave it commented and at least this portion of code does not cause a
pre_insert_copy_insn error...
David
#include <stdio.h>
//#include "dhry.h"
/*
#ifdef NOSTRUCTASSIGN
#define structassign(d, s) memcpy(&(d), &(s), sizeof(d))
#else
#define structassign(d, s) d = s
#endif
*/
#ifdef NOENUM
#define Ident_1 0
#define Ident_2 1
#define Ident_3 2
#define Ident_4 3
#define Ident_5 4
typedef int Enumeration;
#else
typedef enum {Ident_1, Ident_2, Ident_3, Ident_4, Ident_5}
Enumeration;
#endif
typedef struct record
{
struct record *Ptr_Comp;
Enumeration Discr;
union {
struct {
Enumeration Enum_Comp;
int Int_Comp;
char Str_Comp [31];
} var_1;
struct {
Enumeration E_Comp_2;
char Str_2_Comp [31];
} var_2;
struct {
char Ch_1_Comp;
char Ch_2_Comp;
} var_3;
} variant;
} Rec_Type, *Rec_Pointer;
Rec_Pointer Ptr_Glob;
Enumeration Func_1 ();
#ifndef ROPT
#define REG
/* REG becomes defined as empty */
/* i.e. no register variables */
#else
#define REG register
#endif
Proc_1 (Ptr_Val_Par)
/******************/
REG Rec_Pointer Ptr_Val_Par;
/* executed once */
{
REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
/* == Ptr_Glob_Next */
/* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */
/* corresponds to "rename" in Ada, "with" in Pascal */
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
Ptr_Val_Par->variant.var_1.Int_Comp = 5;
Next_Record->variant.var_1.Int_Comp
= Ptr_Val_Par->variant.var_1.Int_Comp;
Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
Proc_3 (&Next_Record->Ptr_Comp);
/* Ptr_Val_Par->Ptr_Comp->Ptr_Comp
== Ptr_Glob->Ptr_Comp */
if (Next_Record->Discr == Ident_1)
/* then, executed */
{
Next_Record->variant.var_1.Int_Comp = 6;
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
&Next_Record->variant.var_1.Enum_Comp);
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
&Next_Record->variant.var_1.Int_Comp);
}
else /* not executed */
structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
} /* Proc_1 */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-04-01 5:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-01 5:26 optimization/6860: [3.2/3.3/3.4 regression] [arm-thumb] pre_insert_copy_insn David Welch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).