public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: David Welch <dwelch@dwelch.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: optimization/6860: [3.2/3.3/3.4 regression] [arm-thumb] pre_insert_copy_insn
Date: Tue, 01 Apr 2003 05:26:00 -0000	[thread overview]
Message-ID: <20030401052601.23387.qmail@sources.redhat.com> (raw)

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 */
 
 
 
 
 


                 reply	other threads:[~2003-04-01  5:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030401052601.23387.qmail@sources.redhat.com \
    --to=dwelch@dwelch.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).