public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/53688] [4.8 Regression] 191.fma3d in SPEC CPU 2000 miscompiled
Date: Mon, 18 Jun 2012 13:51:00 -0000	[thread overview]
Message-ID: <bug-53688-4-JI8l13DmnQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53688-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-18 13:50:28 UTC ---
NEW_PAGE seems to be miscompiled - we fail to output JOB_ID_RECORD%VERSION
('SPEC CPU'), the comparison difference is lots of

@@ -146,7 +146,7 @@
   43255/3    1.1579E+03   -8.1233E+02    0.0000E+00    2.5290E+02   
0.0000E+00    0.0000E+00         1   41   1.42E+02 43255
   43255/4   -3.5068E+03   -4.3304E+03    0.0000E+00    2.0702E+04   
0.0000E+00    0.0000E+00         1   41   1.42E+02 43255
   43255/5   -3.5204E+03   -3.2181E+03    0.0000E+00    2.4813E+04   
0.0000E+00    0.0000E+00         1   41   1.42E+02 43255
-1 FMA-3D  SPEC CPU       Impulse Loaded Cylindrical Panel (w/ Subcycling) -
100MB Data Set                              Page No:  10
+1 FMA-3D                 Impulse Loaded Cylindrical Panel (w/ Subcycling) -
100MB Data Set                              Page No:  10

     Time T = 4.57200E-07   Time Step =     360
 0   NP    X-DISPLACE   Y-DISPLACE   Z-DISPLACE   X-VELOCITY   Y-VELOCITY  
Z-VELOCITY  X-ACCELERATE Y-ACCELERATE Z-ACCELERATE     NP

by inspecting with gdb you can see that JOB_ID_RECORD%VERSION is properly
populated but HEADLINE is not properly built.

It is sched2 who re-orders

(insn:TI 102 100 250 8 (parallel [
            (set (reg:DI 2 cx [143])
                (const_int 0 [0]))
            (set (reg/f:DI 5 di [141])
                (plus:DI (reg/f:DI 5 di [141])
                    (reg:DI 2 cx [143])))
            (set (mem/c:BLK (reg/f:DI 5 di [141]) [0 MEM[(void *)&headline +
9B]+0 A8])
                (const_int 0 [0]))
            (use (reg:QI 0 ax [142]))
            (use (reg:DI 2 cx [143]))
        ]) t.f90:43848 896 {*rep_stosqi}
     (expr_list:REG_UNUSED (reg/f:DI 5 di [141])
        (nil)))

and

(insn:TI 106 96 107 8 (set (mem/c:DI (const:DI (plus:DI (symbol_ref:DI
("headline.65670") [flags 0x2]  <var_decl 0x7fc398ffbdc0 headline>)
                    (const_int 10 [0xa]))) [0 MEM[(c_char * {ref-all})&headline
+ 10B]+0 S8 A16])
        (reg:DI 1 dx [orig:146 MEM[(c_char * {ref-all})&job_id_record + 12B] ]
[146])) t.f90:43850 62 {*movdi_internal_rex64}
     (expr_list:REG_DEAD (reg:DI 1 dx [orig:146 MEM[(c_char *
{ref-all})&job_id_record + 12B] ] [146])
        (nil)))

quite possibly because the MEM_ATTRs in the setmem pattern do not have
a MEM_EXPR that has a suitable size.

Testcase:

char headline[256];
struct hdr {
  char part1[9];
  char part2[8];
} p;

void __attribute__((noinline,noclone))
init()
{
  __builtin_memcpy (p.part1, "FOOBARFOO", sizeof (p.part1));
  __builtin_memcpy (p.part2, "SPEC CPU", sizeof (p.part2));
}

int main()
{
  char *x;
  int c;
  init();
  __builtin_memcpy (&headline[0], p.part1, 9);
  c = 9;
  x = &headline[0];
  x = x + c;
  __builtin_memset (x, ' ', 245);
  __builtin_memcpy (&headline[10], p.part2, 8);
  c = 18;
  x = &headline[0];
  x = x + c;
  __builtin_memset (x, ' ', 238);
  if (headline[10] != 'S')
    __builtin_abort ();
  return 0;
}


  parent reply	other threads:[~2012-06-18 13:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 18:07 [Bug middle-end/53688] New: " hjl.tools at gmail dot com
2012-06-15 18:09 ` [Bug middle-end/53688] " hjl.tools at gmail dot com
2012-06-17 11:42 ` rguenth at gcc dot gnu.org
2012-06-18 13:51 ` rguenth at gcc dot gnu.org [this message]
2012-06-19  8:45 ` ebotcazou at gcc dot gnu.org
2012-06-21 12:18 ` matz at gcc dot gnu.org
2012-06-21 12:52 ` matz at gcc dot gnu.org

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=bug-53688-4-JI8l13DmnQ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).