Compiled source that has worked on previous 2.95.x and 3.0.x versions Release: gcc-core-3.1 Environment: Slackware 8 based Linux 2.2.19 How-To-Repeat: description in attachment
State-Changed-From-To: open->analyzed State-Changed-Why: pre_insert_copy_insn expects a single_set insn, but is being given a parallel with multiple sets. This is clearly an internal logic failure somewhere in GCSE.
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 */
Confirmed still present with gcc 3.2.3, 3.3 branch and mainline (20030602).
Duplicate of 10467 which has a reduced testcase. *** This bug has been marked as a duplicate of 10467 ***