This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/6860: [3.2/3.3/3.4 regression] [arm-thumb] pre_insert_copy_insn
- From: David Welch <dwelch at dwelch dot com>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 1 Apr 2003 05:26:01 -0000
- Subject: Re: optimization/6860: [3.2/3.3/3.4 regression] [arm-thumb] pre_insert_copy_insn
- Reply-to: David Welch <dwelch at dwelch dot com>
The following reply was made to PR optimization/6860; it has been noted by GNATS.
From: David Welch <dwelch at dwelch dot com>
To: dwelch at zianet dot com,gcc-gnats at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot org,
nobody at gcc dot gnu dot org,gcc-prs at gcc dot gnu dot 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 */