public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/30778]  New: [4.3 Regression] invalid code generation for memset() with -mtune=k8
@ 2007-02-12 19:03 belyshev at depni dot sinp dot msu dot ru
  2007-02-12 19:22 ` [Bug target/30778] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2007-02-12 19:03 UTC (permalink / raw)
  To: gcc-bugs

Reduced from combine.c, fails if compiled with "-O1 -mtune=k8", doesn't fail
with "-O1 -mtune=generic".
possibly introduced between r119211 and r119769 (not sure about this).

// -------------------8<-------------------------------------------------------
extern void *memset (void *, int, unsigned long);
extern void abort (void);

struct reg_stat {
  void *last_death;
  void *last_set;
  void *last_set_value;
  int   last_set_label;
  char  last_set_sign_bit_copies;
  int   last_set_mode : 8;
  char  last_set_invalid;
  char sign_bit_copies;
  long nonzero_bits;
};

static struct reg_stat *reg_stat;

void __attribute__((noinline))
init_reg_last (void)
{
  memset (reg_stat, 0, __builtin_offsetof (struct reg_stat, sign_bit_copies));
}

int main (void)
{
  struct reg_stat r;

  reg_stat = &r;
  r.nonzero_bits = -1;
  init_reg_last ();
  if (r.nonzero_bits != -1)
    abort ();
  return 0;
}
// ------------------->8-------------------------------------------------------


-- 
           Summary: [4.3 Regression] invalid code generation for memset()
                    with -mtune=k8
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: belyshev at depni dot sinp dot msu dot ru
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30778


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-02-26  7:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12 19:03 [Bug middle-end/30778] New: [4.3 Regression] invalid code generation for memset() with -mtune=k8 belyshev at depni dot sinp dot msu dot ru
2007-02-12 19:22 ` [Bug target/30778] " pinskia at gcc dot gnu dot org
2007-02-13  9:44 ` rguenth at gcc dot gnu dot org
2007-02-16  2:01 ` pinskia at gcc dot gnu dot org
2007-02-24  8:53 ` ubizjak at gmail dot com
2007-02-24 10:59 ` ubizjak at gmail dot com
2007-02-24 22:55 ` ubizjak at gmail dot com
2007-02-24 23:09 ` hubicka at gcc dot gnu dot org
2007-02-24 23:24 ` ubizjak at gmail dot com
2007-02-24 23:47 ` hubicka at gcc dot gnu dot org
2007-02-25  7:54 ` ubizjak at gmail dot com
2007-02-25 17:37 ` hubicka at gcc dot gnu dot org
2007-02-26  7:04 ` ubizjak at gmail dot com

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).